ltiblock.ss

Tunable fixed-order state-space model

Syntax

blk = ltiblock.ss(name,Nx,Ny,Nu)
blk = ltiblock.ss(name,Nx,Ny,Nu,Ts)
blk = ltiblock.ss(name,sys)
blk = ltiblock.ss(...,Astruct)

Description

Model object for creating tunable fixed-order state-space models. ltiblock.ss lets you parametrize a state-space model of a given order for parameter studies or for automatic tuning with Robust Control Toolbox™ tuning commands such as systune or looptune.

ltiblock.ss is part of the Control Design Block family of parametric models. Other Control Design Blocks includeltiblock.pid, ltiblock.gain, and ltiblock.tf.

Construction

blk = ltiblock.ss(name,Nx,Ny,Nu) creates the continuous-time parametric state-space model named name. The state-space model blk has Nx states,Ny outputs, and Nu inputs. The tunable parameters are the entries in the A, B, C, and D matrices of the state-space model.

blk = ltiblock.ss(name,Nx,Ny,Nu,Ts) creates a discrete-time parametric state-space model with sampling time Ts.

blk = ltiblock.ss(name,sys) uses the dynamic system sys to dimension the parametric state-space model, set its sampling time, and initialize the tunable parameters.

blk = ltiblock.ss(...,Astruct) creates a parametric state-space model whose A matrix is restricted to the structure specified in Astruct.

Input Arguments

name

String specifying the Name of the parametric state-space model blk. (See Properties.)

Nx

Nonnegative integer specifying the number of states (order) of the parametric state-space model blk.

Ny

Nonnegative integer specifying the number of outputs of the parametric state-space model blk.

Nu

Nonnegative integer specifying the number of inputs of the parametric state-space model blk.

Ts

Scalar sampling time.

Astruct

String specifying constraints on the form of the A matrix of the parametric state-space model blk. Astruct can take the following values:

StringStructure of A matrix
'tridiag'A is tridiagonal. In tridiagonal form, A has free elements only in the main diagonal, the first diagonal below the main diagonal, and the first diagonal above the main diagonal. The remaining elements of A are fixed to zero.
'full'A is full (every entry in A is a free parameter).
'companion'A is in companion form. In companion form, the characteristic polynomial of the system appears explicitly in the rightmost column of the A matrix. See canon for more information.

If you do not specify Astruct, blk defaults to 'tridiag' form.

sys

Dynamic system model providing number of states, number of inputs and outputs, sampling time, and initial values of the parameters of blk. To obtain the dimensions and initial parameter values, ltiblock.ss converts sys to a state-space model with the structure specified in Astruct. If you omit Astruct, ltiblock.ss converts sys into tridiagonal state-space form.

Properties

a, b, c, d

Parametrization of the state-space matrices A, B, C, and D of the tunable state-space model blk.

blk.a, blk.b, blk.c, and blk.d are param.Continuous objects. For general information about the properties of these param.Continuous objects, see the param.Continuousparam.Continuous object reference page.

The following fields of blk.a, blk.b, blk.c, and blk.d are used when you tune blk using hinfstruct:

FieldDescription
ValueCurrent values of the entries in the parametrized state-space matrix. For example, blk.a.Value contains the values of the A matrix of blk.
hinfstruct tunes all entries in blk.a.Value, blk.b.Value, blk.c.Value, and blk.d.Value except those whose values are fixed by blk.Gain.Free.
Free2-D array of logical values determining whether the corresponding state-space matrix parameters are fixed or free parameters. For example:
  • If blk.a.Free(i,j) = 1, then blk.a.Value(i,j) is a tunable parameter.

  • If blk.a.Free(i,j) = 0, then blk.a.Value(i,j) is fixed.


Defaults: By default, all entries in b, c, and c are tunable. The default free entries in a depend upon the value of Astruct:
  • 'tridiag' — entries on the three diagonals of blk.a.Free are 1; the rest are 0.

  • 'full' — all entries in blk.a.Free are 0.

  • 'companion'blk.a.Free(1,:) = 1 and blk.a.Free(j,j-1) = 1; all other entries are 0.

MinimumMinimum value of the parameter. This property places a lower bound on the tuned value of the parameter. For example, setting blk.a.Minimum(1,1) = 0 ensures that the first entry in the A matrix remains positive.
Default: -Inf.
MaximumMaximum value of the parameter. This property places an upper bound on the tuned value of the parameter. For example, setting blk.a.Maximum(1,1) = 0 ensures that the first entry in the A matrix remains negative.
Default: Inf.

StateName

State names. For first-order models, set StateName to a string. For models with two or more states, set StateName to a cell array of strings . Use an empty string '' for unnamed states.

Default: Empty string '' for all states

StateUnit

State units. Use StateUnit to keep track of the units each state is expressed in. For first-order models, set StateUnit to a string. For models with two or more states, set StateUnit to a cell array of strings. StateUnit has no effect on system behavior.

Default: Empty string '' for all states

Ts

Sampling time. For continuous-time models, Ts = 0. For discrete-time models, Ts is a positive scalar representing the sampling period. This value is expressed in the unit specified by the TimeUnit property of the model. To denote a discrete-time model with unspecified sampling time, set Ts = -1.

Changing this property does not discretize or resample the model. Use c2d and d2c to convert between continuous- and discrete-time representations. Use d2d to change the sampling time of a discrete-time system.

Default: 0 (continuous time)

TimeUnit

String representing the unit of the time variable. This property specifies the units for the time variable, the sampling time Ts, and any time delays in the model. Use any of the following values:

  • 'nanoseconds'

  • 'microseconds'

  • 'milliseconds'

  • 'seconds'

  • 'minutes'

  • 'hours'

  • 'days'

  • 'weeks'

  • 'months'

  • 'years'

Changing this property has no effect on other properties, and therefore changes the overall system behavior. Use chgTimeUnit to convert between time units without modifying system behavior.

Default: 'seconds'

InputName

Input channel names. Set InputName to a string for single-input model. For a multi-input model, set InputName to a cell array of strings.

Alternatively, use automatic vector expansion to assign input names for multi-input models. For example, if sys is a two-input model, enter:

sys.InputName = 'controls';

The input names automatically expand to {'controls(1)';'controls(2)'}.

You can use the shorthand notation u to refer to the InputName property. For example, sys.u is equivalent to sys.InputName.

Input channel names have several uses, including:

  • Identifying channels on model display and plots

  • Extracting subsystems of MIMO systems

  • Specifying connection points when interconnecting models

Default: Empty string '' for all input channels

InputUnit

Input channel units. Use InputUnit to keep track of input signal units. For a single-input model, set InputUnit to a string. For a multi-input model, set InputUnit to a cell array of strings. InputUnit has no effect on system behavior.

Default: Empty string '' for all input channels

InputGroup

Input channel groups. The InputGroup property lets you assign the input channels of MIMO systems into groups and refer to each group by name. Specify input groups as a structure. In this structure, field names are the group names, and field values are the input channels belonging to each group. For example:

sys.InputGroup.controls = [1 2];
sys.InputGroup.noise = [3 5];

creates input groups named controls and noise that include input channels 1, 2 and 3, 5, respectively. You can then extract the subsystem from the controls inputs to all outputs using:

sys(:,'controls')

Default: Struct with no fields

OutputName

Output channel names. Set OutputName to a string for single-output model. For a multi-output model, set OutputName to a cell array of strings.

Alternatively, use automatic vector expansion to assign output names for multi-output models. For example, if sys is a two-output model, enter:

sys.OutputName = 'measurements';

The output names to automatically expand to {'measurements(1)';'measurements(2)'}.

You can use the shorthand notation y to refer to the OutputName property. For example, sys.y is equivalent to sys.OutputName.

Output channel names have several uses, including:

  • Identifying channels on model display and plots

  • Extracting subsystems of MIMO systems

  • Specifying connection points when interconnecting models

Default: Empty string '' for all input channels

OutputUnit

Output channel units. Use OutputUnit to keep track of output signal units. For a single-output model, set OutputUnit to a string. For a multi-output model, set OutputUnit to a cell array of strings. OutputUnit has no effect on system behavior.

Default: Empty string '' for all input channels

OutputGroup

Output channel groups. The OutputGroup property lets you assign the output channels of MIMO systems into groups and refer to each group by name. Specify output groups as a structure. In this structure, field names are the group names, and field values are the output channels belonging to each group. For example:

sys.OutputGroup.temperature = [1];
sys.InputGroup.measurement = [3 5];

creates output groups named temperature and measurement that include output channels 1, and 3, 5, respectively. You can then extract the subsystem from all inputs to the measurement outputs using:

sys('measurement',:)

Default: Struct with no fields

Name

System name. Set Name to a string to label the system.

Default: ''

Notes

Any text that you want to associate with the system. Set Notes to a string or a cell array of strings.

Default: {}

UserData

Any type of data you wish to associate with system. Set UserData to any MATLAB® data type.

Default: []

Examples

Create a parametrized 5th-order SISO model with zero D matrix.

 blk = ltiblock.ss('ssblock',5,1,1);
 blk.d.Value = 0;      % set D = 0
 blk.d.Free = false;   % fix D to zero

By default, the A matrix is in tridiagonal form. To parametrize the model in companion form, use the 'companion' input argument:

 blk = ltiblock.ss('ssblock',5,1,1,'companion');
 blk.d.Value = 0;      % set D = 0
 blk.d.Free = false;   % fix D to zero

Create a parametric state-space model, and assign names to the inputs.

blk = ltiblock.ss('ssblock',5,2,2) % 5 states, 2 outputs, 2 inputs
blk.InputName = {'Xerror','Yerror'} % assign input names

More About

expand all

Tips

  • Use the Astruct input argument to constrain the structure of the A matrix of the parametric state-space model. To impose additional structure constrains on the state-space matrices, use the fields blk.a.Free, blk.b.Free, blk.c.Free, and blk.d.Free to fix the values of specific entries in the parameter matrices.

    For example, to fix the value of blk.b(i,j), set blk.b.Free(i,j) = 0. To allow hinfstruct to tune blk.b(i,j), set blk.b.Free(i,j) = 1.

  • To convert an ltiblock.ss parametric model to a numeric (non-tunable) model object, use model commands such as ss, tf, or zpk.

Was this topic helpful?