StateEquation

Class StateEquation()

StateEquation(parent='MODEL', name='StateEquation_n', label='StateEquation_n', 
active=True, use_local_xx_dll=False, use_local_xu_dll=False, use_local_yx_dll=False, 
use_local_yu_dll=False, num_outputs=0, states=0, static_hold=False, num_states=1, use_ic=False)

Creates a user subroutine based general state equation entity.

Keyword Arguments

Argument Data Type Description Default
name String The variable name. StateEquation_n, for next available integer n.
label String The descriptive label. StateEquation_n, for next available integer n.
parent Object The parent. MODEL
active Boolean Used to activate or deactivate this entity. True
use_local_xx_dll Boolean Use a local xx function when True. False
use_local_xu_dll Boolean Use a local xu function when True. False
is_use_local_yx_dll Boolean Use a local yx function when True. False
use_local_yu_dll Boolean Use a local yu function when True. False
local_xx_funcname String Local xx function name when use_local_xx_dll is True. GSEXX
local_xu_funcname String Local xu function name when use_local_xu_dll is True. GSEXU
local_yx_funcname String Local yx function name when use_local_yx_dll is True. GSEYX
local_yu_funcname String Local yu function name when use_local_yu_dll is True. GSEYU
num_outputs Int The number of outputs returned by the state equation subroutine. 0
states Double The number of discrete states. 0
static_hold Boolean Boolean to specify static hold (or not). False
num_states Int The number of continuous states. 1
use_ic Boolean Returns true if the initial condition array for continuous states is used, otherwise false. Defaults to False. * user (Bool) : Use user defined properties, if true. False
usr_sub Function The expression passed to the user dll. When using solver expressions, Templex syntax (within ``) is used and all variables are enclosed in braces {} and the rest is treated as literal. 'USER()'
local_funcname String The function/subroutine name. 'MOTSUB'
use_local_dll Bool Uses a local function instead of default if True. False
local_dll File The path of the local dll which has the local_funcname. ''
local_func_type Enum The type of the user subroutine. One of DLL, PYTHON or MATLAB. 'DLL'

Instances

ic_array_ref SolverArray The initial condition for the continuous states of the state equation.
u_array_ref SolverArray The reference to the input array that is used by the state equation.
y_array SolverArray The output array of the state equation.
x_array SolverArray The continuous states array.
xd_array SolverArray The discrete states array.

Examples

Create a State equation and modify its properties.
   >>> from hw import mview
   >>> sa = mview.SolverArray()
   >>> sa.itype
   'IC'
   >>> sa.ic_value = [3, 4, 6]
   >>> sa.ic_value
   [3.0, 4.0, 6.0]
   >>> se = mview.StateEquation()
   >>> se.u_array_ref = sa
   >>> se.u_array_ref.name
   'SolverArray_1'
   >>> se.num_outputs
   0
   >>> se.num_states
   1