From: Fredric on
"Gene " <ecliff(a)vt.edu> wrote in message <i3ug3g$7so$1(a)fred.mathworks.com>...
> "Fredric " <fredricb(a)student.chalmers.se> wrote in message <i3ud9g$187$1(a)fred.mathworks.com>...
> > "John D'Errico" <woodchips(a)rochester.rr.com> wrote in message <i3ucua$7rd$1(a)fred.mathworks.com>...
> > > "Fredric " <fredricb(a)student.chalmers.se> wrote in message <i3ua49$s8t$1(a)fred.mathworks.com>...
> > > > Hi all,
> > > >
> > > > trying to solve a system of non-linear equations with fsolve but without success. These are my files
> > > >
> > >
> > > Why do you know that a solution must exist?
> > >
> > > Not every problem has a solution.
> > >
> > > John
> >
> >
> > The problem describes transport of heat and mass through a chemical reactor and thus I am quite certain that there must be a solution (i.e. that what goes into the reactor comes out).
> >
> > //
>
> Hi Fredric:
>
> Do you know that your 'tankreactor' function returns a real, 7 dimensional value ? The Matlab message implies that it doesn't think so. Without knowing what the
> Cp.m, thermal_conductivity.m and viscosity.m support files return it's hard to deduce this from your code. One of the 'lines' delimited by ';' could evaluate to a n by 1 vector.
>
> Also, as noted by John D's existence of a solution (more generally well-posedness) of the mathematical problem does not follow from the fact that the physical problem has a solution.

Hi Gene,
all the support files return scalar values, I do however not see which line you mean could evaluate to a n-by-1-vector depending on these support files - cold you perhaps clarify that? That might explain why the matlab message states that it is a non suare system, could it not?

Thanks for the help!

// Fredric
From: Gene on
> > Hi Fredric:
> >
> > Do you know that your 'tankreactor' function returns a real, 7 dimensional value ? The Matlab message implies that it doesn't think so. Without knowing what the
> > Cp.m, thermal_conductivity.m and viscosity.m support files return it's hard to deduce this from your code. One of the 'lines' delimited by ';' could evaluate to a n by 1 vector.
> >
> > Also, as noted by John D's existence of a solution (more generally well-posedness) of the mathematical problem does not follow from the fact that the physical problem has a solution.
>
> Hi Gene,
> all the support files return scalar values, I do however not see which line you mean could evaluate to a n-by-1-vector depending on these support files - cold you perhaps clarify that? That might explain why the matlab message states that it is a non suare system, could it not?
>
> Thanks for the help!
>
> // Fredric

Fredric:
Sorry if I caused any confusion - I do not know that any line 'does evaluate' to a n by 1 vector, only that Matlab would be perfectly happy to evaluate it, since such 'stacking' of column vectors is permissible.

I suggest that you simply try to evaluate
y = testreactor(x0)
and see if y is a 7 component 1D array. More generally, find out why 'fsolve' complains about a non-square array.

Good Luck

gene