Euler's Method for second order ODE
7 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Hello, i am trying to solve y''+(1/2)*y'+5y=0 with initial values of y'(0)=2 and y(0) = 0 using Euler's method. This is my code, can you please tell me how to fix it?
1 Kommentar
Antworten (1)
Abhiroop Rastogi
am 15 Feb. 2022
Hi Mohamed T. Adam,
The implementation of the differential equation, in the method that you have applied in your code, is not accurate. The way your equation would be represented is as follows:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/895040/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/895045/image.png)
You can find the the above implementation in the file attatched, named "Modified.m", for the modified code. The final output for the above equation will look as given in the figure below.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/895050/image.jpeg)
0 Kommentare
Siehe auch
Kategorien
Mehr zu Ordinary Differential Equations finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!