Electrical – Solving the differential equation in control system engineering

controlcontrol systemdifferential

While I am continuing my studies of the Norman S. Nise book about Control System Engineering, and while trying to solve exercises of chapter 1, I noticed that I am out of the scope of solving differential equation. I forgot how to solve a differential equation and what the characteristic equation and how to obtain the variables values from initial conditions.

In one of the exercises, the author asked to solve the following equation:

(dx/dt) + 7x = 5cos2t

The solution started with:

(7C + 2D)cos(2t) + (-2C + 7D)sin(2t) = 5cos(2t)

Then:

7C + 2D = 5

-2C + 7D = 0

Which give: C=35/33 ; D=10/53

He gives the following characteristic equation: M + 7 = 0

And the final solution was:

enter image description here

My questions are:

  1. How the author solve the differential equation ? I didn't get his technique nor his method of solving.

  2. IS the following link is good enough to refresh my mind on how to solve differential equation ?

  3. Does control system engineers still solve differential equation by hand like this, or Matlab is always used to win some time ?

Best Answer

  1. How the author solve the differential equation ? I didn't get his technique nor his method of solving.

Typically, you construct a solution from a homogeneous solution and a particular solution.

  1. Homogeneous solution

This is the solution to the problem without excitation, in other words:

$$\frac{dx}{dt} + 7x = 0$$

One way of solving this is by solving the characteristic equation by replacing a derivative with \$\lambda\$, second derivative by \$\lambda^2\$, etc. In this case:

$$\lambda + 7 = 0 \Rightarrow \lambda = -7$$

The homogeneous solution is then:

$$\begin{align} x_h(t) &= \sum_{\lambda_i} A_i e^{\lambda_it} \\ &= A e^{-7t} \end{align}$$

  1. Particular solution

This is the solution to the problem with the excitation, ie.

$$\frac{dx}{dt} + 7x = 5\cos(2t)$$

For particular solutions, we just choose a similar expression to the excitation in a smart way. In this case, the excitation is a cosine, so any derivative will be either a sine or a cosine as well with the same frequency. In other words, the particular solution will look as follows:

$$x_p(t) = B + C\cos(2t) + D\sin(2t)$$

Plugging this test in the equation yields

$$\begin{align} \frac{d(x_p(t))}{dt} + 7x_p(t) &= 5\cos(2t) \\ &\Downarrow \\ \left(-2C\sin(2t) + 2D\cos(2t)\right) + 7\left(B + C\cos(2t) + D\sin(2t)\right) &= 5\cos(2t) \\ &\Downarrow \\ (7C + 2D)\cos(2t) + (-2C + 7D)\sin(2t) + 7B &= 5\cos(2t) \end{align}$$

In order for this equation to match for all \$t\$, we need that

$$\begin{align} 7C + 2D &= 5 \\ -2C + 7D &= 0 \\ B &= 0 \end{align}$$

  1. Final solution

The final solution is the sum of the homogeneous and particular solutions, and so

$$x(t) = Ae^{-7t} + C\cos(2t) + D\sin(2t)$$

You can think of it as the sum of all solutions that result in \$0\$ and one particular solution that will result in the excitation signal. It's like saying \$1 = 0 + 1\$ with the right hand side the homogeneous and particular solution.

At this point in time, we still don't have a value for \$A\$. This is found by enforcing a certain initial condition. For example, forcing \$x(0) = 0\$ will yield that

$$x(0) = A + C = 0 \Rightarrow A = -C$$

As is the case in your example.

  1. Is the following link is good enough to refresh my mind on how to solve differential equation ?

I am not planning on watching this series of video's so I will reserve my answer for this.

  1. Does control system engineers still solve differential equation by hand like this, or Matlab is always used to win some time ?

While this method does work, I don't think many engineers will still solve differential equations. In control theory, you usually reason with poles and zero's, and how the system behaves if they are moving, are added or removed. A simulator such as Matlab's Simulink can then be used to verify your reasoning and tune the positions of these poles and zero's.

Actually solving differential equations by hand only works for relatively simple (they often aren't) and linear (they often aren't) systems. I believe you will find these types of problems more often in an educational context rather than in practice.

Nevertheless, it is in my personal opinion a good idea to keep these things in the back of your head. There may always be cases where a simple and linear approximation of the problem at hand would be enough.

On a side note, my preferred way of solving this type of problems is by using the Laplace transform. As such:

$$\begin{align} \mathcal{L}\left\{\frac{dx}{dt} + 7x\right\} &= \mathcal{L}\left\{5\cos(2t)\right\} \\ &\Downarrow \\ sX(s) - x(0) + 7X(s) &= \frac{5s}{s^2 + 4} \\ &\Downarrow \\ X(s) &= \frac{1}{s + 7}\frac{5s}{s^2 + 4} \end{align}$$

Then you split in partial fractions (I won't calculate the coefficients for keeping this answer shorter)

$$\begin{align} X(s) &= \frac{A}{s + 7} + \frac{Bs}{s^2 + 4} + \frac{2C}{s^2 + 4} \\ &\Downarrow \\ x(t) &= \mathcal{L}^{-1}\left\{X(s)\right\} \\ &= Ae^{-7t} + B\cos(2t) + C\sin(2t) \end{align}$$

They should both give the same result. I prefer this method because it doesn't require me to split the solution into a homogeneous and particular one. The downside is that you need to remember your Laplace transforms. It also helps greatly if you know some tricks for splitting in partial fractions.