Use eulers Method using matlab with 2 different step sizes. Please show code for both problems.

3 vues (au cours des 30 derniers jours)
  8 commentaires
Ameer Hamza
Ameer Hamza le 15 Juin 2020
Original Question asked by Kendrick Lolange:
Title: Use eulers Method using matlab with 2 different step sizes. Please show code for both problems.

Connectez-vous pour commenter.

Réponses (1)

Ameer Hamza
Ameer Hamza le 14 Juin 2020
Since this is a homework question, I will not give a complete code. However, I will point you to resources that can help you to understand how to implement the Euler method in MATLAB.
You can download the zip file given in this answer: https://www.mathworks.com/matlabcentral/answers/98293-is-there-a-fixed-step-ordinary-differential-equation-ode-solver-in-matlab-8-0-r2012b#answer_107643 and study the code of ode1.m. It is the implementation of the Euler method provided in very early releases of MATLAB. It is no longer included in MATLAB, but it is still useful to understand the implementation of the Euler method.
Following FEX packages are also helpful to learn about Euler method and its implementation MATLAB:
  4 commentaires
Kendrick Lolange
Kendrick Lolange le 14 Juin 2020
Thank you! These are the errors correct?
29.4986
39.0930
0.9769
0.9886
Ameer Hamza
Ameer Hamza le 14 Juin 2020
No, these are the solution at x=2 given by Euler Method. To find the error, you will need to solve the equation analytically.

Connectez-vous pour commenter.

Catégories

En savoir plus sur MATLAB 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