Question 3.7: (a) Write a spreadsheet program to solve the equation mz + c......

(a) Write a spreadsheet program to solve the equation m\ddot{z} + c\dot{z} + kz = F by the fourth-order Runge–Kutta method.

(b) Plot the displacement time history, z, with F = constant = 100 N; initial conditions z_{0} = u_{0} = 0 and

m = 1 kg;

k = 10 000 N/m and

c = 20 N/m/s.

Compare the plot with the exact answer from the expression derived in Example 2.3.

Step-by-Step
The 'Blue Check Mark' means that this solution was answered by an expert.
Learn more on how do we answer questions.

(a) A suitable spreadsheet layout, based on Table 3.5 and Eqs (3.36) and (3.37), using one row per value of j, is shown in Table 3.6. The initial conditions z_0 and u_0 in the first row are set to zero in this case. F_0 is the value of F at t_0.

z_{j+1} = z_{j} + \frac{h}{6} \left(u_{j}^{(1)} + 2u_{j}^{(2)} + 2u_{j}^{(3)} + u_{j}^{(4)}\right)                  (3.36)

u_{j+1} = u_{j} + \frac{h}{6} \left(\dot{u}_{j}^{(1)} + 2\dot{u}_{j}^{(2)} + 2\dot{u}_{j}^{(3)} + \dot{u}_{j}^{(4)}\right)                  (3.37)

(b) Fig. 3.10 is a plot of the Runge–Kutta result compared with the exact solution from Example 2.3. The time-step, h, was 0.005 s in this case. An acceptable result was also obtained with h = 0.0075 s.

Table 3.5 Intermediate Calculations in the Runge–Kutta Method
z_{j}^{(1)} = z_{j} u_{j}^{(1)} = u_{j} \dot{u}_{j}^{(1)} = \frac{F_{j}}{m} – \frac{c}{m}u_{j}^{(1)} – \frac{k}{m}z_{j}^{(1)}
z_{j}^{(2)} = z_{j} + \frac{h}{2} u_{j}^{(1)} u_{j}^{(2)} = u_{j} + \frac{h}{2} \dot{u}_{j}^{(1)} \dot{u}_{j}^{(2)} = \frac{F_{j}}{m} – \frac{c}{m}u_{j}^{(2)} – \frac{k}{m}z_{j}^{(2)}
z_{j}^{(3)} = z_{j} + \frac{h}{2} u_{j}^{(2)} u_{j}^{(3)} = u_{j} + \frac{h}{2} \dot{u}_{j}^{(2)} \dot{u}_{j}^{(3)} = \frac{F_{j}}{m} – \frac{c}{m}u_{j}^{(3)} – \frac{k}{m}z_{j}^{(3)}
z_{j}^{(4)} = z_{j} + hu_{j}^{(3)} u_{j}^{(4)} = u_{j} + h\dot{u}_{j}^{(3)} \dot{u}_{j}^{(4)} = \frac{F_{j}}{m} – \frac{c}{m}u_{j}^{(4)} – \frac{k}{m}z_{j}^{(4)}
Table 3.6 Spreadsheet for the Fourth-order Runge–Kutta Method
j t_{j} z_{j}^{(1)}  \mathrm{and  response}  z_{j} z_{j}^{(2)} z_{j}^{(3)} z_{j}^{(4)} u_{j}^{(1)}  \mathrm{and  response}  \dot{z}_{j} u_{j}^{(2)} u_{j}^{(3)} u_{j}^{(4)} \dot{u}_{j}^{(1)} \mathrm{and}   \ddot{z}_{j} \dot{u}_{j}^{(2)} \dot{u}_{j}^{(3)} \dot{u}_{j}^{(4)}
0 0 = z_{0} (= initial value of z = 0) = z_{0} + \frac{h}{2}u_{0}^{(1)} = z_{0} + \frac{h}{2}u_{0}^{(2)} = z_{0} + hu_{0}^{(3)} = u_{0} (= initial value of u = 0) = u_{0} + \frac{h}{2}\dot{u}_{0}^{(1)} = u_{0} + \frac{h}{2}\dot{u}_{0}^{(2)} = u_{0} + h\dot{u}_{0}^{(3)} = \frac{F_{0}}{m} – \frac{c}{m}u_{0}^{(1)} – \frac{k}{m}z_{0}^{(1)} = \frac{F_{0}}{m} – \frac{c}{m}u_{0}^{(2)} – \frac{k}{m}z_{0}^{(2)} = \frac{F_{0}}{m} – \frac{c}{m}u_{0}^{(3)} – \frac{k}{m}z_{0}^{(3)} = \frac{F_{0}}{m} – \frac{c}{m}u_{0}^{(4)} – \frac{k}{m}z_{0}^{(4)}
1 h = z_{0} + \frac{h}{6} \left(u_{0}^{(1)} + 2u_{0}^{(2)} + 2u_{0}^{(3)} + u_{0}^{(4)}\right) = z_{1} + \frac{h}{2}u_{1}^{(1)} = z_{1} + \frac{h}{2}u_{1}^{(2)} = z_{1} + hu_{1}^{(3)} = u_{0} + \frac{h}{6} \left(\dot{u}_{0}^{(1)} + 2\dot{u}_{0}^{(2)} + 2\dot{u}_{0}^{(3)} + \dot{u}_{0}^{(4)}\right) = u_{1} + \frac{h}{2}\dot{u}_{1}^{(1)} = u_{1} + \frac{h}{2}\dot{u}_{1}^{(2)} = u_{1} + h\dot{u}_{1}^{(3)} = \frac{F_{1}}{m} – \frac{c}{m}u_{1}^{(1)} – \frac{k}{m}z_{1}^{(1)} = \frac{F_{1}}{m} – \frac{c}{m}u_{1}^{(2)} – \frac{k}{m}z_{1}^{(2)} = \frac{F_{1}}{m} – \frac{c}{m}u_{1}^{(3)} – \frac{k}{m}z_{1}^{(3)} = \frac{F_{1}}{m} – \frac{c}{m}u_{1}^{(4)} – \frac{k}{m}z_{1}^{(4)}
2 2h = z_{1} + \frac{h}{6} \left(u_{1}^{(1)} + 2u_{1}^{(2)} + 2u_{1}^{(3)} + u_{1}^{(4)}\right) = z_{2} + \frac{h}{2}u_{2}^{(1)} = z_{2} + \frac{h}{2}u_{2}^{(2)} = z_{2} + hu_{2}^{(3)} = u_{1} + \frac{h}{6} \left(\dot{u}_{1}^{(1)} + 2\dot{u}_{1}^{(2)} + 2\dot{u}_{1}^{(3)} + \dot{u}_{1}^{(4)}\right) = u_{1} + \frac{h}{2}\dot{u}_{1}^{(1)} = u_{2} + \frac{h}{2}\dot{u}_{1}^{(2)} = u_{2} + h\dot{u}_{1}^{(3)}
3
3.10

Related Answered Questions