[Math] Harmonic oscillator with a square wave forcing

ordinary differential equations

Given the driven harmonic oscillator equation:
$$\ddot x(t)+\omega^2 x(t)=f(t)$$ the analytic solution, in some case can be easily found. How can we find a solution of the previous equation if the forcing term $f(t)$ is a square wave of the kind:
$$ f(t) = \left\{
\begin{array}{l l}
A & \quad \text{if $kT\le t\le k(T+\tau)$}\\
0 & \quad \text{otherwise }
\end{array} \right.$$
where $0\le k\le N$ with $N\in\mathbb{R}$? Obviously, $T$ is the period of the square wave and $\tau$ its length. Thanks.

Best Answer

First solve the problem with $f$ replaced with the Heaviside function $H$. Either with Laplace or without, this is not difficult: $$x(t) = \frac{1}{\omega^{ 2}}(1-\cos \omega t )H(t)$$ The given source function can be written as $$f(t)=A \sum_{k} \big( H(t-Tk)-H(t-kT-\tau)\big)$$ Accordingly, a solution is given by $$\frac{A}{\omega^2}\sum_{k } \big( (1-\cos \omega (t-Tk) )H(t-Tk)- (1-\cos \omega (t-Tk-\tau) )H(t-Tk-\tau) \big)$$ You can add the general solution of homogeneous equation to this.

Related Question