[ Team LiB ] Previous Section Next Section

3.13 MATLAB and SIMULINK

MATLAB and SIMULINK are ideal for analyzing and simulating dynamic behavior. The Control Toolbox uses LTI (linear, time invariant) objects to represent dynamic models. These objects can be state space or transfer function models; details on how to use these are presented in Module 4.

Here we first present some useful MATLAB functions not covered in other modules.

conv (Convolution) and roots

Often it is necessary to multiply polynomials in s together. Although the following multiplication is quite simple: (5s + 1)(3s + 1) = 15s2 + 8s + 1, a more complex multiplication, such as (2s2 + 1.5s + 1)(3s3 + 8s2 + 4s + 1) could be quite time consuming. The following conv (convolve) command makes this straightforward. Also, the roots of the resulting polynomial are easily calculated using the roots command.


» g = conv([2 1.5 1],[3 8 4 1])
g =
 6.0000 20.5000 23.0000 16.0000 5.5000 1.0000
» p = roots(g)
p =
 -2.1095
 -0.3750 + 0.5995i
 -0.3750 - 0.5995i
 -0.2786 + 0.2836i
 -0.2786 - 0.2836i

step

First, define an object, such one of the transfer functions in Example 3.6.


» num = [-10 1]; den = [45 18 1];
» sysc = tf(num,den)

Transfer function:
 -10 s + 1
-----------------
45 s^2 + 18 s + 1

then plot the step response (use help step to view other options)


» step(sysc)

A number of other useful functions, such as pole and tzero are shown in Module 4.

Simulink

It is highly recommended that you interactively work through the initial sections of Module 2 to understand how SIMULINK can be used to simulate dynamic systems.

    [ Team LiB ] Previous Section Next Section