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..

1 回表示 (過去 30 日間)
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 件のコメント
Ben Drebing
Ben Drebing 2017 年 12 月 18 日
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.
You can find the guidelines for posting homework questions here

サインインしてコメントする。

回答 (0 件)

カテゴリ

Help Center および File ExchangeNewton-Raphson Method についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by