|
Calling Sequence
|
|
Linearize( eqs, u, y, linpoint, opts)
|
|
Parameters
|
|
eqs
|
-
|
equation, expression, or set or list of equations or expressions; equations to be linearized. An expression expr is interpreted as the equation .
|
u
|
-
|
list or set; input variables
|
y
|
-
|
list or set; output variables
|
linpoint
|
-
|
list(equation) or set(equation); point around which the linearization is performed
|
opts
|
-
|
(optional) equation(s) of the form option = value; specify options for the Linearize command
|
|
|
|
|
Options
|
|
Specifies whether the given equations need to be simplified to the explicit nonlinear form above (true) or the system is already in this form and this step can be omitted (false). The default is true.
•
|
functions = list of lists
|
The user-defined functions present in the system. Each function is described in a list of the form [name, input argument type list, output type, Maple function], where:
–
|
name is the name of the function used in eqs;
|
–
|
input argument type list is a list of valid types accepted by the function (currently, only functions with float arguments are supported);
|
–
|
output type is the type of the output returned by the function (currently, only single-float- and void-valued functions are supported);
|
•
|
outputoption = statespace or equation
|
Specifies whether the linearized system should be returned as a state-space system object (statespace) or as a differential or algebraic equation system object (equation). The default is statespace.
If outputoption = statespace, a check is performed as to whether the linearized system is fully represented by the state-space object. The checkpoint option disables this check (false), and the state-space object is returned in terms of the original variables. By default, the check is always performed, checkpoint = true.
•
|
equilibriumtolerance = positive
|
Specifies the value of used when checking whether linpoint is an equilibrium point. If then linpoint given by is considered to be an equilibrium point. If consists of several components, the absolute value of each of them is tested. By default, .
Base name of the input variables of the generated DynamicSystems object. The default value is specified by DynamicSystems[SystemOptions].
Base name of the output variables of the generated DynamicSystems object. The default value is specified by DynamicSystems[SystemOptions].
Base name of the state variables of the generated DynamicSystems object. The default is specified by DynamicSystems[SystemOptions].
Specifies the time at which the system is linearized. This value is needed for time-varying systems and for piecewise functions with conditions depending on time. The default value is 0.
|
|
Description
|
|
•
|
The Linearize command computes the linearization of eqs about an operating point specified by linpoint. It is assumed that eqs can be reduced to the form
|
where:
represents the state variables of eqs converted to the first-order form;
represents the input variables specified by u;
represents the output variables specified by y;
and are nonlinear functions to be linearized;
t is a continuous time variable as specified by the continuoustimevar option in DynamicSystems[SystemOptions].
The Linearize command simplifies eqs to the above form and computes the following linear model
where , , , and are the Jacobian matrices evaluated at linpoint.
•
|
The u parameter is a list or set of the input variables. Each element of u must be a function of t, where t corresponds to the independent time variable set by the continuoustimevar option to DynamicSystems[SystemOptions].
|
•
|
The y parameter is a list or set of the output variables. Each element of y must be a function of t, where t corresponds to the independent time variable set by the continuoustimevar option to DynamicSystems[SystemOptions].
|
•
|
The output of the Linearize command consists of a DynamicSystems object and three lists. The lists provide a mapping between the state, input, and output variables of the object and the state, input, and output variables of the original equations, respectively.
|
|
The state-space form does not always represent the linearized system fully, since it includes only , , , and matrices. The Linearize command performs a check to determine whether the linear model has any terms in addition to , , , and . If it does, the Linearize command checks whether the given point was an equilibrium point, . If not, the Linearize command tries to find an equilibrium point for the linear model. If there is an equilibrium point (whether it is the linearization point or a newly found equilibrium point), the shift transformation is performed, and the variables used in the DynamicSystems object are the variables in eqs shifted by the equilibrium point: , , , where is an equilibrium point. If there are free terms and no equilibrium point can be found, the linearized equations are returned as a differential equation object. The effect of the check can be disabled using the checkpoint option.
|
•
|
The given nonlinear equations eqs and the linearization point linpoint may contain symbolic parameters. Note, however, that if there are symbolic parameters present in eqs or linpoint and there are user-defined functions specified by the functions option, the linearization will likely fail.
|
|
|
Examples
|
|
>
|
|
|
Example 1: Basic usage
|
|
>
|
|
| (1) |
>
|
|
| (2) |
>
|
|
| (3) |
>
|
|
| (4) |
>
|
|
| (5) |
The linearization point does not give exact zero. Compute linear model for a tighter tolerance
>
|
|
| (6) |
>
|
|
| (7) |
Disable the checkpoint option for the same setting of the tolerance
>
|
|
| (8) |
|
|
Example 2: Use of user-defined functions
|
|
>
|
sys2 := {piecewise(x[1](t)<0, x[1](t), x[2](t) + x[1](t)^2) * piecewise(u(t)<0, cos(y(t)), sin(y(t))) = sin(x[1](t)^2) + 5 * y(t) + diff(x[1](t), t, t), y(t) - x[1](t)^2 + u(t)*x[1](t), diff(x[2](t), t) = f(x[1](t), u(t))};
user_function := [
f,
[float, float],
float,
proc(x, y)
local d1, d2;
d1 := cos(x)+x^2;
d2 := y*d1 + y^2;
return d1*x+d2*y- exp(d1);
end proc
];
|
| |
| (9) |
>
|
|
| (10) |
>
|
|
| (11) |
>
|
|
| (12) |
>
|
|
| (13) |
Example of the statevariable, inputvariable, and outputvariable options
>
|
|
| (14) |
>
|
|
| (15) |
|
|
Example 3: Inverted pendulum on a moving cart
|
|
Variables
|
counter-clockwise angular displacement of the pendulum from the upright position
|
|
angular velocity of the pendulum,
|
|
position of the cart
|
|
velocity of the cart,
|
|
horizontal force applied to the cart
|
|
|
Parameters
|
half-length of pendulum
|
|
mass of the pendulum
|
|
mass of the cart
|
|
gravitational constant (9.8 )
|
|
|
>
|
|
| (16) |
Linearization point is given by:
>
|
|
| (17) |
>
|
|
| (18) |
The state-space object given by lin_model3[1] can be used to construct a stabilizing controller using linear control theory.
>
|
|
| (19) |
|
|
|
|