Effacer les filtres
Effacer les filtres

Implementation of numerical method

1 vue (au cours des 30 derniers jours)
evi
evi le 1 Avr 2015
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 commentaire
John D'Errico
John D'Errico le 1 Avr 2015
Modifié(e) : John D'Errico le 1 Avr 2015
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.

Connectez-vous pour commenter.

Réponses (0)

Catégories

En savoir plus sur Programming dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by