필터 지우기
필터 지우기

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

조회 수: 3 (최근 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 CenterFile Exchange에서 Newton-Raphson Method에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by