Finding the roots of equation by newton-raphson method?
Afficher commentaires plus anciens
According to the question that I attached, I am trying to solve the equation by newton-ralphson method. I have created the following structure, but I have few questions.
how will I decide to first x0 value? I really did not understand the logic of it.
and what should I do for the "ydx" line ? Should I evaluate the derivative by myself?
should I write all the operations with the '.' like '.^'?
and lastly is this the right structure for this question?
please do not use unknown commands, and stay in 'newton-ralphson' method.
thank you so much!
x0=2
y=(1-x)*sqrt(x+3)/(x*sqrt(x+1))-3.06;
tol=1e-4;
i=1
while y>tol
yx=(1-x0)*sqrt(x0+3)/(x0*sqrt(x0+1))-3.06;
ydx=
x1=x0-(yx/ydx)
y=(1-x1)*sqrt(x1+3)/(x1*sqrt(x1+1))-3.06;
x0=1
i=i+1
end
x0
i
y
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Newton-Raphson Method dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!