Solving a System of ODEs using Euler's method
64 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Hi,
I am having trouble finding a solution to a sytem of ODEs using Euler's method. I have tried several codes with several parameters, but I don't seem to get the right results. I have in addition to this text included the problem and my code as references. Any assitance would be greatly appreciated. Thanks
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/738349/image.png)
The code
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/738354/image.png)
0 Kommentare
Antworten (1)
Jan
am 14 Sep. 2021
Your function to be integrated depends on t also. You call this x in the Euler method.
At is easier to use vector equations:
f = @(t,y) [-t*y(1) - y(2); -y(1) + t * y(2)];
...
y(:, i + 1) = y(:, i) + h * f(t(i), y(:, i));
0 Kommentare
Siehe auch
Kategorien
Mehr zu Ordinary Differential Equations finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!