[Scilab-users] Having a Problem with fsolve

rsherry8 rsherry8 at comcast.net
Mon Oct 15 20:39:52 CEST 2018


I am trying to solve a system of two non-linear equations using fsolve. 
I define the following two functions:

function z=g1(x,y)
z = x^2 + y^2
endfunction

function z=g2(x,y)
z = x^4 + y^4 - 20
endfunction

When I type something like: g2(2,2)
I get 12 which is right.

I then run the following command:
     [xres]=fsolve([0,0],g1,g2);

and I get the error message:

     fsolve: exception caught in 'jac' subroutine.
     at line     2 of function g1
     in builtin                fsolve

What am I doing wrong?

Bob



More information about the users mailing list