In: Advanced Math
Consider the following first-order ODE dy/dx=x^2/y from x = 0 to x = 2.4 with y(0) = 2. (a) solving with Euler’s explicit method using h = 0.6 (b) solving with midpoint method using h = 0.6 (c) solving with classical fourth-order Runge-Kutta method using h = 0.6. Plot the x-y curve according to your solution for both (a) and (b).
n | Xn | Yn | K1 | K2 |
0 | 0 | 2 | 0 | 0.0270 |
1 | 0.6 | 2.0270 | 0.1066 | 0.2336 |
2 | 1.2 | 2.2606 | 0.3822 | 0.5506 |
3 | 1.8 | 2.8113 | 0.6915 | 0.8381 |
4 | 2.4 | 3.6494 | 0.9470 | 1.0609 |
n | Xn | Yn | K1 | K2 | K3 | K4 |
0 | 0 | 2 | 0 | 0.0270 | 0.0268 | 0.1066 |
1 | 0.6 | 2.0357 | 0.106106 | 0.2327 | 0.2258 | 0.3820 |
2 | 1.2 | 2.2699 | 0.380634 | 0.5487 | 0.5306 | 0.6942 |
3 | 1.8 | 2.8088 | 0.692109 | 0.8387 | 0.8197 | 0.9525 |
4 | 2.4 | 3.6357 | 0.950575 | 1.0640 | 1.0495 | 1.1526 |
d)