| Simulink® | ![]() |
argout = linmod('sys');
argout = linmod('sys',x,u);
argout = linmod('sys', x, u, para);
argout = linmod('sys', x, u, 'v5');
argout = linmod('sys', x, u, para, 'v5');
argout = linmod('sys', x, u, para, xpert, upert, 'v5');
argout = dlinmod('sys', Ts, x, u);
argout = dlinmod('sys',Ts, x, u, para, 'v5');
argout = dlinmod('sys',Ts, x, u, para, xpert, upert, 'v5');
argout = linmod2('sys', x, u);
argout = linmod2('sys', x, u, para);
argout = linmodv5('sys');
argout = linmodv5('sys',x,u);
argout = linmodv5('sys', x, u, para);
argout = linmod('sys', x, u, para, xpert, upert);
sys | The name of the Simulink system from which the linear model is to be extracted. |
The state and the input vectors. If specified, they set the operating point at which the linear model is to be extracted. When a model has model references using the Model block, you must use the Simulink structure format to specify x. To extract the x structure from the model, use the following command: x = Simulink.BlockDiagram.getInitialState('sys');You can then change the operating point values within this structure by editing x.signals.values. | |
Ts | Sample time of the discrete-time linearized model |
'v5' | An optional argument that invokes the perturbation algorithm created prior to MATLAB 5.3. Invoking this optional argument is equivalent to calling linmodv5. |
para | A three-element vector of optional arguments:
|
xpert and upert | The perturbation values used to perform the perturbation of all the states and inputs of the model. The default values are xpert = para(1) + 1e-3*para(1)*abs(x) upert = para(1) + 1e-3*para(1)*abs(u) When a model has model references using the Model block, you must use the Simulink structure format to specify xpert. To extract the xpert structure, use the following command: xpert = Simulink.BlockDiagram.getInitialState('sys');You can then change the perturbation values within this structure by editing xpert.signals.values. The perturbation input arguments are only available when invoking the perturbation algorithm created prior to MATLAB 5.3, either by calling linmodv5 or specifying the 'v5' input argument to linmod. |
argout | linmod, dlinmod, and linmod2 all return state-space, transfer function, and MATLAB data structure representations of the linearized system, depending on how you specify the output (left-hand) side of the equation. Using linmod as an example:
|
linmod and dlinmod compute a linear state space model by linearizing each block in a model individually. linmod2 computes a linear state-space model by perturbing the model inputs and model states, and uses an advanced algorithm to reduce truncation error. linmodv5 computes a linear state space model using the full model perturbation algorithm created prior to MATLAB 5.3.
linmod obtains linear models from systems of ordinary differential equations described as Simulink models. Inputs and outputs are denoted in Simulink block diagrams using Inport and Outport blocks.
The default algorithm uses preprogrammed analytic block Jacobians for most blocks which should result in more accurate linearization than numerical perturbation of block inputs and states. A list of blocks that have preprogrammed analytic Jacobians is available in the Simulink® Control Design™ documentation along with a discussion of the block-by-block analytic algorithm for linearization. If you do not have Simulink Control Design software installed, you can access the documentation on The MathWorks™ Web site at http://www.mathworks.com/access/helpdesk/help/toolbox/slcontrol/.
The default algorithm also allows for special treatment of problematic blocks such as the Transport Delay and the Quantizer. See the mask dialog of these blocks for more information and options.
The function dlinmod can linearize discrete, multirate, and hybrid continuous and discrete systems at any given sampling time. Use the same calling syntax for dlinmod as for linmod, but insert the sample time at which to perform the linearization as the second argument. For example,
[Ad,Bd,Cd,Dd] = dlinmod('sys', Ts, x, u);
produces a discrete state-space model at the sampling time Ts and the operating point given by the state vector x and input vector u. To obtain a continuous model approximation of a discrete system, set Ts to 0.
For systems composed of linear, multirate, discrete, and continuous blocks, dlinmod produces linear models having identical frequency and time responses (for constant inputs) at the converted sampling time Ts, provided that
Ts is an integer multiple of all the sampling times in the system.
The system is stable.
For systems that do not meet the first condition, in general the linearization is a time-varying system, which cannot be represented with the [A,B,C,D] state-space model that dlinmod returns.
Computing the eigenvalues of the linearized matrix Ad provides an indication of the stability of the system. The system is stable if Ts>0 and the eigenvalues are within the unit circle, as determined by this statement:
all(abs(eig(Ad))) < 1
Likewise, the system is stable if Ts = 0 and the eigenvalues are in the left half plane, as determined by this statement:
all(real(eig(Ad))) < 0
When the system is unstable and the sample time is not an integer multiple of the other sampling times, dlinmod produces Ad and Bd matrices, which can be complex. The eigenvalues of the Ad matrix in this case still, however, provide a good indication of stability.
You can use dlinmod to convert the sample times of a system to other values or to convert a linear discrete system to a continuous system or vice versa.
You can find the frequency response of a continuous or discrete system by using the bode command.
By default, the system time is set to zero. For systems that are dependent on time, you can set the variable para to a two-element vector, where the second element is used to set the value of t at which to obtain the linear model.
The ordering of the states from the nonlinear model to the linear model is maintained. For Simulink systems, a string variable that contains the block name associated with each state can be obtained using
[sizes,x0,xstring] = sys
where xstring is a vector of strings whose ith row is the block name associated with the ith state. Inputs and outputs are numbered sequentially on the diagram.
For single-input multi-output systems, you can convert to transfer function form using the routine ss2tf or to zero-pole form using ss2zp. You can also convert the linearized models to LTI objects using ss. This function produces an LTI object in state-space form that can be further converted to transfer function or zero-pole-gain form using tf or zpk.
The default algorithms in linmod and dlinmod handle Transport Delay blocks by replacing the linearization of the blocks with a Pade approximation. For the 'v5' algorithm, linearization of a model that contains Derivative or Transport Delay blocks can be troublesome. For more information, see Linearizing Models in Simulink User's Guide.
![]() | libinfo | load_system | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |