Borrar filtros
Borrar filtros

Solving a nonlinear equation using fsolve. cant reach at perfect result. output showing some error written below.

1 visualización (últimos 30 días)
Where M*_N = m - (a*sigma)
Equation solved. fsolve completed because the vector of function values is near zero as measured by the value of the
function tolerance, and the problem appears regular as measured by the gradient.
used code :
Result must be around 22-25. but itc coming .0029.
Is there anything wrong i am doing?
  1 comentario
Star Strider
Star Strider el 23 de En. de 2022
Since fsolve is a root-finding algorithm, plot the function to see if there are any zero-crossings. Since fsolve can find complex as well as real roots, it might be worth giving it complex initial parameter estimates to see what it finds.

Iniciar sesión para comentar.

Respuesta aceptada

Matt J
Matt J el 23 de En. de 2022
Editada: Matt J el 23 de En. de 2022
Result must be around 22-25. but itc coming .0029.
As the plot shows, your function has no roots in the range 22-25
p = 1;
pfun=@(sigma) arrayfun( @(z)fun(z,p) , sigma);
fplot(pfun,[0,25])
xlabel sigma; ylabel fun
function sigmares = fun(sigma,p)
m = 939;
ms = 550;
b = -7.25*10^(-3);
gs = 8.238;
p0 = .15*(197.3)^3;
k = (1.5*p*p0*pi^2)^(1/3);
gss = (1 + (b*sigma/2))*gs;
m1 = (m-(gss*sigma));
F = ((1+(b*sigma))*gs*m1*(1/(2*ms^2*pi^3))*log((sqrt(k^2 + m1^2)+ k))) - sigma;
sigmares = F ;
end
  6 comentarios

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Solver Outputs and Iterative Display en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by