[SciPy-user] fsolve help

John Hassler hasslerjc at adelphia.net
Sat Jul 15 08:57:26 EDT 2006


Actually, they're two different problems.  Assuming that a solution 
exists, having the same number of equations as unknowns allows you to 
find the "exact" solution (that is, there will be a solution which 
exactly fits the equations as written).  If you have more equations than 
unknowns (overdetermined system), there can be an "exact" solution only 
for infinite precision arithmetic.  Otherwise, the best you can do is to 
_minimize_ (in some sense) the residuals.  This is not the same thing as 
finding zeros, although there is some overlap among the various methods 
(see, eg., "Numerical Recipes," which explains this pretty well).

For example, imagine linear equations.  If you have two (non-parallel) 
lines, they cross at a single point (two eqn., two unknowns), and there 
is no ambiguity in calculating this point in finite precision 
arithmetic.  If you use three lines to define a single point 
(overdetermined), then you need infinite precision arithmetic to 
calculate the intersection.  If your numbers are not exactly 
representable in binary, then this isn't possible with a computer, and 
the best you can do is to calculate some form of minimum residual 
(closest approach).

I'm not familiar with Maple, but Mathcad, for example, would allow you 
to switch between zero-finding and minimization with a trivial change in 
your program.  Perhaps Maple does it automatically.

In another lifetime, I was a ChE professor, and taught this stuff.
john


sd wrote:
> OK -- if I convert to float it works, sort of.  I have to comment out (as you
> did) one of the constraints.  If I leave them all in, it crashes python.
>
> And, of course, w/ all the constraints (uncomment the last one), it should work
> (or at least it does on paper, and in maple).
>
> thanks!
>
> sd
>
> _______________________________________________
> SciPy-user mailing list
> SciPy-user at scipy.org
> http://projects.scipy.org/mailman/listinfo/scipy-user
>
>   



More information about the SciPy-User mailing list