comparison doc/interpreter/nonlin.txi @ 7359:8fb8d6985395

[project @ 2008-01-11 02:40:46 by jwe]
author jwe
date Fri, 11 Jan 2008 02:40:46 +0000
parents fd42779a8428
children b93ac0586e4b 72830070a17b
comparison
equal deleted inserted replaced
7358:6a0d7b8159a0 7359:8fb8d6985395
77 Then, call @code{fsolve} with a specified initial condition to find the 77 Then, call @code{fsolve} with a specified initial condition to find the
78 roots of the system of equations. For example, given the function 78 roots of the system of equations. For example, given the function
79 @code{f} defined above, 79 @code{f} defined above,
80 80
81 @example 81 @example
82 [x, info] = fsolve (@@f, [1; 2]) 82 [x, fval, info] = fsolve (@@f, [1; 2])
83 @end example 83 @end example
84 84
85 @noindent 85 @noindent
86 results in the solution 86 results in the solution
87 87
88 @example 88 @example
89 x = 89 x =
90 90
91 0.57983 91 0.57983
92 2.54621 92 2.54621
93
94 fval =
95
96 -5.7184e-10
97 5.5460e-10
93 98
94 info = 1 99 info = 1
95 @end example 100 @end example
96 101
97 @noindent 102 @noindent
139 144
140 @noindent 145 @noindent
141 Using this Jacobian is done with the following code 146 Using this Jacobian is done with the following code
142 147
143 @example 148 @example
144 [x, info] = fsolve (@{@@f, @@jacobian@}, [1; 2]); 149 [x, fval, info] = fsolve (@{@@f, @@jacobian@}, [1; 2]);
145 @end example 150 @end example
146 151
147 @noindent 152 @noindent
148 which gives the same solution as before. 153 which gives the same solution as before.
149 154