From bug-octave-request at bevo dot che dot wisc dot edu Wed Oct 21 14:48:24 1998 Subject: Problem with fsolve From: "John W. Eaton" To: Daniel Tourde Cc: help-octave at bevo dot che dot wisc dot edu, bug-octave@bevo.che.wisc.edu, jwe@bevo.che.wisc.edu Date: Wed, 21 Oct 1998 14:47:46 -0500 (CDT) On 21-Oct-1998, Daniel Tourde wrote: | I'm trying to use fsolve and I have a lot of troubles. | | If I consider the following function : | | function y = test2(x) | | y(1) = x(1)*x(2)-2; | y(2) = x(2)^2 -4; | y(3) = x(1)^2 -1; | y(4) = x(1) + x(2) -3; | | endfunction | | where quite obviously the solutions are 1 and 2 if the forth condition | is taken into account, I obtain : | | 1 and 2 if I type [y,index] = fsolve[test2,[10,10]) | index = 1 | | but also the wrong solution | | -1 and -2 if I type [y,index] = fsolve[test2,[-10,-10]) | index = 1 | | Where is the problem ? | | Why the y(4) specification is not taken into account ? I think the problem is that fsolve expects a square system of equations (number of variables == number of equations). BTW, there is no need to send a message to me as well as the help- or bug-octave mailing lists. I read both. Thanks, jwe