Info

This question is closed. Reopen it to edit or answer.

Which is the best method to find zero ? and choose the max value and plot a graph comproving the zeros.

2 views (last 30 days)
For a given parameters
ss=0.6;
T=0.1;
g=1;
b=0.5;
f1 = @(r) 1 - (b./r).^2 - (g^-2)*((2/15)*(ss)^9 *(1./(r - 1).^9 - 1./(r + 1).^9 - 9./(8*r).*(1./(r - 1).^8 - 1./(r + 1).^8)) -(ss)^3 *(1./(r-1).^3 - 1./(r+1).^3 - 3./(2*r).*(1./(r-1).^2 - 1./(r+1).^2)));
I want to find the r value when
f1 == 0
So, which is the best method ? findzero, fminbnd, newtonraphson ? fsolve ?
i try
a1= fzerof1,[1.00000001)
assume(r, 'real');
t=vpasolve(1 - (b/r)^2 - (g^-2)*(2/15*[(s/R)]^9 *(1/(r - 1)^9 - 1/(r + 1)^9 - 9/(8* r) *(1/(r - 1)^8 - 1/(r + 1)^8)) - [(s/R)]^3 *(1/(r -1)^3 - 1/(r + 1)^3 - 3/(2* r)* (1/(r - 1)^2 - 1/(r + 1)^2))) == 0,r,[-Inf,Inf]);
t
options=optimset('MaxIter',1e3,'TolFun',1e-10);
t1=fminbnd(func,0.1,15,options);
t1
but i dont know if it is correct. I want to plot a graph r x f1 to see the zeros.
Any help how i can find zeros exactly ?

Answers (0)

Tags

Community Treasure Hunt

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

Start Hunting!