Autopilot definition
 @AUTO_PILOT_DEFINITION {
 @AUTO_PILOT_NAME {AutoPltName} {
 @CONTROLLER_NAME {ContrlrName}
 @NUMBER_OF_STATES {N_{i}}
 @TARGET_VALUES {y_{1}^{*}, y_{2}^{*}, ..., y_{Ni}^{*}}
 @GAIN_MATRIX {g_{1}, g_{2}, ..., g_{Ni}}
 @PHASES_TIME_SPANS {T_{ref}, T_{per}, T_{sim}}
 @PERTURBATION_MAGNITUDE {Δ_{1}, Δ_{2}, Δ_{Ni}}
 @TIME_CONSTANT {T}
 @INVERSE_TRIM_MATRIX {J^{1}}
 @MAXIMUM_RATE {R_{max}}
 @MINIMUM_ERROR {e_{min}}
 @COMMENTS {CommentText}
 }
 }
Introduction
The quasisteady trimmer is a control law designed to determine the outputs, u, that will drive the system to a configuration where the input match the specified target values y^{*T} = {y_{1}^{*}, y_{2}^{*}, ..., y_{Ni}^{*}}. The autopilot modifies the controls proportionally to the output error so as to drive the inputs to their target values. The following discrete equations are introduced to compute the control outputs at each time step
u_{f} = u_{i} + Δt J^{1} G (y^{*}  y_{f}),
where the subscripts (.)_{i} and (.)_{f} denote quantities computed at the initial and final times of the time step, respectively, denoted t_{i} and t_{f}, respectively; Δt = t_{f}  t_{i} is the time step size, y_{f} the present input value, J the Jacobian matrix and G the gain matrix. The gain matrix is assumed to be a diagonal matrix, G = diag(g_{α}).
The Jacobian matrix is defined as a derivative of the inputs with respect to the outputs
J = ∂y/∂u.
This matrix is, in general, unknown, and hence, it is evaluated numerically using a finite difference process
 First, a reference configuration is established by simulating the response of the system for period T_{ref} with the outputs set to reference constant values u. At the end of the reference run, the input values are denoted y.
 Next, a perturbed configuration is established for the first state by simulating the system for time T_{per} with the first output set to a value u_{1} = u_{1 ref} + Δ_{1}, where Δ_{1} is the perturbation magnitude. All other outputs are kept to their reference value. At the end of the first perturbation run, the input values are denoted y_{1}.
 Next, the procedure is repeated for each state of the system, to determine the sensor measurements y_{i}, i = 2, 3, ..., N_{i}, corresponding to perturbations of the other outputs with magnitudes Δ_{i}.
At the end of this identification process, an approximation to the Jacobian matrix is obtained as follows
J = [ (y_{1}  y)/Δ_{1}, (y_{2}  y)/Δ_{2}, ..., (y_{Ni}  y)/Δ_{Ni} ].
Once the Jacobian matrix has been identified, the autopilot switches to simulation mode for period T_{sim}. At each time step, the control law is applied to drive the input values to their targets.
Notes
 The autopilot is an embedded control law associated with the controller ContrlrName. The autopilot control law features a number of states, N_{i}, that must equal the number of inputs, N_{i}, and outputs, N_{o}, i.e., N_{i} = N_{o} = N_{i}.
 A set of N_{i} target values, y_{1}^{*}, y_{2}^{*}, ..., y_{Ni}^{*} and N_{i} gains, g_{1}, g_{2}, ..., g_{Ni}, must be defined.
 The time span for each of the three phases of operation of the autopilot are defined as follows.
 The system is simulated for period T_{ref} to establish the reference configuration of the system for the reference output values u. At the end of the reference run, the input values are denoted y. It is important to simulate the response of the system for a period that is long enough to allow the dynamics of the system to settle, i.e., for y to settle to steady values.
 For each of the N_{i} states of the system, the system will be simulated for period T_{per} to establish the response of the system due to perturbed outputs, u_{i} = u_{i} + Δ_{i}, i = 1, 2, ... N_{i}, where Δ_{i} are the perturbation magnitudes. To avoid applying the perturbations in a single time step, the following schedule is used to perturb the autopilot outputs: u_{i}(t') = u_{i} + Δ_{i} [ 1  \cos (\pi t'/T ) ]/2, if t' < T, and u_{i}(t') = u_{i} + Δ_{i}, if t' ≥ T, where t' is the time measured from the beginning of the perturbation phase, and T the time constant. Here again, it is important to simulate the system for a period that is long enough to allow the response to stabilize after the application of each perturbation. The following must hold: T < T_{per}.
 Finally, the system is simulated for period T_{sim} in the simulation phase. At each time step, the control law is applied to drive the input values to their targets.
 Application of the autopilot approach to periodic problems can be troublesome. The control law adjusts the control variables at every time step to track the target values. This leads to periodic excitation of the controlled variables, and, in turn, periodic excitation of the input values. To overcome this problem, the autopilot equation should be driven driven by averages of the input values over one period of the system. This is readily achieved by using the data conditioning feature of signals: all sensors measurements will then be running averages over the last period rather than instantaneous measurements.
 If the trim matrix has already been identified in a previous run, it is effective to read this matrix, bypassing the need to construct it with the help of the procedure described above. At the end of the identification process, the inverse trim matrix is printed in the output file, to be used in a subsequent run. If the inverse trim matrix is read, the auto pilot will immediately start with the simulation phase for a period T_{sim} using the control law. Upon completion, the Jacobian matrix identification process will start again. The inverse trim matrix should be read column by column.

The behavior and convergence characteristics of the autopilot are strongly affected by the gain matrix G = diag(g_{i}); the individual gains, g_{i}, should be adjusted to obtain the best convergence characteristics. High gain values may render the closedloop system unstable. Even moderate gain values can lead to instabilities because the autopilot does not account for system dynamics. To overcome this problem, if the minimum error parameters e_{min} is defined, an adaptive gain selection strategy is introduced: when the difference between the input and its target value becomes small, the gain is gradually decreased to zero using the following schedule
g_{s} = tanh (4e/ e_{min}),
where e =  y  y /  y , the relative difference between the actual and target input values. The gain matrix then becomes G = g_{s} diag(g_{i}). 
The autopilot algorithm ignores system dynamics from both structural dynamics and aerodynamic standpoints. To avoid spurious dynamics and unsteady aerodynamic effects, it is sometimes necessary to limit the rate of change of the control variables. Hence, if R_{max} is defined, the following condition is imposed
 u_{f}  u_{i}  ≤ Δt R_{max}.  It is possible to attach comments to the definition of the object; these comments have no effect on its definition.