필터 지우기
필터 지우기

Implementation of numerical method

조회 수: 1 (최근 30일)
evi
evi 2015년 4월 1일
편집: John D'Errico 2015년 4월 1일
Hello!!! We have the ode y'=y+4π cos (4πt)y, t in [0,1], y(0)=1. The exact solution is y(t)=e^(t+sin (4 π t)).
I have to implement the following numerical method
y^(n+1)=y^n+h * [rho* f(t^n,y^n)+(1-rho) *f(t^(n+1),y^(n+1))] , n=0,....,N-1 , y^0=y_0
for a uniform partition of [a,b] with step h=(b-a)/N.
I have to use the Newton method to find y^(n+1). Ihave to find also the total error of the method and the local error.
I implemented the method as followsed: http://pastebin.com/ShyrmEAJ Is it right?
  댓글 수: 1
John D'Errico
John D'Errico 2015년 4월 1일
편집: John D'Errico 2015년 4월 1일
Please just use the normal attachment tool (the paper clip button.) Links to other sites for this purpose should be discouraged.
Anyway, asking if your code is "right" is difficult, since it forces us to test it, to compare the results, to carefully read your code to look for problems, figure out how you wrote the code, etc. You should do all of that yourself, and since you already know the answer, you can verify if it worked.

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Programming에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by