Problem 3
Question
A differential equation with initial condition and its analytic solution are shown. i. Show that the analytic solution satisfies the initial condition and the differential equation. ii. Use Euler's method and the trapezoid methods to approximate the solution to the differential equation on the interval shown and using the step size shown. iii. Plot the solution and the Euler's and trapezoid approximations on a single \(t, y\) plane. a. \(y(0)=1 \quad y^{\prime}(t)=y^{2} \quad y(t)=(1-t)^{-1} \quad 0 \leq t \leq 0.4 \quad h=0.1\) b. \(y(0)=2 \quad y^{\prime}(t)=-y^{2} \quad y(t)=(t+0.5)^{-1} \quad 0 \leq t \leq 0.4 \quad h=0.1\) c. \(y(0)=1 \quad y^{\prime}(t)=t \times y \quad y(t)=e^{t^{2} / 2} \quad 0 \leq t \leq 1 \quad h=0.2\) d. \(y(0)=1 \quad y^{\prime}(t)=\sqrt{y} \quad y=(t / 2+1)^{2} \quad 0 \leq t \leq 1 \quad h=0.2\)
Step-by-Step Solution
VerifiedKey Concepts
Euler's Method
- \( y_n \) is the current value,
- \( h \) is the step size,
- \( f(t_n, y_n) \) is the function describing the slope of the curve.
Trapezoid Method
- It reduces error by considering the tangential direction at both endpoints of the interval.
- It's best used where higher precision is needed than what Euler's method can provide, but still maintains simplicity.
Differential Equations
- This requires solving either analytically by finding an exact solution or numerically via methods like Euler's or Trapezoid.
Analytic Solution
- The left-hand side is computed using derivatives: \( y'(t) = (1-t)^{-2} \).
- The right-hand side involves calculating \( y(t)^2 \), which must equal \( (1-t)^{-2} \).