필터 지우기
필터 지우기

The solution of the nonlinear equation obtained by ‘fzero’ is different from that of 'fsolve'.

조회 수: 2 (최근 30일)
i use the 'fzero' and 'fsove' to get the roots of the nonlinear equation,and the function figure is as this ,so we can see the first positive root is about 1.5 and the second positive root is about 5,
and in the 'fsolve' we get the first 2 positive roots of the equation
m1=1.786212;
m2=5.287127;
but use the 'fzero',it runs out
m1=1.570796;
m2=4.712389;
and it didn't have any hints ,how queer is it.
it means that we should use an interval in the 'fzero'?
and the most important is that is didn't have any warnings.
codes are as this
g=9.8;
h=20;
hgang=20;
omega=2;
syms m0;
syms m1;
nu=omega^2*hgang/g;
g=(i*m1)*tanh(i*m1)-nu;
misan=inline(g);
m=zeros(10,1);
format long
for n=1:2;
x0=[1.5+(n-1)*pi];
m(n)=fzero(misan,x0);
fprintf('m%d=%f;\n',n,m(n));
end
figure are as this

채택된 답변

Walter Roberson
Walter Roberson 2019년 5월 13일
fzero() identified a location with a sign change. The sign happened to change because of a singularity there, but it is still a sign change.
So, if you are going to use fzero, either use an interval or use a better starting approximation.
  댓글 수: 1
dcydhb dcydhb
dcydhb dcydhb 2019년 5월 13일
but when i use a single value rather the interval,it still give the roots and didn't have any warnings,so it means that the avalibility of 'fzero' is less than the 'fsolve'?
x0=1.5+(n-1)*pi;

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

추가 답변 (0개)

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by