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
but use the 'fzero',it runs out
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 longfor 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