For more information, type help symbolic in Matlab. A tutorial demonstration is
the command symintro.
The following notes represent a short introduction to the symbolic processing
capabilities of Matlab.
13.1 Symbolic Expressions and Algebr
a0 + kpb0
and approaches 0 for large kp.
Thus we expect a faster but more oscillatory response as we increase kp. This is
illustrated in Figs 55 and 56 where we show the open and closed-loop responses
s2 + 5s + 4
with the proportional c
The aim of the controller is to determine the manipulated variable u(t) so that
the plant output yp(t) tracks the reference signal r(t) as closely as possible. The
controller takes a very specific structure
u = C(e)
e = P(r) ym
2.3 Standard control loop w
Bode plots depict the frequency response graphically. The first subplot
shows gain (in dB) against frequency (log scale). The second
sub-plot shows phase (linear scale) against frequency (log scale).
We have built a catalogue of first and second order r
Thus, H(s) can be expressed in the form
H(s) = s + 2
s3 + 4s2 + 3s
As a second example, consider
G(s) = s+4+
Manipulating with Matlab:
> syms s
> G = s+4 + 2/(s+4) + 3/(s+2);
> [N,D] = numden(G)
Gigerenzer: Gut Feelings, Allen Lane, 2007.
1 INTRODUCTION 7
of water falling onto a mill wheel. Until very recently the same principle was
used for the control of Diesel engines.
Figure 1: Watts governor.
The invention of the feed
Figure 31: Step responses for second order transfer functions with real poles
If p1 and p2 are similar, the response is significantly different from any
first order response.
5.3.2 The poles are identical and real
dtn1 (t) + + a1
(t) + a0y(t)
dtm (t) + bm1
dtm1 (t) + + b1
(t) + b0u(t) (2)
We say y = G(u) if, given an input signal u, the output signal y satisfies (2).
Linearity says that if, given u1 and u2, we have
y1 = G(u1)
16 HH:MM PM 3:45 PM
17 QQ-YY Q1-96
18 QQ Q1
> ds = datestr(d)
The function datenum is used to compute a date number. It has three forms:
datenum(s): Returns the date number correspondin
= s2X(s) sx(0)
(t) = u(t) and y(0) = 0
It follows that
Y (s) =
y(t) = u(t _)
Y (s) = L[u(t _)]
> syms s
> H = s^2 +6*s + 8;
> G = -H/3
The result is G = (1/3)s2 2s 8/3, while we would prefer G = (s2 + 6s + 8)/3.
13.2Manipulating Trigonometric Expressions
Trigonometric expressions can also be manipulated symbolically in Matla
s2 + a1s + a0
s2 + (a1 + kpTdb0)s + (a0 + kpb0)
The derivative action gives us an extra degree of freedom, that allows us
to choose the closed-loop natural frequency !n and the closed-loop damping _
independently. Specifically we can choose
distance traveled: 144.6364 ft
blanks(n) Returns a string of n blanks. Used with disp, eg. disp
([xxx blanks(20) yyy]). disp(blanks(n) moves
the cursor down n lines.
deblank(s) Removes trailing blanks from string s.
eval(s) Execute th
over an interval a x b. A local maximum or local minimum (one that does not
occur at one
of the boundaries x = a or x = b) can occur only at a critical point, which is a point
df/dx = 0 or df/dx does not exist.
Example 13.2 Minimum cost tank
state space models,
1 INTRODUCTION 10
modern robust control.
Similarly we will pay little attention to the important topics of system identification
tuning rules suggest PID gains kp = 4.8, Ti = 1.1 and Td = 0.56. Fig 65 shows
the outputs and inputs of the plant with a PID controller subject to an output
disturbance at t = 20, an output disturbance at t = 40 and a set point change at
t = 60. The dashe
Since the Matlab diff function returns only an approximate derivative, it is necessary
to use the
resolution required to achieve the accuracy desired.
Differentiation Error Sensitivity
Differentiation is sensitive to minor changes in the shape of a functi
Figure 13.1: Plot of a polynomial function using ezplot
13.4 Solving Algebraic and Transcendental Equations
The symbolic math toolbox can be used to solve algebraic and transcendental
equations, as well as
systems of such eq
It follows from the Laplace transform of an exponential that
s + j!
s2 + !2
s2 + !2
4 LAPLACE TRANSFORMS AND TRANSFER FUNCTIONS 26
4.2.4 Dirac delta function
The Dirac delta function _(t) is
monitored via a SCADA (supervisory control and data acquisition).
Soap and water phase
Figure 5: Schema
Figure 38 shows the rise time against damping ratio for a second order
system with no zero when the natural frequency !n = 1. Two commonly
5 STEP RESPONSES 46
used approximations are also shown:
2.16_ + 0.6
Settling time. The settling ti
a non-negative integer smaller than 252 and b must be an integer
between 2and 36.
dec2base(d,b,N) Produces a representation with at least N digits.
> a = dec2bin(18) % find binary representation of 18
> bin2dec(a) % convert a back to de
(or model with) G(s).
bmsm + bm1sm1 + b0
sn + an1sn1 + + a0
The order of G is n. The relative degree of G is n m. A transfer function is
said to be proper if n m and improper if n < m. We do not allow improper
The second derivative of a function f(x)is the derivative of the first derivative of the
_(xk) = df _(x)
This function can be approximated using slopes of the first derivative. Using
and assuming uniform spacing x
1 + G(s)C(s)
Yp(s) = T (s)P(s)R(s) T (s)N(s) + G(s)S(s)Di(s) + S(s)Do(s)
As before we have the relations
T (s) = G(s)C(s)S(s)
S(s) + T (s) = 1
and C(s) =
with n(s), d(s), nc(s) and dc(s) all polyno
The last integral above introduces the error function erf(x) for each element of x,
where x is real.
The error function is defined as:
13.6 Linear Algebra