필터 지우기
필터 지우기

How to Supply the Jacobian to Fsolve?

조회 수: 26 (최근 30일)
Pablo
Pablo 2014년 11월 18일
답변: Alan Weiss 2014년 11월 18일
pow=fsolve(@eqns,pop);
This is the code I am using to solve a 2x2 non-linear system of equations, defined in the function eqns.m.
pop is a 2x1 initialisation vector pretty close to the solution. When I run it, the output says
No solution found.
fsolve stopped because the relative size of the current step is less than the
default value of the step size tolerance squared, but the vector of function values
is not near zero as measured by the default value of the function tolerance.
<stopping criteria details>
Any way out? I tried moving the initial point further away from the solution intentionally, still it is not working. How do I set the tolerance or some other parameter? Some posts gave me the impression that supplying the jacobian to matlab can be helpful, but how do I do that? Please note that I need the solution in the form of a code which I can put in a function file to be called repeatedly. I believe the interactive optimtool toolbox would not help here. Any help please?

답변 (1개)

Alan Weiss
Alan Weiss 2014년 11월 18일
Here is an example of a nonlinear equation being solved with its Jacobian.
If you want or need to use symbolic math to calculate the Jacobian, see this example.
Alan Weiss
MATLAB mathematical toolbox documentation

카테고리

Help CenterFile Exchange에서 Solver Outputs and Iterative Display에 대해 자세히 알아보기

제품

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by