System-Level Modeling

System-level modeling refers to the modeling of systems that can include both physical (for example, structural, thermal, electromagnetic, etc.) and logical systems.

This page discusses:

Logical modeling refers to a large class of modeling abstractions often encountered in engineering practice. You can designate a part of a system as using a logical modeling abstraction when most (if not all) of the geometry of the part is removed.

Because there is no geometry associated with a logical component, we refer to the inputs and outputs as signals. A signal is analogous to a field; however, it is a single scalar value and lacks geometric information. We use the term actuator to represent an incoming signal and sensor to represent an outgoing signal. The association between signals between clients is done by name referencing in the Co-Simulation Configuration file. Signals use the top-down interface as discussed in <component> Element.

The SIMULIA Co-Simulation Services support logical models defined by a Functional Mockup Unit (FMU) conforming to the Functional Mockup Interface (FMI) defined by the Modelisar organization. The SIMULIA Co-Simulation Services support the FMI 1.0 and FMI 2.0 standards. The FMU has to be of type co-simulation. For more information on the FMI standard or for a list of tools that provide the FMU file export capability, see http://fmi-standard.org.

The header file, SMACseApiSignal.h, defines additional services required to incorporate communication with logical systems. You should call these services after establishing the connection and before registering the co-simulation model.

The signal interface is serial; therefore, the client should call the function described in this section from the main process.

Creating a Signal Interface Class

Use the SMACseCreateSignalInterface function to create a signal interface class that contains all the signals. The

SMACseCreateSignalInterface takes the following arguments:

iName
Name of the signal interface class.
iPutSensorFn
Pointer to putSensorcallback function.
iUserData
Opaque pointer where you can define a user object to retrieve sensor data from your applications.

Adding Sensors to a Signal Class

Use the SMACseAddSensor function to add a sensor to the signal interface class. The SMACseAddSensor function takes the following arguments:

iHd
Signal interface handle.
iSensorName
Sensor name.

Adding an Actuator to a Signal Class

Use the SMACseAddActuator function to add an actuator to the signal interface class. The SMACseAddActuator function takes the following arguments:

iHd
Signal interface handle.
iActuatorName
Actuator name.

Registering the Signal Class

Use the SMACseRegisterSignalInterface function to register the signal interface after you have registered all sensors and actuators. The SMACseRegisterSignalInterface function takes no arguments.

Data Handling for Actuators

Use the SMACseGetActuator function to retrieve the value of an actuator. The SMACseGetActuator function takes the following arguments:

iActuatorName
Name of the actuator to retrieve its value.
iTimeStamp
Simulation time to extract the signal.
oValue
Scalar double value of the signal.

Data Handling of Sensors

The putSensorFunction is a callback function, called by the SIMULIA Co-Simulation Services, to copy the sensor data from your application to the SIMULIA Co-Simulation Services memory buffer.

The putSensorFunction function has the following arguments:

iSensorName
Sensor's name.
oValue
Scalar value of the sensor.
iUserData
Opaque pointer to user data object to retrieve sensor information.

This argument is initialized withSMACseCreateSignalInterface.

Example

The following example illustrates how to create a signal class and register sensors and actuators:

SMACseSignalInterface* signalInterfaceHd = SMACseCreateSignalInterface("Signal", myPutSensor, &solutionVars);

SMACseAddActuator(signalInterfaceHd, "Displacement at Mass 2");
SMACseAddActuator(signalInterfaceHd, "Velocity at Mass 1");
SMACseAddSensor(signalInterfaceHd,   "Compensation at Mass 1");
SMACseAddSensor(signalInterfaceHd,   "Compensation at Mass 2");
SMACseRegisterSignalInterface(signalInterfaceHd);
		              
SMACseRegisterModel();