Question: 1. Numerically integrate and plot the response (in MATLAB) of an underdamped system determined by $m=100$kg, $k=20$kN/m, and $c=200$kg/s, subject to the initial conditions of $x_0=0.01$m and $v_0=0.1$m/s and the applied force $F(t)=150 \cos(5t)$. Then plot the exact response. Compare the plot of the exact solution to the numerical simulation.
1. **Problem Statement:**
We have an underdamped mass-spring-damper system with mass $m=100$ kg, spring constant $k=20000$ N/m (since 20 kN/m = 20000 N/m), damping coefficient $c=200$ kg/s, initial displacement $x_0=0.01$ m, initial velocity $v_0=0.1$ m/s, and an external forcing function $F(t)=150 \cos(5t)$ N.
2. **Governing Equation:**
The equation of motion for a forced damped oscillator is:
$$m\ddot{x} + c\dot{x} + kx = F(t)$$
3. **Parameters and Important Quantities:**
- Natural frequency: $$\omega_n = \sqrt{\frac{k}{m}} = \sqrt{\frac{20000}{100}} = \sqrt{200} \approx 14.1421\, \text{rad/s}$$
- Damping ratio: $$\zeta = \frac{c}{2m\omega_n} = \frac{200}{2 \times 100 \times 14.1421} = \frac{200}{2828.42} \approx 0.0707$$
Since $\zeta < 1$, the system is underdamped.
4. **Numerical Integration Setup:**
Rewrite the second order ODE as a system of first order ODEs:
Let $$x_1 = x$$ and $$x_2 = \dot{x}$$.
Then:
$$\dot{x}_1 = x_2$$
$$\dot{x}_2 = \frac{1}{m} \left( F(t) - c x_2 - k x_1 \right)$$
Initial conditions:
$$x_1(0) = 0.01, \quad x_2(0) = 0.1$$
5. **Exact Solution:**
The exact steady-state solution for forced vibration is:
$$x_p(t) = X \cos(5t - \phi)$$
where
$$X = \frac{F_0/m}{\sqrt{(\omega_n^2 - \omega^2)^2 + (2\zeta \omega_n \omega)^2}}$$
$$\phi = \tan^{-1} \left( \frac{2\zeta \omega_n \omega}{\omega_n^2 - \omega^2} \right)$$
with forcing frequency $$\omega = 5$$ rad/s and forcing amplitude $$F_0 = 150$$ N.
Calculate:
$$X = \frac{150/100}{\sqrt{(14.1421^2 - 5^2)^2 + (2 \times 0.0707 \times 14.1421 \times 5)^2}} = \frac{1.5}{\sqrt{(200 - 25)^2 + (2 \times 0.0707 \times 14.1421 \times 5)^2}}$$
Calculate denominator:
$$(175)^2 + (2 \times 0.0707 \times 14.1421 \times 5)^2 = 30625 + (2 \times 0.0707 \times 14.1421 \times 5)^2$$
Calculate damping term:
$$2 \times 0.0707 \times 14.1421 \times 5 = 10$$
So denominator:
$$\sqrt{30625 + 100} = \sqrt{30725} \approx 175.3$$
Thus:
$$X = \frac{1.5}{175.3} \approx 0.00856$$
Phase angle:
$$\phi = \tan^{-1} \left( \frac{10}{175} \right) \approx \tan^{-1}(0.0571) \approx 0.057 \text{ rad}$$
6. **Summary of Exact Solution:**
$$x_p(t) = 0.00856 \cos(5t - 0.057)$$
7. **MATLAB Numerical Integration:**
Use MATLAB's ode45 or similar solver to integrate the system:
```matlab
m = 100; k = 20000; c = 200;
F0 = 150; omega = 5;
odefun = @(t,x) [x(2); (F0*cos(omega*t) - c*x(2) - k*x(1))/m];
x0 = [0.01; 0.1];
tspan = [0 20];
[t,x] = ode45(nodefun, tspan, x0);
% Plot numerical solution
plot(t,x(:,1)); hold on;
% Plot exact solution
x_exact = 0.00856*cos(5*t - 0.057);
plot(t,x_exact,'r--');
legend('Numerical','Exact');
title('Response of Underdamped System');
xlabel('Time (s)'); ylabel('Displacement (m)');
```
8. **Interpretation:**
- The numerical solution captures transient and steady-state behavior.
- The exact solution represents steady-state forced vibration.
- Initially, the numerical solution will show transient decay from initial conditions.
- Eventually, numerical and exact solutions converge in steady state.
9. **Assumptions:**
- Linear system with constant parameters.
- No nonlinearities or time-varying coefficients.
- Initial conditions are known exactly.
- External force is harmonic and continuous.
10. **Free Body Diagram:**
- Mass $m$ connected to a spring $k$ and damper $c$.
- External force $F(t)$ acting on mass.
- Displacement $x(t)$ measured from equilibrium.
**Final answer:**
The exact steady-state amplitude is approximately $0.00856$ m with phase lag $0.057$ rad.
Numerical integration confirms transient and steady-state response matching the exact solution over time.