Monthly Archive: October 2015

Laplace Transform – Part 7: Linear Control Systems

In the last post, the process of linearization was covered in some detail.  At the end of the analysis the equation of motion that resulted was

\[ \frac{d}{dt} \delta \bar S_{\bar f} = A \delta \bar S_{\bar f} + \bar \eta \; .\]

Generally, there is no reason to actually carry all that notational machinery around and typically the dynamical variables are often, generically, called $$\bar x$$.

Two main ingredients remain to be introduced.  The first one is the control applied by a man-made actuator that introduces a general force into the equations of motion.  Typically, the control, usually denoted by $$\bar u$$, is not an array of the same size as the state.  The second ingredient, an output, denoted as $$\bar y$$.  The output takes a few words to explain.

Typically, the dynamics of the system are not completely observable.  For example, the motion of a projectile may be measure strictly by a radar gun, revealing the time history of the speed along the line of sight between the bore site of the gun and the projectile.

The combined system containing both the controls and the outputs is given by

\[ \dot{\bar x} (t) = \bar f (\bar x, \bar u, t) \; , \]

for the state evolution, and

\[ \bar y(t) = \bar g(\bar x, \bar u, t) \; .\]

Linearization, allows these equations to be written in state-matrix form as

\[ \dot{\bar x}(t) = \mathbf{A}(t) \bar x(t) + \mathbf{B}(t) \bar u(t) + \bar \eta \]

and

\[ \bar y(t) = \mathbf{C}(t) \bar x(t) + \mathbf{D}(t) \bar u(t) + \bar \rho\; .\]

The dynamical noise $$\bar \eta$$ and the measurement noise $$\bar \rho$$ are usually dropped or combined into the control term $$\bar u$$.

The above equations constitute the equations of modern control theory.  Ogata, when describing these equations makes a distinction that is a bit difficult to reconcile with his emphasis on the Laplace Transform.

Modern control theory is contrasted with conventional control theory in that the former is applicable to multiple-input-multiple-output systems, which may be linear or nonlinear, time invariant or time varying, while the latter is applicable only to linear time-invariant single-input-single-output systems.  Also, modern control theory is essentially a time-domain approach, while conventional control theory is a complex-frequency-domain approach.

– Katsuhiko Ogata, Modern Control Engineering

Most of his points are straightforward: the presence, at least initially, of nonlinear equations; the use of multiple inputs $$\bar u$$ and multiple outputs $$\bar y$$; and the presence of either time-varying or time independent terms.  What is hard to understand is this distinction between modern control theory being essentially a time-domain approach, while the conventional approach uses frequency methods.

The idea of time- and frequency-domain methods standing side-by-side is a fruitful one in quantum mechanics.  Why this distinction is so sharply drawn in the world of the controls engineer will, I suppose, reveal itself, in time.

Laplace Transform – Part 6: Linearization

The previous five columns have dealt with the Laplace Transform in detail, focusing on the basic properties and fundamental theorems.  The applications to differential equations has been covered in passing with the exception of the one column that covered the application to the simple harmonic oscillator.  That column showed the utility of the method but didn’t generalize to arbitrary state space dimensions.  This shortcoming is easily overcome since the generalization is fairly obvious and easy.  More critical is the inherent limitation of the Laplace Transform to linear systems and the ends to which the typical controls engineer goes to transform general problems to linear ones.  It is to this last topic that this current column is devoted.

The basic approach of the controls engineer is to first express the dynamics of the system being modeled in state space form where the equation of motion is given by

\[ \frac{d}{dt} \bar S(t) = \bar f(t,\bar S) \]

where the state  $$\bar S$$ is constructed so that any derivatives in the original model are replaced by auxiliary variables; for example  $$v_x \equiv \dot x$$.  Usually, the state variables are presented in column-array fashion.  The right-hand side  $$\bar f$$ contains the generalized form for the time derivatives of the state variables as governed either by the kinematic definitions (e.g. $$\dot x = v_x$$) or the dynamic relations (e.g.  $$\dot v_x = f_x/m$$, where $$f_x$$ is the x-component of the force) and is, likewise, presented as a column array. Typically, the equations of motion possess a non-linear right-hand side, meaning that at least one component of  $$\bar f$$ is a non-linear function of the state variables.

There are really two distinct but related ideas behind linearization.  The first is the notion that the nonlinear functions in  $$\bar f$$ can be replaced by linear approximations.  The second is the idea of linearizing about a known solution to the equations of motion.

The pendulum serves as the textbook example of what to do in the first case.  As discussed in an earlier post, the equation of motion of the angle  $$\theta$$ makes with respect to the vertical takes the form

\[ \ddot \theta + g \sin \theta = 0 \; .\]

This nonlinear ordinary differential equation is linearized by expanding the sine and keeping only the first order term resulting in the harmonic oscillator approximation

\[ \ddot \theta + g \theta = 0 \; .\]

It is well established that this approximation is adequate only when  $$\theta$$ is small (for example: see Numerical Solutions of the Pendulum).

The second concept of linearization is more subtle and involves looking at how deviations to a nominal solution evolve in time.  To implement this linearization, we imagine that a solution  $$\bar S_{\bar f}(t;\bar S_0)$$ of the original system exists given the initial conditions  $$\bar S_0$$.   We further imagine that deviations from the solution arise either due to differences in the initial conditions or in the right-hand side of the differential equation.

Both of these differences are physically realizable and lead to different contributions to the linearization.  Physically, uncertainty in the initial state arises due to measurement limitations, either inherent ones due to quantum effects, or due to a lack of knowledge based on limits in metrology.  Uncertainties in the right-hand side are due to our limited ability to infer the forces acting in a physical system based solely on the observed motion.

In realistic systems, both differences are present but it is convenient to study the two contributions separately before combining.  The categorization to describe these different ‘mix-and-match’ scenarios is:

  1. State variation – differences in evolution due to uncertainties in the initial conditions
  2. Model variation – differences in evolution due to differences in the right-hand side
  3. Total variation – differences in evolution due to contributions from both sources

The following figure shows the evolution of two states, an estimated initial state  $$\bar S^*_0$$ and a true initial state  $$\bar S_0$$, each under the action of two right-hand sides  $$\bar f$$ (estimated model) and  $$\bar g$$ (true model).  In this figure, $$\delta \bar S$$ is the state variation, $$\partial \bar S$$ is the model variation, $$\Delta \bar S$$ is the total variation.

state space evolution

 

The key assumption is that both the state and model variations lead to small deviations in the evolution.  If this assumption holds, a linearized equation of motion for the state and total variations can be derived.  Since the true state and model are not none for physical systems (as opposed to mathematical models) it is most useful to ultimately express all the deviations in terms of the state deviation under the estimated model, since this is the one most easily probed.  The linearization is relatively easy and will be done for state and model variations first and then will be combined for the total variation.

State Variation

Start with the basic relation $$\delta \bar S = \bar S – \bar S^*$$.  To calculate the differential equation for the state variation apply the time derivative to both sides

\[ \frac{d}{dt} \delta \bar S = \frac{d}{dt} \left[ \bar S – \bar S^* \right] \]

and use the original equation of motion to eliminate the derivatives of the state in favor of the right-hand sides of the differential equation.

\[ \frac{d}{dt} \delta \bar S = \bar f(\bar S) – \bar f (\bar S^*) \]

Since the model is the same in both cases, it really doesn’t matter which model is used but using $$\bar f$$ will be convenient later.  Finally, express the true state in terms of the estimate state and the state deviation

\[ \frac{d}{dt} \delta \bar S = \bar f(\bar S^* + \delta \bar S) – \bar f(\bar S^*) \]

and expand

\[ \frac{d}{dt} \delta \bar S = \left. \frac{\partial \bar f}{\partial \bar S} \right|_{\bar S^*} \delta \bar S \; .\]

Note that the matrix $$A \equiv \left. \frac{\partial \bar f}{\partial \bar S} \right|_{\bar S^*}$$ is evaluated along the estimated trajectory (although in this case either will suffice) and is, in general, time-varying because of it.

Model Variation

The equation of motion for the model variation is the most analytically intractable of the variations and does not lead directly to a linear equation.  To evaluate it, take the time derivative of the definition of the model variation

\[ \frac{d}{dt} \partial \bar S = \frac{d}{dt} \left[ \bar S_{\bar g} – \bar S_{\bar f} \right] \; . \]

Replace the derivatives on the right gives

\[ \frac{d}{dt} \partial \bar S = \bar g (\bar S) – \bar f(\bar S) \equiv \bar \eta_0(\bar S) \; .\]

This is as far as one can go with the general structure.  But it is usually argued that if the actual forces are not producing a discernable signal (for if they were, they could be inferred from the motion) then $$\bar \eta_0$$ can be thought of as an inhomogeneous noise term.  We will make such an argument and assume this property.

Total Variation

From the figure there are two equally valid definitions of the total variation in terms of true state

\[ \Delta \bar S = \delta \bar S_{\bar f} + \partial \bar S \]

and in terms of the estimated state

\[ \Delta \bar S = \delta \bar S_{\bar g} + \partial \bar S^* \; . \]

Equating, rearranging, and taking the time derivative yields

\[ \frac{d}{dt} \delta \bar S_{\bar g} = A \delta \bar S_{\bar f} – \bar \eta^*_0 – \bar \eta_0 \; \]

One last approximation is needed.  Much like the argument above, it is based on a plausibility and not on a rigorous linearization.  This argument says that if the differences between the two force models are small enough to regard the model variations to be noise-like, then for all practical considerations the state variations are approximately the same.

Thus the final equation is

\[ \frac{d}{dt} \delta \bar S_{\bar f} = A \delta \bar S_{\bar f} + \bar \eta \; \]

where $$\bar \eta$$ is a collected noise term (with an appropriate and insignificant sign change).  It should be emphasized that this final equation is not rigorous correct but has been used by control engineers successful and so is worth studying.

Laplace Transforms – Part 5: The Simple Harmonic Oscillator

In this post, the focus shifts from looking at the basic properties of the Laplace Transform to the application of it to dynamical systems of the form

\[ \frac{d}{dt} \bar S = A \bar S \; ,\]

where the matrix $$A$$ can be time-varying but does not depend on the state $$\bar S$$.

To be sure, some differential equations were already touched upon in passing in earlier posts, but this was done more as a way to motivate the possible transforms that would result and which would require a subsequent inverse rather than being examined in their own right.

As a prototype for multi-variable dynamical systems and a prelude to the general theory, this column will look at the application of the Laplace Transform in the simplest multi-variable structure – the simple harmonic oscillator (SHO). This tried and true system should always be the first one explored based on one simple fact – if the theory is not understandable or workable for this fundamental system then it won’t be understandable or workable for any other application.

The familiar state for the SHO is given by:

\[ \bar S = \left[ \begin{array}{c} x(t) \\ v(t) \end{array} \right] \; \]

and its corresponding equation of motion

\[ \frac{d}{dt} \left[ \begin{array}{c} x \\ v \end{array} \right] = \left[ \begin{array}{cc} 0 & 1 \\ -\omega_0^2 & 0 \end{array} \right] \left[ \begin{array}{c} x \\ v \end{array} \right] \; ,\]

where the matrix $$A$$ is given by

\[ A = \left[ \begin{array}{cc} 0 & 1 \\ -\omega_0^2 & 0 \end{array} \right] \; .\]

Taking the Laplace Transform of the oscillator’s equation of motion (using the properties established in earlier posts) yields

\[ \left[ \begin{array}{c} s X(s) – x_0 \\ s V(s) – v_0 \end{array} \right] = \left[ \begin{array}{cc} 0 & 1 \\ -\omega_0^2 & 0 \end{array} \right] \left[ \begin{array}{c} X(s) \\ V(s) \end{array} \right] \; .\]

Note that, as expected, the differential equation now becomes a (linear) algebraic equation.

Some basic re-arrangement leads to the following matrix equation

\[ (s Id – A) \left[ \begin{array}{c} X(s) \\ V(s) \end{array} \right] = \left[ \begin{array}{c} x_0 \\ v_0 \end{array} \right] \; ,\]

where $$Id$$ is the $$2×2$$ identity matrix.

The solution to this equation is obtained by finding the inverse of the matrix $$s Id – A$$.

\[ \left[ \begin{array}{c} X(s) \\ V(s) \end{array} \right] = (s Id – A)^{-1} \left[ \begin{array}{c} x_0 \\ v_0 \end{array} \right] \; .\]

It is convenient to define

\[ M = s Id – A = \left[ \begin{array}{cc} s & -1 \\ \omega_0^2 & s \end{array} \right] \; .\]

The inverse then follows from the usual formula for a $$2×2$$ matrix

\[ M^{-1} = \frac{1}{s^2 + \omega_0^2} \left[ \begin{array}{cc} s & 1 \\ -\omega_0^2 & s \end{array} \right] \; ,\]

where the pre-factor is $$1/det(M)$$.

Multiply the right-hand side out leads to the following expressions for $$X(s)$$

\[ X(s) = \frac{s x_0}{s^2 + \omega_0^2} + \frac{v_0}{s^2 + \omega_0^2} \; \]

and $$V(s)$$

\[ V(s) = -\frac{x_0 \omega_0^2 }{s^2 + \omega_0^2} + \frac{s v_0}{s^2 + \omega_0^2} \; .\]

The last piece is to take the inverse Laplace Transform of the individual components to get

\[ x(t) = x_0 \cos(\omega_0 t) + \frac{v_0}{\omega_0} \sin(\omega t) \; \]

and

\[ v(t) = -x_0 \omega_0 \sin(\omega_0 t) + v_0 \cos(\omega t) \; ,\]

which, happily, are the expected results.

Next week, I’ll begin my examination of the general theory use in controls engineering.