[SOLVED] CSE218-ODE

30.00 $

Category:

Description

5/5 - (1 vote)

Solve the following ODE numerically from x=0 to x=10.

๐‘‘๐‘ฆ

= (๐‘ฅ + 20๐‘ฆ) ๐‘ ๐‘–๐‘›(๐‘ฅ๐‘ฆ)

๐‘‘๐‘ฅ

Initial condition: y(0)=4

Apply Euler method, Heunโ€™s method (with a single corrector), Midpoint method, Ralstonโ€™s method, and 4th order RK method (as described in the book) to solve it. Write a single function for the 2nd order RK method and pass the value of a2 to the function for implementing Heunโ€™s method, Midpoint method and Ralstonโ€™s method.

Use the following step sizes: 0.01, 0.05, 0.1, 0.5

Generate the following graphs from the (x,y) points you get.

  • For each method, plot curves for all the step sizes in one graph (total 5 graphs, 4 curves in each graph)
  • For each step size, plot curves for all the methods in one graph (total 4 graphs. 5 curves in each graph)

Proper labeling should be done in every graph.