yaocptool.modelling.mixins package¶
Submodules¶
yaocptool.modelling.mixins.algebraic_mixin module¶
-
class
AlgebraicMixin(**kwargs)[source]¶ Bases:
object-
create_algebraic_variable(name='y', size=1)[source]¶ Create a new algebraic variable with the name “name” and size “size”. Size can be an int or a tuple (e.g. (2,2)). However, the new algebraic variable will be vectorized (casadi.vec) to be included in the algebraic vector (model.y).
Parameters: - name (str) –
- size (int||tuple) –
Returns:
-
find_algebraic_variable(x, u, guess=None, t=0.0, p=None, theta_value=None, rootfinder_options=None)[source]¶
-
n_y¶
-
y_names¶
-
yaocptool.modelling.mixins.control_mixin module¶
-
class
ControlMixin(**kwargs)[source]¶ Bases:
object-
control_is_parametrized(u)[source]¶ - Check if the control “u” is parametrized
Parameters: u (casadi.SX) – Rtype bool:
-
create_control(name='u', size=1)[source]¶ Create a new control variable name “name” and size “size”. Size can be an int or a tuple (e.g. (2,2)). However, the new control variable will be vectorized (casadi.vec) to be included in the control vector (model.u).
Parameters: - name – str
- size – int
Returns:
-
create_input(name='u', size=1)[source]¶ Same as the “model.create_control” function. Create a new control/input variable name “name” and size “size”. Size can be an int or a tuple (e.g. (2,2)). However, the new control variable will be vectorized (casadi.vec) to be included in the control vector (model.u).
Parameters: - name – str
- size – int
Returns:
-
n_u¶
-
n_u_par¶
-
parametrize_control(u, expr, u_par=None)[source]¶ - Parametrize a control variables so it is a function of a set of parameters or other model variables.
Parameters: - u (list|casadi.SX) –
- expr (list|casadi.SX) –
- u_par (list|casadi.SX) –
-
u_names¶
-
yaocptool.modelling.mixins.parameter_mixin module¶
-
class
ParameterMixin(**kwargs)[source]¶ Bases:
object-
create_parameter(name='p', size=1)[source]¶ Create a new parameter name “name” and size “size”
Parameters: - name – str
- size – int
Returns:
-
create_theta(name='theta', size=1)[source]¶ Create a new parameter name “name” and size “size”
Parameters: - name – str
- size – int
Returns:
-
n_p¶
-
n_theta¶
-
p_names¶
-
theta_names¶
-
yaocptool.modelling.mixins.state_mixin module¶
-
class
StateMixin(**kwargs)[source]¶ Bases:
object-
create_state(name='x', size=1)[source]¶ Create a new state with the name “name” and size “size”. Size can be an int or a tuple (e.g. (2,2)). However, the new state will be vectorized (casadi.vec) to be included in the state vector (model.x).
Parameters: - name – str
- size – int|tuple
Returns:
-
n_x¶
-
ode¶
-
x_names¶
-