Page 262 - Excel for Scientists and Engineers: Numerical Methods
P. 262
CHAPTER 10 ORDINARY DIFFERENTIAL EQUATIONS. PART I 239
We define x as the displacement of the mass from its rest position at any time
t, and XI = dxfdt. Then, since d2xf dt2 =d ldt(dxf dt), equation 10-30 can be
written as the two equations
dx
- x' (10-3 1)
=
dt
(10-32)
You can now use the methods described previously for systems of first-order
differential equations to solve the problem.
Figure 10-17 shows part of a spreadsheet describing the displacement x of
the damped system as a function of time. The formula for the second derivative,
in cell E6, is
=(-kd*C6-ks*B6)/(m*0.01)
(The mass m is multiplied by 0.01 to convert it from kg to N s2 cm-', in order to
obtain the displacement in cm.) The custom function Runge3 is used in columns
B and C to calculate x (in column B) and XI (in column C); the array formula
entered in cells 87 and C7 is
{=Runge3(A6,B6:C6,D6:E6,A7-A6)}
The value of XI is in both columns C and D, since the same value is both the x
value (in column C) and the derivative (in column D); the formula in cell D6 is =C6.
Figure 10-17. Portion of the spreadsheet for damped vibration calculation.
The initial values for the calculation are in bold.
(folder 'Chapter 10 Examples', workbook 'ODE Examples', worksheet '2nd Order ODE')