필터 지우기
필터 지우기

the question about solving nonlinear equations

조회 수: 2 (최근 30일)
ss
ss 2012년 5월 1일
hello,
I am using matlab to solving a nonlinear equations.
here is my Function file as below:
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%Ve,x,r,t,sigmaE are parameters; X(1),X(2) are roots;
function F = YL_parameter(X,Ve,x,r,t,sigmaE)
Va= X(1);
sigmaA = X(2);
F(1) = Va*normcdf((log(Va/x)+(r+sigmaA^2/2)*t)/(sigmaA*sqrt(t))) - x*exp(-r*t)*normcdf((log(Va/x)+(r+sigmaA^2/2)*t)/(sigmaA*sqrt(t)) - sigmaA*sqrt(t)) - Ve;
F(2) = (Va/Ve)*sigmaA*normcdf((log(Va/x)+(r+sigmaA^2/2)*t)/(sigmaA*sqrt(t))) - sigmaE;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
however, the matlab cannot solve the roots with exception as follows:
y= [1,1]
y =
1 1
>> [X,fval,exitflag]=fsolve(@(X)YL_parameter(X,Ve(1),x(1),r(1),t(1),sigmaE(1)),y)
No solution found.
fsolve stopped because the problem appears regular as measured by the gradient,
but the vector of function values is not near zero as measured by the
default value of the function tolerance.
<stopping criteria details>
X =
1 1
fval =
1.0e+010 *
-1.578202295500000 -0.000000000033697
exitflag =
-2
I don't know why? (is the problem initial value of the roots?)

답변 (2개)

Silibelo Kamwi
Silibelo Kamwi 2012년 5월 7일
Check in the optimization toolbox how fminunc or unconstrained optimization works.it might be able to help with nonlinear equations, but you need to get the derivative of the your system of equations.
hope this helps, IK

Sargondjani
Sargondjani 2012년 5월 8일
hmmm. strange. only thing i can think of is that the gradient is extremely large (infinity?) at this particular point...
did you try (many) different starting values??
it would also help if you supply the parameters values, so we can check everything ourselves

카테고리

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