Borrar filtros
Borrar filtros

Implementation of numerical method

1 visualización (últimos 30 días)
evi
evi el 1 de Abr. de 2015
Editada: John D'Errico el 1 de Abr. de 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 comentario
John D'Errico
John D'Errico el 1 de Abr. de 2015
Editada: John D'Errico el 1 de Abr. de 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.

Iniciar sesión para comentar.

Respuestas (0)

Categorías

Más información sobre Programming en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by