Documentation |
Tunable fixed-order state-space model
blk = ltiblock.ss(name,Nx,Ny,Nu)
blk = ltiblock.ss(name,Nx,Ny,Nu,Ts)
blk = ltiblock.ss(name,sys)
blk = ltiblock.ss(...,Astruct)
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.
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.
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:
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. |
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:
| ||||||||||
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:
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:
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:
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: [] |
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
genss | hinfstruct | looptune | ltiblock.pid | ltiblock.pid2 | ltiblock.ss | ltiblock.tf | systune