[Scipy-svn] r2991 - trunk/Lib/optimize

scipy-svn at scipy.org scipy-svn at scipy.org
Sun May 13 13:16:00 EDT 2007


Author: ondrej
Date: 2007-05-13 12:15:57 -0500 (Sun, 13 May 2007)
New Revision: 2991

Modified:
   trunk/Lib/optimize/nonlin.py
Log:
updated documentation in nonlin


Modified: trunk/Lib/optimize/nonlin.py
===================================================================
--- trunk/Lib/optimize/nonlin.py	2007-05-13 17:05:11 UTC (rev 2990)
+++ trunk/Lib/optimize/nonlin.py	2007-05-13 17:15:57 UTC (rev 2991)
@@ -11,11 +11,13 @@
 
 def F(x):
     "Should converge to x=[0,0,0,0,0]"
-    d=numpy.array([3,2,1.5,1,0.5])
-    c=0.01
+    import numpy
+    d = numpy.array([3,2,1.5,1,0.5])
+    c = 0.01
     return -d*numpy.array(x)-c*numpy.array(x)**3
 
-x= solvers.broyden2(F,[1,1,1,1,1])
+from scipy.optimize import nonlin
+x = nonlin.broyden2(F,[1,1,1,1,1])
 
 All solvers have the parameter iter (the number of iterations to compute), some
 of them have other parameters of the solver, see the particular solver for




More information about the Scipy-svn mailing list