フィルターのクリア

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 Center および File ExchangeProgramming についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by