[SciPy-user] how can I get fsolve() work?!
Ri Hai
hai@lpt.rwth-aachen...
Fri Mar 30 09:48:05 CDT 2007
-----Ursprüngliche Nachricht-----
Von: scipy-user-bounces@scipy.org [mailto:scipy-user-bounces@scipy.org] Im Auftrag von Nils Wagner
Gesendet: Freitag, 30. März 2007 16:25
An: SciPy Users List
Betreff: Re: [SciPy-user] how can I get fsolve() work?!
Ri Hai wrote:
>
> Hell folks,
>
> When I use fsolve, python crashes! Now I am testing fsolve with the code from the mailing list:
>
> #-----------
> from scipy.optimize import fsolve
>
>
> def func2(x):
> out = [x[0]+2.*x[1]+2.*x[2]-1.]
> out.append(x[0]+x[2] - 2.*x[1])
> out.append(x[3]+x[4]-1.)
> out.append(1./5-2./5*x[2]+2./5*x[0]*x[3]-x[0])
> out.append(1./5-x[1]/5.-x[2]/5.+2/5.*x[1]*x[4]+x[1]/5.-x[1])
> #out.append(1/5-2/5*x[1]+2*x[2]/5+x[2]*x[3]/5)
> return out
>
> x02 = fsolve(func2, [0.25,0.25,0.5,0.5,0.5])
>
> #----------------
> / /
> The code is taken form the mail from john in July 2006 and he said it did work. However my python crashed again! I really don't know how to solve this problem.
>
> I use python 2.5, scipy 0.5.2, numpy 1.01 and windows XP.
>
> Has someone the same problem? Can somebody help me? Please...
>
> Hai
>
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> SciPy-user mailing list
> SciPy-user@scipy.org
> http://projects.scipy.org/mailman/listinfo/scipy-user
>
No problem here.
>>> numpy.__version__
'1.0.2.dev3617'
>>> scipy.__version__
'0.5.3.dev2892'
>>> x02
array([ 0.125 , 0.1875, 0.25 , 0.5 , 0.5 ])
>>> func2(x02)
[0.0, 0.0, 0.0, 3.4924590996965321e-11, -1.7462309376270468e-11]
What do you mean by crash ?
Nils
---------------------------------
Hello Nils,
Using fsolve, I get the following error message (in German and I have translated it):
"pythonw.exe ascertained a problem and python will be closed now."
So I could not even know what is wrong.
I have tried with your commands. You can see the information below.
>>> numpy.__version__
'1.0.1'
>>> scipy.__version__
'0.5.2'
Is there anything wrong with the version I have taken?
Hai
More information about the SciPy-user
mailing list