rsherry8
2018-10-15 18:39:52 UTC
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
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