Linear (LTI) Models

What Is a Plant?

Typically, control engineers begin by developing a mathematical description of the dynamic system that they want to control. The system to be controlled is called a plant. As an example of a plant, this section uses the DC motor. This section develops the differential equations that describe the electromechanical properties of a DC motor with an inertial load. It then shows you how to use the Control System Toolbox™ functions to build linear models based on these equations.

Linear Model Representations

You can use Control System Toolbox functions to create the following model representations:

  • State-space models (SS) of the form

    dx/dtu
    u

    where ABC, and are matrices of appropriate dimensions, x is the state vector, and u and y are the input and output vectors.

  • Transfer functions (TF), for example,

    H(s)=s+2*s^2+s+10

  • Zero-pole-gain (ZPK) models, for example,

    Hz )=3(z+1+j)(z+1j)/( z 0.2 )z 0.1 )

  • Frequency response data (FRD) models, which consist of sampled measurements of a system's frequency response. For example, you can store experimentally collected frequency response data in an FRD model.

    Note

    The design of FRD models is a specialized subject that this topic does not address. See Frequency Response Data (FRD) Models for a discussion of this topic.

SISO Example: The DC Motor

A simple model of a DC motor driving an inertial load shows the angular rate of the load, ω(t), as the output and applied voltage, υapp(t), as the input. The ultimate goal of this example is to control the angular rate by varying the applied voltage. This figure shows a simple model of the DC motor.

A Simple Model of a DC Motor Driving an Inertial Load

In this model, the dynamics of the motor itself are idealized; for instance, the magnetic field is assumed to be constant. The resistance of the circuit is denoted by R and the self-inductance of the armature by L. If you are unfamiliar with the basics of DC motor modeling, consult any basic text on physical modeling. With this simple model and basic laws of physics, it is possible to develop differential equations that describe the behavior of this electromechanical system. In this example, the relationships between electric potential and mechanical force are Faraday's law of induction and Ampère's law for the force on a conductor moving through a magnetic field.

Mathematical Derivation

The torque τ seen at the shaft of the motor is proportional to the current i induced by the applied voltage,

τ(t)=Kmi(t)

where Km, the armature constant, is related to physical properties of the motor, such as magnetic field strength, the number of turns of wire around the conductor coil, and so on. The back (induced) electromotive force, υemf, is a voltage proportional to the angular rate ω seen at the shaft,

υemf(t)=Kbω(t)

where Kb, the emf constant, also depends on certain physical properties of the motor.

The mechanical part of the motor equations is derived using Newton's law, which states that the inertial load J times the derivative of angular rate equals the sum of all the torques about the motor shaft. The result is this equation,

J (dw/dt)=∑τi=Kfω(t)+Kmi(t)

where Kfω is a linear approximation for viscous friction.

Finally, the electrical part of the motor equations can be described by

υapp(t)υemf(t)=L (di/dt)i(t)

or, solving for the applied voltage and substituting for the back emf,

υapp(t)=L (di/dt)i(t)+Kbω(t)

This sequence of equations leads to a set of two differential equations that describe the behavior of the motor, the first for the induced current,

di/dt=−(R/L) i(t)−(Kb /L)ω(t)+(1/L)υapp(t)

and the second for the resulting angular rate,

dω/dt=−(1/J) Kfω(t)+(1/J)Kmi(t)

State-Space Equations for the DC Motor

Given the two differential equations derived in the last section, you can now develop a state-space representation of the DC motor as a dynamic system. The current and the angular rate ω are the two states of the system. The applied voltage, υapp, is the input to the system, and the angular velocity ω is the output.

d/dt[i; ω]= [ -R/L    -K/L

                   -K/J    -K/j ]    [i ; w] + [ i/L  0] *υapp(t)

State-Space Representation of the DC Motor Example

y(t)=[0 1][ω]+[0]υapp(t)

Building SISO Models

After you develop a set of differential equations that describe your plant, you can construct SISO models using simple commands. The following sections discuss

  • Constructing a state-space model of the DC motor

  • Converting between model representations

  • Creating transfer function and zero/pole/gain models

Constructing a State-Space Model of the DC Motor

Enter the following nominal values for the various parameters of a DC motor.

R= 2.0 % Ohms
L= 0.5 % Henrys
Km = .015 % torque constant
Kb = .015 % emf constant
Kf = 0.2 % Nms
J= 0.02 % kg.m^2

Given these values, you can construct the numerical state-space representation using the ss function.

A = [-R/L -Kb/L; Km/J -Kf/J]
B = [1/L; 0];
C = [0 1];
D = [0];
sys_dc = ss(A,B,C,D)

These commands return the following result:

a = 
                        x1           x2
           x1           -4        -0.03
           x2         0.75          -10
 
 
b = 
                        u1
           x1            2
           x2            0
 
 
c = 
                        x1           x2
           y1            0            1
 
 
d = 
                        u1
           y1            0

Converting Between Model Representations

Now that you have a state-space representation of the DC motor, you can convert to other model representations, including transfer function (TF) and zero/pole/gain (ZPK) models.

Transfer Function Representation.  You can use tf to convert from the state-space representation to the transfer function. For example, use this code to convert to the transfer function representation of the DC motor.

sys_tf = tf(sys_dc)
Transfer function:
       1.5
------------------
s^2 + 14 s + 40.02

Zero/Pole/Gain Representation.  Similarly, the zpk function converts from state-space or transfer function representations to the zero/pole/gain format. Use this code to convert from the state-space representation to the zero/pole/gain form for the DC motor.

sys_zpk = zpk (sys_dc)
 
Zero/pole/gain:
        1.5
-------------------
(s+4.004) (s+9.996)

Note

The state-space representation is best suited for numerical computations. For highest accuracy, convert to state space prior to combining models and avoid the transfer function and zero/pole/gain representations, except for model specification and inspection.

Constructing Transfer Function and Zero/Pole/Gain Models

In the DC motor example, the state-space approach produces a set of matrices that represents the model. If you choose a different approach, you can construct the corresponding models using tfzpkss, or frd.

sys = tf(num,den)               % Transfer function
sys = zpk(z,p,k)                % Zero/pole/gain
sys = ss(a,b,c,d)               % State-space
sys = frd(response,frequencies) % Frequency response data

For example, you can create the transfer function by specifying the numerator and denominator with this code.

sys_tf = tf(1.5,[1 14 40.02])
 
Transfer function:
       1.5
------------------
s^2 + 14 s + 40.02

Alternatively, if you want to create the transfer function of the DC motor directly, use these commands.

s = tf('s');
sys_tf = 1.5/(s^2+14*s+40.02)

These commands result in this transfer function.

Transfer function:
        1.5
--------------------
s^2 + 14 s + 40.02

To build the zero/pole/gain model, use this command.

sys_zpk = zpk ([], [- 9.996 -4.004], 1.5)

This command returns the following zero/pole/gain representation.

Zero/pole/gain:
        1.5
-------------------
(s+9.996) (s+4.004)

Constructing Discrete Time Systems

The Control System Toolbox software provides full support for discrete-time systems. You can create discrete systems in the same way that you create analog systems; the only difference is that you must specify a sample time period for any model you build. For example,

sys_disc = tf(1, [1 1], .01);

creates a SISO model in the transfer function format.

Transfer function:
  1
-----
with +1
 
Sample time: 0.01

Adding Time Delays to Discrete-Time Models

You can add time delays to discrete-time models by specifying an input delay, output delay, or I/O delay when building the model. The time delay must be a nonnegative integer that represents a multiple of the sample time. For example,

sys_delay = tf(1, [1 1], 0.01,'ioDelay',5)

returns a system with an I/O delay of 5 s.

Transfer function:
           1
z ^ (- 5) * -----
         with +1
 
Sample time: 0.01

Adding Delays to Linear Models

You can add time delays to linear models by specifying an input delay, output delay, or I/O delay when building a model. For example, to add an I/O delay to the DC motor, use this code.

sys_tfdelay = tf(1.5,[1 14 40.02],'ioDelay',0.05)

This command constructs the DC motor transfer function, but adds a 0.05 second delay.

Transfer function:
                      1.5
exp(-0.05*s) * ------------------
               s^2 + 14 s + 40.02

For more information about adding time delays to models, see Time Delays in Linear Systems.

LTI Objects

For convenience, the Control System Toolbox software uses custom data structures called LTI objects to store model-related data. For example, the variable sys_dc created for the DC motor example is called an SS object. There are also TF, ZPK, and FRD objects for transfer function, zero/pole/gain, and frequency data response models respectively. The four LTI objects encapsulate the model data and enable you to manipulate linear systems as single entities rather than as collections of vectors or matrices.

To see what LTI objects contain, use the get command. This code describes the contents of sys_dc from the DC motor example.

get(sys_dc)
                A: [2×2 double]
                B: [2×1 double]
                C: [0 1]
                D: 0
                E: []
           Scaled: 0
        StateName: {2×1 cell}
        StateUnit: {2×1 cell}
    InternalDelay: [0×1 double]
       InputDelay: 0
      OutputDelay: 0
               Ts: 0
         TimeUnit: 'seconds'
        InputName: {''}
        InputUnit: {''}
       InputGroup: [1×1 struct]
       OutputName: {''}
       OutputUnit: {''}
      OutputGroup: [1×1 struct]
            Notes: [0×1 string]
         UserData: []
             Name: ''
     SamplingGrid: [1×1 struct]

You can manipulate the data contained in LTI objects using the set command; see the Control System Toolbox online reference pages for descriptions of set and get.

Another convenient way to set or retrieve LTI model properties is to access them directly using dot notation. For example, if you want to access the value of the A matrix, instead of using get, you can type

sys_dc.A

at the MATLAB® prompt. This notation returns the A matrix.

years =

   -4.0000   -0.0300
    0.7500  -10.0000

Similarly, if you want to change the values of the A matrix, you can do so directly, as this code shows.

A_new = [-4.5 -0.05; 0.8 -12.0];
sys_dc.A = A_new;

Matlabsolutions.com provides guaranteed satisfaction with a commitment to complete the work within time. Combined with our meticulous work ethics and extensive domain experience, We are the ideal partner for all your homework/assignment needs. We pledge to provide 24*7 support to dissolve all your academic doubts. We are composed of 300+ esteemed Matlab and other experts who have been empanelled after extensive research and quality check.

Matlabsolutions.com provides undivided attention to each Matlab assignment order with a methodical approach to solution. Our network span is not restricted to US, UK and Australia rather extends to countries like Singapore, Canada and UAE. Our Matlab assignment help services include Image Processing Assignments, Electrical Engineering Assignments, Matlab homework help, Matlab Research Paper help, Matlab Simulink help. Get your work done at the best price in industry.

Machine Learning in MATLAB

Train Classification Models in Classification Learner App

Train Regression Models in Regression Learner App

Distribution Plots

Explore the Random Number Generation UI

Design of Experiments

Machine Learning Models

Logistic regression

Logistic regression create generalized linear regression model - MATLAB fitglm 2

Support Vector Machines for Binary Classification

Support Vector Machines for Binary Classification 2

Support Vector Machines for Binary Classification 3

Support Vector Machines for Binary Classification 4

Support Vector Machines for Binary Classification 5

Assess Neural Network Classifier Performance

Naive Bayes Classification

ClassificationTree class

Discriminant Analysis Classification

Ensemble classifier

ClassificationTree class 2

Train Generalized Additive Model for Binary Classification

Train Generalized Additive Model for Binary Classification 2

Classification Using Nearest Neighbors

Classification Using Nearest Neighbors 2

Classification Using Nearest Neighbors 3

Classification Using Nearest Neighbors 4

Classification Using Nearest Neighbors 5

Linear Regression

Linear Regression 2

Linear Regression 3

Linear Regression 4

Nonlinear Regression

Nonlinear Regression 2

Visualizing Multivariate Data

Generalized Linear Models

Generalized Linear Models 2

RegressionTree class

RegressionTree class 2

Neural networks

Gaussian Process Regression Models

Gaussian Process Regression Models 2

Understanding Support Vector Machine Regression

Understanding Support Vector Machine Regression 2

RegressionEnsemble



matlab assignment help


matlab assignment help