Mathematics, Sciences, and Technologies

ODEs 4-5: Solving ODEs by Laplace Transform (Part 2)

,

Solving ODEs with Step/Delta Functions: Example

Continuing from the last tutorial, in some physical scenarios, the ODEs that we are solving may have a source term/forcing on the R.H.S. that is not simply a continuous function but rather consists of step/delta functions, e.g. in the form of a sequence of impulses. Then, exploiting the Laplace Transform of those step/delta functions, as suggested in this tutorial, can save us a lot of trouble. Let’s now take a look at the example below.

Solve the given ODE

\begin{align}
\frac{dy}{dx} + \alpha y = (1 -H(x-1))\sin(\pi x) \tag{1}
\end{align}

where \( y(0) = 0 \) and \( \alpha \) is a fixed constant.

The source term can be viewed as the first half of a sinusoidal wave that is switched off afterwards. By applying Laplace Transform on both sides, following all the discussed results in the previous posts, including the second shifting theorem (note that \( \sin(\pi x) = -\sin(\pi (x-1)) \)), we have

\begin{align}
sY(s) -y(0) + \alpha Y(s) = (s+\alpha) Y(s) = \frac{\pi}{s^2 + \pi^2} +\frac{e^{-s}\pi}{s^2 + \pi^2} \\
\Rightarrow Y(s) = \frac{\pi}{(s+\alpha)(s^2 + \pi^2)} +\frac{e^{-s}\pi}{(s+\alpha)(s^2 + \pi^2)} \tag{2}
\end{align}

Note that we have the partial fractions:

\begin{align}
\frac{\pi}{(s+\alpha)(s^2 + \pi^2)} &= \frac{\pi}{\pi^2+\alpha^2}(\frac{1}{s+\alpha} -\frac{s-\alpha}{s^2+\pi^2}) \tag{3}
\end{align}

The inverse Laplace transform of which is

\begin{align}
&\quad \frac{\pi}{\pi^2+\alpha^2}[e^{-\alpha x} -\cos(\pi x) + \frac{\alpha}{\pi}\sin(\pi x)] \\
&= \frac{\pi}{\pi^2+\alpha^2}(e^{-\alpha x} -\cos(\pi x)) + \frac{\alpha}{\pi^2+\alpha^2}\sin(\pi x) \tag{4}
\end{align}

Hence the answer will be (applying the second shifting theorem again)

\begin{align}
y &= \begin{aligned} &\frac{\pi}{\pi^2+\alpha^2}(e^{-\alpha x} -\cos(\pi x)) + \frac{\alpha}{\pi^2+\alpha^2}\sin(\pi x) \\
&+ \frac{H(x-1)\pi}{\pi^2+\alpha^2}(e^{-\alpha (x-1)} -\cos(\pi (x-1))) \\
&+ \frac{H(x-1)\alpha}{\pi^2+\alpha^2}\sin(\pi (x-1)) \end{aligned}
\tag{5}
\end{align}

Exercise

A simple RC circuit can be described by the ODE

\begin{align}
R\frac{dq}{dt} + \frac{1}{C}q = E(t) \tag{6}
\end{align}

This is the same as described by the exercise in this post but with the \( L \) component discarded, and a new source of voltage \( E(t) \) present. Consider a case in which initially the switch is open and there is neither charge nor current. After some time \(t = t_1\), the switch is closed and a constant voltage \(V_0\) is applied, and at a later time \(t = t_2\), the voltage source is turned off. Find how the charge \(q\) and current \(I = dq/dt\) change in time. How about if there is a short electric potential pulse \( E(t) = V_d\delta(t-t_3) \) instead? Important: the unit of a Dirac delta is the reciprocal of that of the argument inside, hence the Dirac delta here has a unit of \( \text{s}^{-1} \), and \(V_d\) will have a unit of \( \text{Vs} \) for consistency.

Answer

For the first case,

\begin{align}
E(t) = V_0(H(t-t_1)-H(t-t_2))
\end{align}

After applying Laplace Transform, the equation becomes

\begin{align}
R(s\mathscr{L}[q]) + \frac{1}{C}\mathscr{L}[q] &= V_0(\frac{e^{-st_1}}{s} -\frac{e^{-st_2}}{s}) \\
(RCs + 1)\mathscr{L}[q] &= CV_0(\frac{e^{-st_1}}{s} -\frac{e^{-st_2}}{s}) \\
\mathscr{L}[q] &= CV_0(\frac{e^{-st_1}}{s(RCs + 1)} -\frac{e^{-st_2}}{s(RCs + 1)}) \\
&= CV_0[e^{-st_1}(\frac{1}{s} -\frac{1}{s+\frac{1}{RC}}) -e^{-st_2}(\frac{1}{s} -\frac{1}{s+\frac{1}{RC}})]
\end{align}

Thus the answer is

\begin{align}
q = CV_0[H(t-t_1)(1-e^{-(t-t_1)/RC}) -H(t-t_2)(1-e^{-(t-t_2)/RC})]
\end{align}

For the pulse case, we have

\begin{align}
(Rs + \frac{1}{C})\mathscr{L}[q] &= V_de^{-st_3} \\
\mathscr{L}[q] &= \frac{V_d}{R}\frac{e^{-st_3}}{s + \frac{1}{RC}}
\end{align}

Therefore,

\begin{align}
q = \frac{V_d}{R}H(t-t_3)e^{-(t-t_3)/RC}
\end{align}

Leave a Reply

I’m Benjamin

Welcome to my Mathematical World! Here you can find posts and tutorials related to applied topics like Linear Algebra, Calculus, Differential Equations, and Programming. Feel free to leave comments and suggestions!

Discover more from Benjamin's Maths World

Subscribe now to keep reading and get access to the full archive.

Continue reading