trim
Find trim point of dynamic system
The trim
function provides only basic trimming functionality. For
full trimming functionality, use Simulink®
Control Design™ software. For more information, see Compute Steady-State Operating Points (Simulink Control Design).
Syntax
Description
The trim
function starts from an initial point and
searches using a sequential quadratic programming algorithm until it finds the nearest
trim point.
You must supply the initial point implicitly or explicitly. If the
trim
function cannot find a trim point, the function returns
the point encountered in its search where the state derivatives are closest to zero in a
min-max sense. In other words, the function returns the point that minimizes the maximum
deviation from zero of the derivatives. The trim
function can find
trim points that meet specific input, output, or state conditions, and the function can
find points where a system is changing in a specified manner, that is, points where the
system state derivatives equal specific nonzero values.
Caution
When you use the trim
function to find a trim point near a
specified initial operating point, the trim
function returns
only a local value. Other, more suitable trim points might exist. To find the most
suitable trim point for a particular application, as a best practice, try a number
of initial guesses for the initial state, input, and output values.
[
finds the equilibrium point of the model specified by x
,u
,y
,dx
] = trim(sys
)sys
nearest to the initial state, x0
. Specifically, the
trim
function finds the equilibrium point that minimizes
the maximum absolute value of [x-x0,u,y]
. If
trim
cannot find an equilibrium point near the system's
initial state, it returns the point at which the system is nearest to equilibrium.
Specifically, it returns the point that minimizes abs(dx)
, where
dx
represents the derivative of the system. You can obtain
x0
using this command: [sizes,x0,xstr] =
sys([],[],[],0)
.
[
finds the trim point closest to x
,u
,y
,dx
] = trim(sys
,x0
,u0
,y0
,ix
,iu
,iy
)x0
, u0
,
y0
that satisfies a specified set of state, input, and/or
output conditions. The integer vectors ix
,
iu
, and iy
select the values in
x0
, u0
, and y0
that must be satisfied. If the trim
function cannot find an
equilibrium point that satisfies the specified set of conditions exactly, it returns
the nearest point that satisfies the conditions, namely, abs([x(ix)-x0(ix);
u(iu)-u0(iu); y(iy)-y0(iy)])
.
[
finds specific nonequilibrium points, that is, points at which the system's state
derivatives have some specified nonzero value. Here, x
,u
,y
,dx
] = trim(sys
,x0
,u0
,y0
,ix
,iu
,iy
,dx0
,idx
)dx0
specifies the state derivative values at the search's starting point and
idx
selects the values in dx0
that the
search must satisfy exactly.
[
specifies an array of optimization parameters that the x
,u
,y
,dx
,options
] = trim(sys
,x0
,u0
,y0
,ix
,iu
,iy
,dx0
,idx
,options
)trim
function passes to the optimization function that it uses to find trim points. The
optimization function, in turn, uses this array to control the optimization process
and to return information about the process. The trim
function
returns the options
array at the end of the search process. By
exposing the underlying optimization process in this way, the
trim
function allows you to monitor and fine-tune the
search for trim points.
Examples
Input Arguments
Output Arguments
More About
Algorithms
The trim
function uses a sequential quadratic programming
algorithm to find trim points. For a description of this algorithm, see Sequential Quadratic Programming (SQP) (Optimization Toolbox).
Version History
Introduced before R2006a
See Also
findop
(Simulink Control Design)
Topics
- Compute Steady-State Operating Points (Simulink Control Design)