Hi everyone, I have problem with Newton Raphson method. I dont really understand question 3 and question 4. From my code, can someone explain what should i put and where is my mistake. Attached file below..
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Scrpit Body
%question (3) & question (4) x0 =transpose(1:19); tol = 10e-10; nmax = 100; x,niter = NewtonRaphson( x0,tol,nmax );
Main Body
function [ x,niter ] = NewtonRaphson( x0,tol,nmax )
%DATA N = 20; niter = 0; error = 1; x0 = zeros(N,1); dx = zeros(N,1);
while (error > tol && niter < nmax)
niter = niter + 1;
x = x0 - ((J_springs(x0))/(F_springs(x0)));
x0 = x;
error = max(abs(x-g(x0)));
end
for i = 2:N-2
dx(i) = x(i)-x(i-1);
end
end
1 comentario
Ben Drebing
el 18 de Dic. de 2017
Let us know what specifically is going wrong or what is confusing you. This will greatly increase your chances of getting an answer that you find helpful.
Respuestas (0)
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!