Here we consider specifically solving Nth order LCCODEs with
,
, and
.
Solving first-order LCCODE:
![$\displaystyle y'(t)+ay(t)=x(t)$](img91.svg) |
(37) |
with an initial condition
.
We first find the homogeneous solution, denoted by
,
that satisfies
due to the non-zero initial
condition
, and then find the particular solution,
denoted by
, that satisfies
. Due
to the linearity of the equation, the sum
of
the homogeneous and a particular solution is also a solution, called
the complete solution.
To find the homogeneous solution, we assume
, and
substitute it into the ODE to get
![$\displaystyle y'(t)+a\,y(t)=sc\,e^{st}+ac\,e^{st}=0$](img99.svg) |
(38) |
Dividing both sides by
, we get
, i.e,
. The coefficient
is determined by the
initial condition. Evaluating
at
we get
![$\displaystyle y_h(t)\bigg\vert _{t=0}=c\,e^{-at}\bigg\vert _{t=0}=c=y_0$](img103.svg) |
(39) |
and the homogeneous solution is
![$\displaystyle y_h(t)=e^{-at} y_0$](img104.svg) |
(40) |
To find the complete solution of the nonhomogeneous ODE with
, we first multiply both sides of the ODE by
:
![$\displaystyle e^{at} \left[ y'(t)+a\,y(t) \right]
=e^{at} y'(t)+a e^{at}y(t)=e^{at} x(t)$](img107.svg) |
(41) |
and rewrite it as
![$\displaystyle \frac{d}{dt} \left[ e^{at}y(t) \right]=e^{at}x(t)$](img108.svg) |
(42) |
and then integrate both sides to get
![$\displaystyle \int_0^t \left[\frac{d}{dt} \left( e^{a\tau}y(\tau) \right) \righ...
...e^{a\tau}y(\tau)\bigg\vert _0^t=e^{at}y(t)-y(0)=\int_0^t e^{a\tau}x(\tau) d\tau$](img109.svg) |
(43) |
Multiplying both sides by
and rearranging, we get the
expression for
![$\displaystyle y(t)=e^{-at}\left[ y(0)+\int_0^t e^{a\tau}x(\tau) d\tau \right]
=e^{-at}y_0+\int_0^t e^{-a(t-\tau)}x(\tau) d\tau
=y_h(t)+y_p(t)$](img111.svg) |
(44) |
where
is the homogeneous solution same as
that found above, and
is the particular solution:
![$\displaystyle y_p(t)=\int_0^t e^{-a(t-\tau)}x(\tau) d\tau=e^{-at}\;*\;x(t)$](img113.svg) |
(45) |
In particular, if the input
is a unit impulse
(Derac dilta function), we get the impulse response
. We therefore see that in general, the
particular solution is the convolution of the impulse response
and the input
.
Alternatively, we can also solve the first order LCCODE by the
method of Laplace transform. Specifically, we take Laplace
transform on both sides of the equation to get
![$\displaystyle {\cal L}\left[ \;y'(t)+ay(t)\;\right]
=sY(s)-y(0)={\cal L}\left[ \;x(t)\;\right]=X(s)$](img116.svg) |
(46) |
Solving for
we get the solution in s-domain:
![$\displaystyle Y(s)=\frac{y_0}{s+a}+\frac{X(s)}{s+a}$](img117.svg) |
(47) |
Taking inverse transform we get the solution in time domain:
![$\displaystyle y(t)={\cal L}^{-1} \left[\frac{y_0}{s+a}\right]
+{\cal L}^{-1}\left[ \frac{X(s)}{s+a}\right]
=y_0e^{-at}+x(t)\;*\;e^{-at}$](img118.svg) |
(48) |
where
is the homogeneous solution, and
as the convolution of the input
and the impulse response
of the system is
the particular solution.
- Constant input:
Taking the unilateral Laplace transform of the equation
we get
![$\displaystyle {\cal L}\left[y'(t)+a y(t)\right]=sY(s)-y_0+aY(s)
={\cal L}\left[u(t)\right]=\frac{1}{s}$](img122.svg) |
(49) |
Solving for
, we further get
![$\displaystyle Y(s)=\frac{1}{s+a}\left(\frac{1}{s}+y_0\right)
=\frac{y_0}{s+a}+\frac{1}{s(s+a)}
=\frac{y_0}{s+a}+\frac{1}{a}\left(\frac{1}{s}-\frac{1}{s+a}\right)$](img123.svg) |
(50) |
Taking the inverse Laplace trannsform we get the solution in
time domain:
![$\displaystyle y(t)={\cal L}^{-1}Y(s)=1-e^{-at}+y_0e^{-t/\tau}=1+(y_0-1)e^{-t/\tau}$](img124.svg) |
(51) |
- Sinusoidal input:
To solve the ODE with a sinusoidal input
, we first consider a
complex exponontial input
![$\displaystyle y'(t)+v_c(t)=x(t)=e^{j\omega t}$](img126.svg) |
(52) |
Taking the Laplace transform on both sides we get
![$\displaystyle {\cal L}\left[y'(t)+a y(t)\right]=s Y(s)-y_0+a Y(s)
={\cal L}\left[e^{j\omega t}u(t)\right]=\frac{1}{s-j\omega}$](img127.svg) |
(53) |
Solving for
, we get
![$\displaystyle Y(s)=\frac{1}{s+a}\left(\frac{1}{s-j\omega}+y_0\right)
=\frac{1}{j\omega+a}\left(\frac{1}{s-j\omega}-\frac{1}{s+a}\right)
+\frac{y_0}{s+a}$](img128.svg) |
(54) |
Taking the inverse Laplace trannsform we get the solution
in time domain:
where
. Taking the real part we get the
solution:
Solving second order LCCODE:
![$\displaystyle y''(t)+2\zeta\omega_n y'(t)+\omega_n^2 y(t)=x(t)$](img134.svg) |
(55) |
We first find the homogeneous solution by assuming
. We
assume
and substitute it with its derivatives
into the DE and get
![$\displaystyle (s^2+2\zeta\omega_n s+\omega_n^2)e^{st}=0$](img137.svg) |
(56) |
Dividing both sides by
, we get an algebraic equation
![$\displaystyle s^2+2\zeta\omega_n s+\omega_n^2=0$](img139.svg) |
(57) |
solving which we get its two roots:
![$\displaystyle s_{1,2}=\left\{\begin{array}{ll}
\left(-\zeta\pm\sqrt{\zeta^2-1}\...
...^2}\right)\omega_n=\omega_n e^{\mp j\phi}
&\vert\zeta\vert< 1\end{array}\right.$](img140.svg) |
(58) |
where
![$\displaystyle \phi=\tan^{-1}\left(\frac{\sqrt{1-\zeta^2}}{\zeta}\right)
=\cos^{-1}\zeta$](img141.svg) |
(59) |
and
![$\displaystyle \zeta+j\sqrt{1-\zeta^2}=e^{j\phi},\;\;\;\;\;\zeta-j\sqrt{1-\zeta^2}=e^{-j\phi}$](img142.svg) |
(60) |
Note that
![$\displaystyle s_1s_2=\omega_n^2,\;\;\;\;\;\;\;\;s_1+s_2=-2\zeta\omega_n,
\;\;\;\;\;\;\;
s_2-s_1=-2\omega_n\sqrt{\zeta^2-1}=-2j\omega_n\sqrt{1-\zeta^2}$](img143.svg) |
(61) |
where
is the damped natural frequency defined as:
![$\displaystyle \omega_d=\omega_n\sqrt{1-\zeta^2}$](img145.svg) |
(62) |
and
![$\displaystyle s^2+2\zeta\omega_n s+\omega_n^2=(s-s_1)(s-s_2)=s^2-(s_1+s_2)s+s_1s_2$](img146.svg) |
(63) |
These two roots
are either two real numbers or a pair
complex conjugate numbers, depending on whether its discriminant
is greater and smaller then 0:
![$\displaystyle \Delta=(2\zeta\omega_n)^2-4\omega_n^2=4\omega_n^2(\zeta^2-1)
\lef...
...y}{ll}\ge 0 & \vert\zeta\vert\ge 1\\ < 0 & \vert\zeta\vert< 1\end{array}\right.$](img148.svg) |
(64) |
As
for all physical systems,
for all cases.
For a constant
and a variable
that changes
from
to
, the two roots
(red) and
(blue) can be represented as the root locus on the complex plane.
Given the two roots
and
, we get the homogeneous
solution as the linear combination of the two solutions
and
:
![$\displaystyle y_h(t)=C_1 e^{s_1t}+C_2 e^{s_2t}$](img159.svg) |
(65) |
where the two coefficients
and
can be found based on
the two initial conditions
and
:
Solving these we get
![$\displaystyle C_1=\frac{s_2y_0-y'_0}{s_2-s_1},
\;\;\;\;\;\;\;\;
C_2=\frac{s_1y_0-y'_0}{s_1-s_2} y_0$](img168.svg) |
(66) |
and the homogeneous solution becomes:
![$\displaystyle y_h(t)=y_0 \left[ \frac{s_2 e^{s_1t}}{s_2-s_1}-\frac{s_1 e^{s_2t}}{s_2-s_1} \right]
=\frac{y_0}{s_2-s_1} (s_2 e^{s_1t}-s_1 e^{s_2t})$](img169.svg) |
(67) |
The solution takes different forms depending on the value of the damping
coefficient
.
- Over-damped system (
)
This is a sum of two exponentially decaying terms, without any overshoot
or oscillation. Note that when
,
.
- Critically damped system (
)
Now we have
![$\displaystyle s_1=s_2=-\omega_n=s$](img176.svg) |
(68) |
and the homogeneous solution takes following form:
Applying the initial conditions to this response we get
Solving this we get
![$\displaystyle C_1=y_0, \;\;\;\;\;\;\;C_2=y_0$](img182.svg) |
(69) |
and the response is
![$\displaystyle y_h(t)=C_1 e^{st}+C_2 t e^{st}=y_0\left[ e^{-\omega_nt}+\omega_n t e^{-\omega_nt}\right]$](img183.svg) |
(70) |
Again, there is no overshoot or oscillation.
- Under-damped system (
)
and![$\displaystyle \;\;\;\;
s_1-s_2=2j\omega_d$](img186.svg) |
(71) |
The response is
- Undamped system (
)
![$\displaystyle s_1=j\omega_n,\;\;\;\;\;\;s_2=-j\omega_n$](img191.svg) |
(72) |
![$\displaystyle y_h(t)=y_0 \left[ \frac{s_2 e^{s_1t}}{s_2-s_1}+\frac{s_1 e^{s_2t}...
...ght]
=y_0\left(\frac{e^{j\omega_n}+e^{-j\omega_n}}{2}\right)=y_0\cos(\omega_nt)$](img192.svg) |
(73) |
This result can also be obtained from the previous case:
![$\displaystyle \lim_{\zeta\leftarrow 0} \left(y_0\frac{e^{-\zeta\omega_nt}}{\sqr...
...in(\omega_dt+\phi) \right)
=y_0\sin(\omega_nt+\frac{\pi}{2})=y_0\cos(\omega_nt)$](img193.svg) |
(74) |
The homogeneous responses of these four cases are plotted below. Note that in all cases,
and
.
We next consider the complete solution of the equation
![$\displaystyle y''(t)+2\zeta\omega_n y'(t)+\omega_n^2 y(t)=x(t)$](img134.svg) |
(75) |
with a unit step
input and zero initial conditions
. As the input is a constant for
, we can
assume the solution is a constant
with zero derivatives
. Substituting these into the equation, we get
the particular solution (also called the steady state solution:
![$\displaystyle y_p(t)=\frac{1}{\omega_n^2}$](img200.svg) |
(76) |
The complete response can now be obtained as the sum of the
homogeneous solution (same as that obtained previously) due
to the non-zero initial condition and the particular solution
due to the non-zero input:
![$\displaystyle y(t)=y_h(t)+y_p(t)=C_1 e^{s_1t}+C_2 e^{s_2t}+\frac{1}{\omega_n^2}$](img201.svg) |
(77) |
The two coefficients
and
can be obtained based on
the two initial conditions, here assumed to be zero:
Solving these equations we get:
![$\displaystyle C_1=\frac{s_2}{\omega_n^2(s_1-s_2)}=\frac{-s_2}{\omega_n^2(s_2-s_1)},
\;\;\;\;\;\;C_2=\frac{s_1}{\omega_n^2(s_2-s_1)}$](img204.svg) |
(78) |
Now the complete solution becomes:
![$\displaystyle y(t)=\frac{1}{\omega_n^2}\left[1-\left(\frac{s_2e^{s_1t}}{s_2-s_1...
...ht]
=\frac{1}{\omega_n^2}\left[1-\frac{s_2e^{s_1t}-s_1e^{s_1t}}{s_2-s_1}\right]$](img205.svg) |
(79) |
The two roots
and
take different forms depending on
whether the discriminant
is greater
or smaller than 0, i.e., whether
is greater or smaller then 1.
Here we only consider the case when
, i.e.,
,
for an under-damped second order system. The two roots are
and![$\displaystyle \;\;\;\;s_2-s_1=-2j\omega_d$](img210.svg) |
(80) |
where
is the damped natural frequency:
![$\displaystyle \omega_d=\omega_n\sqrt{1-\zeta^2}$](img145.svg) |
(81) |
Finally the complete solution of the non-homogeneous DE is:
where
same as that given
above. In particular, if
, we have
![$\displaystyle y(t)=\frac{1}{\omega_n^2}\left[1-\sin(\omega_n t+\pi/2)\right]
=\frac{1}{\omega_n^2}\left[1-\cos(\omega_n t)\right]$](img217.svg) |
(82) |
The plots below shows an example with
. Note
the critical damped case when
. An overshoot will occur
for any
.
The step response is plotted below. Note that
and
.
Alternatively, we can also solve the second order LCCODE by the
method of Laplace transform. Specifically, we take Laplace
transform on both sides of the equation to get
![$\displaystyle {\cal L}\left(y''+2\zeta\omega_ny'+\omega_n^2y\right)
=s^2Y(s)-sy(0)-y'(0)+2\zeta\omega_nY(s)-2\zeta\omega_ny(0)+\omega_n^2Y(s)
=X(s)$](img221.svg) |
(83) |
Dividing both sides by
and rearranging, we get
![$\displaystyle Y(s)=\frac{X(s)}{(s-s_1)(s-s_2)}+\frac{(s+2\zeta\omega_n)y(0)}{(s-s_1)(s-s_2)}
+\frac{y'(0)}{(s-s_1)(s-s_2)}$](img223.svg) |
(84) |
- Homogeneous case:
If we assume
and
, then the above becomes
![$\displaystyle Y(s)=\frac{(s+2\zeta\omega_n)y_0}{(s-s_1)(s-s_2)}
=\frac{C_1}{s-s_1}+\frac{C_2}{s-s_2}
=\frac{C_1(s-s_2)+C_2(s-s_1)}{(s-s_1)(s-s_2)}$](img225.svg) |
(85) |
i.e.,
![$\displaystyle C_1+C_2=y_0,\;\;\;\;\;\;s_2C_1+s_1C_2=-2\zeta\omega_n y_0=(s_1+s_2)y_0$](img226.svg) |
(86) |
Solving for
and
we get
![$\displaystyle C_1=\frac{s_2}{s_2-s_1}y_0,\;\;\;\;C_2=\frac{-s_1}{s_2-s_1}y_0$](img229.svg) |
(87) |
and
![$\displaystyle y(t)={\cal L}^{-1}Y(s)={\cal L}\left(\frac{C_1}{s-s_1}+\frac{C_2}...
..._1e^{s_1t}+C_2e^{s_2t}
=\frac{y_0}{s_2-s_1}\left(s_2e^{s_1t}-s_1e^{s_2t}\right)$](img230.svg) |
(88) |
- Impulse response:
If we assume
with
and zero initial condition
, then the transfer function
is
![$\displaystyle H(s)=Y(s)=\frac{1}{(s-s_1)(s-s_2)}
=\frac{1}{s_2-s_1}\left( \frac{1}{s-s_2}-\frac{1}{s-s_1}\right)$](img232.svg) |
(89) |
and the impulse response function is
![$\displaystyle h(t)={\cal L}^{-1}[H(s)]=\frac{1}{s_2-s_1}
{\cal L}^{-1}\left( \f...
...-s_2}-\frac{1}{s-s_1}\right)
=\frac{1}{s_2-s_1}\left( e^{s_2t}-e^{s_1t} \right)$](img233.svg) |
(90) |
Alternatively, we can also find
as
Substituting in
, we further get
- Nonhomogeneous case:
If we assume
with
and zero initial condition
, then we have
i.e.,
![$\displaystyle (C_1+C_2+C_3)s^2=0,\;\;\;\;\;\;(s_1+s_2)C_1+s_2C_2+s_1C_3=0,\;\;\;\;\;\;
s_1s_2 C_1=1$](img244.svg) |
(94) |
Solving for
,
and
we get
![$\displaystyle C_1=\frac{1}{s_1s_2}=\frac{1}{\omega_n^2},\;\;\;\;\;
C_2=\frac{1}...
...n^2}\frac{-s_2}{s_2-s_1},\;\;\;\;\;
C_3=\frac{1}{\omega_n^2}\frac{s_1}{s_2-s_1}$](img246.svg) |
(95) |
and
![$\displaystyle y(t)={\cal L}^{-1}\left( \frac{C_1}{s}+\frac{C_2}{s-s_1}+\frac{C_...
...t}
=\frac{1}{\omega_n^2}\left( 1-\frac{s_2e^{s_1t}-s_1e^{s_2t}}{s_2-s_1}\right)$](img247.svg) |
(96) |
As shown above, when
, we have
![$\displaystyle y(t)=\frac{1}{\omega_n^2}\left[1-\frac{e^{-\zeta\omega_nt}}{\sqrt{1-\zeta^2}}
\sin(\omega_dt+\phi) \right]$](img248.svg) |
(97) |
Alternatively, the same step response can also be found as the convolution
of the impulse response
and the input
:
where we have used the facts that
and
, and the integral
![$\displaystyle \int e^{at}\sin(bt)\;dt=\frac{e^{at}}{a^2+b^2}\left[ a\sin(bt)-b\cos(bt)\right]$](img256.svg) |
(99) |
Solving third order LCCODE:
![$\displaystyle y'''(t)+a_2 y''(t)+a_1 y'(t) + a_0y(t)=x(t)$](img257.svg) |
(100) |
with initial conditions
.
Here we only consider the Homogeneous case.
Let
be the three roots of the characteristic
equation so that
i.e,
,
and
.
We let
, and find the
coefficients
by solving the equation
![$\displaystyle {\bf Sc}=\left[\begin{array}{ccc}1 & 1 & 1\\ s_1 & s_2 & s_3\\
s...
...ray}\right]
=\left[\begin{array}{c}y_0\\ y'_0\\ y''_0\end{array}\right]={\bf y}$](img267.svg) |
(102) |
to get
, where
![$\displaystyle {\bf S}^{-1}=\left[\begin{array}{ccc}
1 & 1 & 1\\ s_1 & s_2 & s_3...
... s_1s_3 & -(s_1+s_3) & 1\\ s_1s_2 & -(s_1+s_2) & 1
\end{array}\right]
={\bf DR}$](img269.svg) |
(103) |
Alternatively, we can use the method of Laplace transform to get
Equating the coefficients for
and constant terms of the
numerators, we get
![$\displaystyle \left[\begin{array}{ccc}
s_2s_3 & s_1s_3 & s_1s_2\\ -(s_2+s_3) & ...
...
\end{array}\right]
\left[\begin{array}{c} y_0\\ y'_0\\ y''_0\end{array}\right]$](img274.svg) |
(105) |
which can be written as
i.e.,![$\displaystyle \;\;\;\;\;
{\bf c}=({\bf R}^T)^{-1}{\bf Ay}$](img276.svg) |
(106) |
But we also note the following identity:
![$\displaystyle {\bf AS}=\left[\begin{array}{ccc} a_1 & a_2 & 1\\ a_2 & 1 & 0\\ 1...
...s_1s_2\\
-(s_2+s_3)&-(s_1+s_3)&-(s_1+s_2)\\ 1&1&1\end{array}\right]
={\bf R}^T$](img277.svg) |
(107) |
i.e.,
. Substituting this
into the expression for
we get the same coefficients
found previously:
![$\displaystyle {\bf c}=({\bf R}^T)^{-1}{\bf Ay}={\bf S}^{-1}{\bf A}^{-1}{\bf Ay}={\bf S}^{-1}{\bf y}$](img280.svg) |
(108) |