FMU (Functional Mock-up Unit) is an abstract modeling element that
defines a generic modeling element in MotionSolve.
Description
A standard, tool-independent interface, the Functional Mock-up Interface (FMI)
defines the interface for accessing and depositing data into the
FMU. It support models using a combination of XML files and
compiled C-code.
MotionSolve uses the FMI to import one or more
FMUs into a system model, connecting these to other modeling
components and generating the combined model for a solution.
See the Comments section of Control:
FMU
Attribute Summary
Name |
Property |
Modifiable by command? |
Designable? |
id |
Int () |
No |
No |
label |
Str () |
type |
Enum () |
path |
FileName () |
x |
Reference (Array) |
y |
Reference (Array) |
u |
Reference (Array) |
ic |
Reference (Array) |
static_hold |
Bool () |
dll |
FileName |
interval |
Double () |
ip_address |
Str () |
var_name |
Str () |
var_ic |
Double () |
Usage
Fmu(
path = "mefmu_siso_cs.fmu",
type = "CS",
x = array_x,
y = array_y,
u = array_u,
ip_addr = "localhost"
)
Attributes
- id
- Integer
- Element identification number. This number is unique among all
FMUs.
- label
- String
- The “short” name for the FMU element.
- type
- String
- Type of FMU. Choose between “CS”
(CoSimulation) or “ME” (ModelExchange)
- path
- FileName
- The path to the FMU file.
- x
- Reference(Array)
- Specifies the Reference_Array used to store the
continuous states, x, of this
FMU.
- You can use the ARYVAL() function with its ID to
access the states in a MotionSolve expression. You can
also use its ID in SYSFNC and
SYSARY to access the states from a user
subroutine.
- y
- Reference(Array)
- Specifies the Reference_Array used to store the
output, y, of this FMU.
- You can use the ARYVAL() function with its ID to
access the outputs in a MotionSolve expression. You can
also use its ID in SYSFNC and
SYSARY to access the outputs from a user
subroutine.
- u
- Reference(Array)
- Specifies the Reference_Array used to store the input
u of this FMU.
- You can use the ARYVAL() function with this ID to
access the inputs in a MotionSolve expression. You can
also use this ID in SYSFNC and
SYSARY to access the inputs from a user
subroutine.
- ic
- Reference(Array)
- Specifies the Reference_Array used to store the
initial conditions for the continuous states of this
FMU.
- You can use the ARYVAL() function with its ID to
access the ICs in a MotionSolve expression. You can also
use its ID in SYSFNC and SYSARY to
access the IC values from a user subroutine.
- static_hold
- Boolean
- A flag for indicating whether the value of dynamic state is kept
constant during static or quasi-static simulations. It is only
applicable to Model-Exchange FMUs.
- See Comment 8 of the Control: FMU for more
details.
- dll
- String
- Specifies the path and name of the DLL or shared library that will be
used to load the user’s FMU. MotionSolve uses this information to load the user subroutine
in the DLL at run time.
- interval
- Double
- The time interval between successive communications with the
FMU. FMU outputs are
interpolated for all other calls.
- Default: HMAX, the maximum step size defined for the simulation
by the simulation control parameters
- ip_address
- String
- IP address for the FMU connecting to MotionSolve.
A pipe is used as the means for inter-process communication when
MotionSolve and the FMU reside on
the same machine. When MotionSolve and the
FMU reside on different machines, specify the
actual IP address as a string.
- See Comment 6 in Control: FMU for more
information.
- var_name
- String
- String that lists the name of each variable inside
FMU that can be assigned a value.
- Values delimited by “;” (semicolon)
- Default: “”
- var_ic
- String
- String that lists the value for each variable defined by
“var_name” that needs to be set by the user.
- Values delimited by “;” (semicolon)
- Default: “”
Example
x = Array(label="States", type="x")
y = Array(label="Outputs", type="y")
u = Array(label="Inputs", type="u", size=1)
u. variables = Variable(
label = "u[0]",
function = "-wz(30102010)+varval(30100100)"
)
fmu = Fmu(
path = "Hydraulic_Valve.fmu",
type = "ME",
x = x,
y = y,
u = u,
ip_address = "PIPE")
Comments
- See Properties for an
explanation about what properties are, why they are used, and how you can
extend these.
- For a more detailed explanation about FMU, see
the Model Statement Control: FMU.