Numerical Methods20805 marksNumerical: Euler's method ODEEuler's method for ODE solving
Solve the following differential equation with y(0) = 1 for x = 0.2 (h = 0.1) using Euler's Method.
Solve the following differential equation $$\frac{dy}{dx} = 3x + \frac{y}{2}$$ with $y(0) = 1$ for $x = 0.2$ $(h = 0.1)$ using Euler's Method. [5]
- ODE: $\dfrac{dy}{dx} = f(x,y) = 3x + \dfrac{y}{2}$ - Initial condition: $y(0) = 1 \Rightarrow x0 = 0,\ y0 = 1$ - Step size: $h = 0.1$ - Target: $y$ at $x = 0.2$ (2 steps) Euler's formula: $$y{n+1} = yn + h, f(xn, yn)$$ Iteration 1: $x0 = 0,\ y0 = 1$ $$f(0,1) = 3(0) + \frac{1}{2} = 0.5$$ $$y1 =...