trim
Search for dynamic system operating points.
| Library |
|
Description
Function trim uses the Sequential quadratic programming (SQP) method to find workpoints. The function can search for adjustment points that satisfy the conditions imposed on the state variables, input and output variables of the model, as well as balancing points at which the system has non-zero derivative values.
Syntax
Function call
-
x, u, y, dx, options = trim(model)— finds the equilibrium point of the modelmodelin the vicinity of the initial state vectorx0. The found equilibrium point minimizes the absolute value of the expression . If the function cannot find an equilibrium point in the vicinity of the initial state vector, then it returns the point closest to the equilibrium point. The found equilibrium point minimizes the absolute value of the vector of derivatives of the model. You can define the initial state vector using the commandengee.model.
-
x, u, y, dx, options = trim(model, x0, u0, y0, ix, iu, iy)— finds the equilibrium point of the modelmodelin the vicinity of the initial state vectorsx0, entranceu0and exity0given the vectors of the indices of the elements of the initial vectors of the stateix, entranceiuand exitiy. These indexes indicate the states that should remain unchanged as a result of the optimization process. If the function cannot find an equilibrium point that strictly satisfies the set conditions, then it returns the nearest point that minimizes the absolute value of the trajectory. .
-
x, u, y, dx, options = trim(model, x0, u0, y0, ix, iu, iy, dx0, idx)— finds the working points of the modelmodelin the vicinity of the initial state vectorsx0, entranceu0and exity0given the vectors of the indices of the elements of the initial vectors of the stateix, entranceiuand exitiyin which it has nonzero derivative values. Parameterdx0sets the initial approximations of the derivatives of the model state variables, and the parameteridxspecifies the indexes of the elements of the initial vector of derivatives, which should remain unchanged as a result of the optimization process.
The function also returns the value options, which contains information about the optimization process.
Arguments
Input arguments
# model — the name of the model
+
line
Details
The name of the model without the file extension.
| Типы данных |
|
# x0 is the initial state vector
+
nothing | scalar | vector
Details
Initial approximations of the model state variables.
| Типы данных |
|
| Support for complex numbers |
None |
# u0 is the initial input vector
+
nothing | scalar | vector
Details
Initial approximations of the model’s input variables.
| Типы данных |
|
| Support for complex numbers |
None |
# y0 is the initial output vector
+
nothing | scalar | vector
Details
Initial approximations of the output variables of the model.
| Типы данных |
|
| Support for complex numbers |
None |
# ix — indexes of elements of the initial state vector
+
nothing | scalar | vector
Details
The ordinal numbers of the fixed components of the initial state vector.
| Типы данных |
|
| Support for complex numbers |
None |
# iu — indexes of the elements of the initial input vector
+
nothing | scalar | vector
Details
The ordinal numbers of the fixed components of the initial input vector.
| Типы данных |
|
| Support for complex numbers |
None |
# iy — indexes of the elements of the initial output vector
+
nothing | scalar | vector
Details
The ordinal numbers of the fixed components of the initial output vector.
| Типы данных |
|
| Support for complex numbers |
None |
# dx0 is the initial vector of derivatives
+
nothing | scalar | vector
Details
Initial approximations of the derivatives of the model state variables.
| Типы данных |
|
| Support for complex numbers |
None |
# idx — indexes of elements of the initial vector of derivatives
+
nothing | scalar | vector
Details
The ordinal numbers of the components of the initial vector of derivatives, the values of which should remain unchanged as a result of the optimization process.
| Типы данных |
|
| Support for complex numbers |
None |
# options — optimization options
+
mutable composite type
Details
Optimization parameters recorded in the TrimOptions structure. The structure has the following fields and default values:
-
verbose::Bool = false— enable/disable the output of optimization progress messages; -
computation_precision::Float64 = 1e−4— the required accuracy of the calculation of the operating point; -
search_precision::Float64 = 1e−4— the required accuracy of solving the optimization problem; -
derivatives_precision::Float64 = 1e−6— the required accuracy of calculating the derived variables of the model state; -
goal_function_value::Float64 = 0.0— the value of the objective function; -
iterations::Int64 = 1— the number of iterations in the search process; -
gradient_evaluations::Int64 = 1— the number of gradient calculations; -
equality_constraints::Int64 = 0— the number of restrictions in the form of equality; -
max_function_evaluations::Int64 = 0— the maximum number of calculations of the objective function; -
gradient_min_diff::Float64 = 1e−8— the minimum value of the number that characterizes the accuracy of finding the minimum; -
gradient_max_diff::Float64 = 0.1— the maximum value of the number that characterizes the accuracy of finding the minimum; -
step_length::Float64 = 1.0— the step value.
| Типы данных |
|
Output arguments
# u is the input vector corresponding to the operating point
+
vector
Details
The input vector corresponding to the operating point.
| Типы данных |
|
# y is the output vector corresponding to the operating point
+
vector
Details
The output vector corresponding to the operating point.
| Типы данных |
|
# dx is the vector of derivatives corresponding to the operating point
+
vector
Details
The vector of derivatives corresponding to the operating point.
| Типы данных |
|
# options — optimization options
+
mutable composite type
Details
Optimization parameters recorded in the TrimOptions structure. The structure has the following fields and default values:
-
verbose::Bool = false— enable/disable the output of optimization progress messages; -
computation_precision::Float64 = 1e−4— the required accuracy of the calculation of the operating point; -
search_precision::Float64 = 1e−4— the required accuracy of solving the optimization problem; -
derivatives_precision::Float64 = 1e−6— the required accuracy of calculating the derived variables of the model state; -
goal_function_value::Float64 = 0.0— the value of the objective function; -
iterations::Int64 = 1— the number of iterations in the search process; -
gradient_evaluations::Int64 = 1— the number of gradient calculations; -
equality_constraints::Int64 = 0— the number of restrictions in the form of equality; -
max_function_evaluations::Int64 = 0— the maximum number of calculations of the objective function; -
gradient_min_diff::Float64 = 1e−8— the minimum value of the number that characterizes the accuracy of finding the minimum; -
gradient_max_diff::Float64 = 0.1— the maximum value of the number that characterizes the accuracy of finding the minimum; -
step_length::Float64 = 1.0— the step value.
| Типы данных |
|