fsolve help

조회 수: 6 (최근 30일)
Vasile Radu
Vasile Radu 2012년 2월 21일
I would like to use fsolve for two nonlinear equations. When I put explicit equations in a function (LBBnlenew2.m) it is ok. But I need to put each equation as a funtion itself (defined already, with the same variables). In this case the error is:
??? Undefined function or method 'norm' for input arguments of type 'sym'.
Error in ==> trustnleqn at 138 normgradinf = norm(grad,inf);
Error in ==> fsolve at 295 [x,FVAL,JACOB,EXITFLAG,OUTPUT,msg]=...
Error in ==> LBB_Instability_Load_M2_solver2 at 2 x=fsolve('LBBnlenew2',x0);
Please let me know how to avoid the error. Thanks Vasile

채택된 답변

Sean de Wolski
Sean de Wolski 2012년 2월 21일
class(grad)
class(inf)
If either of those are symbolic, you cannot use fsolve() since it's a numeric solver. Look into solve() instead.
  댓글 수: 2
Walter Roberson
Walter Roberson 2012년 2월 21일
It might be practical in your situation to use matlabFunction() to convert the symbolic function in to a function handle of a MATLAB function.
Sean de Wolski
Sean de Wolski 2012년 2월 21일
@Walter, good idea, that would make gradObj much easier to use.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Numeric Solvers에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by