In: Advanced Math
Consider the system modeled by the differential equation
dy/dt - y = t with initial condition y(0) = 1
the exact solution is given by y(t) = 2et − t − 1
Note, the differential equation dy/dt - y =t can be written as
dy/dt = t + y
using Euler’s approximation of dy/dt = (y(t + Dt) – y(t))/ Dt
(y(t + Dt) – y(t))/ Dt = (t + y)
y(t + Dt) = (t + y)Dt + y(t)
New Value = change + current value
time ∆t = 0.1 ∆t = 0.0001 Exact Value %Relative %Relative
Error ∆t = 0.1 Error ∆t = 0.0001
0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1.0