Quantcast

Documentation Center

  • Trial Software
  • Product Updates

SISO Model Creation

How to create continuous-time single-input, single-output (SISO) models.

Transfer Function Model Using Numerator and Denominator Coefficients

This example shows how to create continuous-time single-input, single-output (SISO) transfer functions from their numerator and denominator coefficients using tf.

Create the transfer function :

num = [1 0];
den = [1 3 2];
G = tf(num,den);

num and den are the numerator and denominator polynomial coefficients in descending powers of s. For example, den = [1 3 2] represents the denominator polynomial s2 + 3s + 2.

G is a tf model object, which is a data container for representing transfer functions in polynomial form.

    Tip   Alternatively, you can specify the transfer function G(s) as an expression in s:

    1. Create a transfer function model for the variable s.

      s = tf('s');          
    2. Specify G(s) as a ratio of polynomials in s.

      G = s/(s^2 + 3*s + 2); 

 More About

Transfer Function Model Using Zeros, Poles, and Gain

This example shows how to create single-input, single-output (SISO) transfer functions in factored form using zpk.

Create the factored transfer function :

Z = [0];
P = [-1-1i -1+1i -2];
K = 5;
G = zpk(Z,P,K);

Z and P are the zeros and poles (the roots of the numerator and denominator, respectively). K is the gain of the factored form. For example, G(s) has a real pole at s = –2 and a pair of complex poles at s = –1 ± i. The vector P = [-1-1i -1+1i -2] specifies these pole locations.

G is a zpk model object, which is a data container for representing transfer functions in zero-pole-gain (factorized) form.

 More About

State-Space Model

This example shows how to create a continuous-time single-input, single-output (SISO) state-space model from state-space matrices using ss.

Create a model of an electric motor where the state-space equations are:

where the state variables are the angular position θ and angular velocity /dt:

u is the electric current, the output y is the angular velocity, and the state-space matrices are:

To create this model, enter:

A = [0 1;-5 -2];
B = [0;3];
C = [0 1];
D = 0;
sys = ss(A,B,C,D);

sys is an ss model object, which is a data container for representing state-space models.

    Tip   To represent a system of the form:

    use dss. This command creates a ss model with a nonempty E matrix, also called a descriptor state-space model. See MIMO Descriptor State-Space Model for an example.

 More About

Frequency-Response Model

This example shows how to create a single-input, single-output (SISO) frequency-response model using frd.

A frequency-response model stores a vector of frequency points with corresponding complex frequency response data you obtain either through simulations or experimentally. Thus, if you measure the frequency response of your system at a set of test frequencies, you can use the data to create a frequency response model:

  1. Load the frequency response data in AnalyzerData.mat.

    load AnalyzerData

    This command loads the data into the MATLAB® workspace as the column vectors freq and resp. The variables freq and resp contain 256 test frequencies and the corresponding complex-valued frequency response points, respectively.

      Tip   To inspect these variables, enter:

      whos freq resp
  2. Create a frequency response model.

    sys = frd(resp,freq);

sys is an frd model object, which is a data container for representing frequency response data.

You can use frd models with many frequency-domain analysis commands. For example, visualize the frequency response data using bode.

    Tip   By default, the frd command assumes that the frequencies are in radians/second. To specify different frequency units, use the TimeUnit and FrequencyUnit properties of the frd model object. For example:

    sys = frd(resp,freq,'TimeUnit','min','FrequencyUnit','rad/TimeUnit') 

    sets the frequency units to radians/minute.

 More About

Proportional-Integral-Derivative (PID) Controller

How to create models representing PID controllers.

Continuous-Time PID Controller Representations

You can represent continuous-time Proportional-Integral-Derivative (PID) controllers in either parallel or standard form. The two forms differ in the parameters used to express the proportional, integral, and derivative actions and the filter on the derivative term, as shown in the following table.

FormFormula
Parallel

where:

  • Kp = proportional gain

  • Ki = integrator gain

  • Kd = derivative gain

  • Tf = derivative filter time

Standard

where:

  • Kp = proportional gain

  • Ti = integrator time

  • Td = derivative time

  • N = derivative filter constant

Use a controller form that is convenient for your application. For example, if you want to express the integrator and derivative actions in terms of time constants, use Standard form.

See Discrete-Time Proportional-Integral-Derivative (PID) Controller for information on creating PID Controllers in discrete time.

Create Continuous-Time Parallel-Form PID Controller

This example shows how to create a continuous-time Proportional-Integral-Derivative (PID) controller in parallel form using pid.

Create the following parallel-form PID controller:

Kp = 29.5;
Ki = 26.2;
Kd = 4.3;
Tf = 0.06;
C = pid(Kp,Ki,Kd,Tf)

C is a pid model object, which is a data container for representing parallel-form PID controllers.

Create Continuous-Time Standard-Form PID Controller

This example shows how to create a continuous-time Proportional-Integral-Derivative (PID) controller in standard form using pidstd.

Create the following standard-form PID controller:

Kp = 29.5;
Ti = 1.13;
Td = 0.15;
N = 2.3;
C = pid(Kp,Ki,Kd,Tf)

C is a pidstd model object, which is a data container for representing standard-form PID controllers.

 More About

Was this topic helpful?