I have the differential equation $$ 0.22y'' + y' + 10000y = 2000\pi \cos (2000 \pi t) $$

from this I get the Euler's method system of equations: $$ t_{n+1} = t_n + 0.001 $$ $$ x_{n+1} = x_n + 0.001\left(\frac{2000\pi \cos(2000\pi t) - 10000y_n-x_n}{0.22}\right) $$ $$ y_{n+1} = y_n + 0.001x_n $$

and using Microsoft Excel to fill a spreadsheet with approximations using the Excel equations

t_n $\text{=B3+0.001}$

x_n $\text{=C3+0.001*(2000*PI()*COS(2000*PI()*B3)-10000*D3-C3)/0.22}$

y_n $\text{=D3+0.001*C3}$

where the initial conditions are B3=0, C3=1/0.22 and D3=0, and then obviously dragging down so the cell references update each time.

Plotting this data with Excel shows

enter image description here

while the true solution is mirrored, where the amplitude starts off high and slowly dampens.

Where am I going wrong in Euler's method.

  • $\begingroup$ There is something wrong about your discrete equations... the time step seems to vary from one equation to the other. $\endgroup$ Apr 26, 2021 at 12:49
  • $\begingroup$ @PierreCarre oh thanks for pointing that out but that was just a copying error, in the Excel equations ts consistent $\endgroup$
    – Matt
    Apr 26, 2021 at 13:25
  • 1
    $\begingroup$ The step size is too large. To even properly sample the $1000$ oscillations per time unit of the right side, you need about $10\,000$ samples per time unit, that is, a step size of $10^{-4}$ $\endgroup$ Apr 26, 2021 at 13:35
  • $\begingroup$ @LutzLehmann thank you so much! $\endgroup$
    – Matt
    Apr 26, 2021 at 13:57

1 Answer 1


It is a linear equation, you can compute the exact solution quite easily... $$ y(t)=\sin (213.201 x) (0.0110345 \sin (6069.98 x)+0.0103102 \sin (6496.39 x))+\cos (213.201 x) (-0.0110345 \cos (6069.98 x)+0.0103102 \cos (6496.39 x)+4.54618) $$

In fact, there will be no dampening.

  • $\begingroup$ Thanks, but that wasn't really the question. $\endgroup$
    – Matt
    Apr 26, 2021 at 13:26
  • 1
    $\begingroup$ @Matt My point is that no dampening should be observed, because it does not exist. $\endgroup$ Apr 26, 2021 at 20:33

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .