## 20.3 Second Order Equations

A second order differential equation is one which involves second derivatives. Here is one.

y" = -ky - fy' + Asin(wt)

where k, f A and w are parameters, t is the independent variable, and y the dependent one.

This is a very important equation, which describes the harmonic oscillator and basic electrical circuit.

The standard approach is to call y' a new variable, say v. Then we have two coupled first order equations:

y' = v, and v' = -ky - fv + Asin(wt)

and these can be treated as first order differential equations.

We will, for simplicity, attack the original equation as it is. To do so we make a column for t just as before, and now create a column for y and one for y'. You can if you want make a column for y" as well.

You can put your constants, k, f A and w in appropriate boxes, say b2, b3, b4 and b5.

If you start your columns at a10, b10, c10, you can set a10 to be your starting value for y, b10 your starting value for y, c10 your starting value for y', and put in your d column.

d10=-b\$2*b10-b\$3*b10+b\$4*sin(b\$5*a10)

You can then, with d in b6, set

a11 = a20 +b\$6,

b11= b10 +b\$6/2*(c10 +d10*b\$6/2) and

c11= c10 + b\$6/2*(d10 + b\$6/2*(-b\$2*c10 –b\$3*c10 + b\$4*b\$5*cos(b\$5*a10)))

This amounts to adding d to t,

If you now copy a11, b11 and c11 down, along with d10 you have an approximation to your solution.

You can then make a chart which shows y and y' vs t, or y' vs y, or chart both of these things if you like.

Exercise 20.2 Do this. By making d small enough and using enough rows, and varying your parameters, you can investigate the properties of solutions in this model as much as you like.