2080 12

CSC212 ยท 2080 ยท 5 marks

Write down the program for solving ordinary differential equation using Heun's method.

Write down the program for solving ordinary differential equation using Heun's method. [5]

Numerical MethodChapter 5: Solution of Ordinary Differential EquationsHeun's method

Heun's method is a predictor-corrector method (also called the improved Euler's method) for solving ODEs of the form: $$\frac{dy}{dx} = f(x, y), \quad y(x0) = y0$$ The core formula is: $$y{n+1} = yn + \frac{h}{2}(m1 + m2)$$ Where: - $m1 = f(xn,\ yn)$ (slope at the beginning of the interval) -