help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

fsolve question


From: John B. Thoo
Subject: fsolve question
Date: Fri, 22 Nov 2002 21:00:52 -0800

Hi. I'm new to Octave and to this list, so I apologize if this is a FAQ. (I did check the FAQ w/out success. I also scanned the archive for 2002, but, this being Nov, there were a lot in the archive and I may have overlooked the topic.) :-)

Page 173 of the Octave manual gives the following example for solving a system of nonlinear equations (copied and pasted from my trial).


octave:1> function y = f(x)
> y(1) = -2*x(1)^2 + 3*x(1)*x(2) + 4*sin(x(2)) - 6;
> y(2) = 3*x(1)^2 - 2*x(1)*x(2)^2 + 3*cos(x(1)) + 4;
> endfunction
octave:2> [x, info] = fsolve("f", [1; 2])
x =

  0.57983
  2.54621

info = 1
octave:3>


What is the role of the condition [1; 2] in fsolve? I played around changing them and got different solutions, but I'm not seeing how it's affecting the solution. (I'm sure I'm overlooking the obvious.) The manual calls them "initial conditions." Is that like a seed value for Newton's method? In particular, I'm trying to figure out what I should use to solve a system of 4 equations: [1; 2; 3; 4] or something cleverer?

Thanks.

---John.



-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:  http://www.octave.org
How to fund new projects:  http://www.octave.org/funding.html
Subscription information:  http://www.octave.org/archive.html
-------------------------------------------------------------



reply via email to

[Prev in Thread] Current Thread [Next in Thread]