3. OMSimulatorLib¶
This library is the core of OMSimulator and provides a C interface that can easily be utilized to handle co-simulation scenarios.
4. C-API¶
4.1. RunFile¶
Simulates a single FMU or SSP model.
oms_status_enu_t oms_RunFile(const char* filename);
4.2. activateVariant¶
This API provides support to activate a multi-variant modelling from an ssp file [(e.g). SystemStructure.ssd, VarA.ssd, VarB.ssd ] from a ssp file. By default when importing a ssp file the default variant will be “SystemStructure.ssd”. The users can be able to switch between other variants by using this API and make changes to that particular variant and simulate them.
oms_status_enu_t oms_activateVariant(const char* crefA, const char* crefB);
An example of activating the number of available variants in a ssp file
oms_newModel(“model”) oms_addSystem(“model.root”, “system_wc”) oms_addSubModel(“model.root.A”, “A.fmu”) oms_duplicateVariant(“model”, “varA”) // varA will be the current variant oms_duplicateVariant(“varA”, “varB”) // varB will be the current variant oms_activateVariant(“varB”, “varA”) // Reactivate the variant varB to varA oms_activateVariant(“varA”, “model”) // Reactivate the variant varA to model
4.3. addBus¶
Adds a bus to a given component.
oms_status_enu_t oms_addBus(const char* cref);
4.4. addConnection¶
Adds a new connection between connectors A and B. The connectors need to be specified as fully qualified component references, e.g., “model.system.component.signal”.
oms_status_enu_t oms_addConnection(const char* crefA, const char* crefB, bool suppressUnitConversion);
The two arguments crefA and crefB get swapped automatically if necessary. The third argument suppressUnitConversion is optional and the default value is false which allows automatic unit conversion between connections, if set to true then automatic unit conversion will be disabled.
4.5. addConnector¶
Adds a connector to a given component.
oms_status_enu_t oms_addConnector(const char* cref, oms_causality_enu_t causality, oms_signal_type_enu_t type);
4.6. addConnectorToBus¶
Adds a connector to a bus.
oms_status_enu_t oms_addConnectorToBus(const char* busCref, const char* connectorCref);
4.7. addResources¶
Adds an external resources to an existing SSP. The external resources should be a “.ssv” or “.ssm” file
oms_status_enu_t oms_addResources(const char* cref_, const char* path)
4.8. addSignalsToResults¶
Add all variables that match the given regex to the result file.
oms_status_enu_t oms_addSignalsToResults(const char* cref, const char* regex);
The second argument, i.e. regex, is considered as a regular expression (C++11). “.*” and “(.)*” can be used to hit all variables.
4.9. addSubModel¶
Adds a component to a system.
oms_status_enu_t oms_addSubModel(const char* cref, const char* fmuPath);
4.10. addSystem¶
Adds a (sub-)system to a model or system.
oms_status_enu_t oms_addSystem(const char* cref, oms_system_enu_t type);
4.11. compareSimulationResults¶
This function compares a given signal of two result files within absolute and relative tolerances.
int oms_compareSimulationResults(const char* filenameA, const char* filenameB, const char* var, double relTol, double absTol);
The following table describes the input values:
Input |
Type |
Description |
|---|---|---|
filenameA |
String |
Name of first result file to compare. |
filenameB |
String |
Name of second result file to compare. |
var |
String |
Name of signal to compare. |
relTol |
Number |
Relative tolerance. |
absTol |
Number |
Absolute tolerance. |
The following table describes the return values:
Type |
Description |
|---|---|
Integer |
1 if the signal is considered as equal, 0 otherwise |
4.12. copySystem¶
Copies a system.
oms_status_enu_t oms_copySystem(const char* source, const char* target);
4.13. delete¶
Deletes a connector, component, system, or model object.
oms_status_enu_t oms_delete(const char* cref);
4.14. deleteConnection¶
Deletes the connection between connectors crefA and crefB.
oms_status_enu_t oms_deleteConnection(const char* crefA, const char* crefB);
The two arguments crefA and crefB get swapped automatically if necessary.
4.15. deleteConnectorFromBus¶
Deletes a connector from a given bus.
oms_status_enu_t oms_deleteConnectorFromBus(const char* busCref, const char* connectorCref);
4.16. deleteResources¶
Deletes the reference and resource file in a SSP. Deletion of “.ssv” and “.ssm” files are currently supported. The API can be used in two ways.
deleting only the reference file in “.ssd”.
deleting both reference and resource files in “.ssp”.
To delete only the reference file in ssd, the user should provide the full qualified cref of the “.ssv” file associated with a system or subsystem or component (e.g) “model.root:root1.ssv”.
To delete both the reference and resource file in ssp, it is enough to provide only the model cref of the “.ssv” file (e.g) “model:root1.ssv”.
When deleting only the references of a “.ssv” file, if a parameter mapping file “.ssm” is binded to a “.ssv” file then the “.ssm” file will also be deleted. It is not possible to delete the references of “.ssm” seperately as the ssm file is binded to a ssv file.
The filename of the reference or resource file is provided by the users using colon suffix at the end of cref. (e.g) “:root.ssv”
oms_status_enu_t oms_deleteResources(const char* cref);
4.17. doStep¶
Simulates a macro step of the given composite model. The step size will be determined by the master algorithm and is limited by the definied minimal and maximal step sizes.
oms_status_enu_t oms_doStep(const char* cref);
4.18. duplicateVariant¶
This API provides support to develop a multi-variant modelling in OMSimulator [(e.g). SystemStructure.ssd, VarA.ssd, VarB.ssd ]. When duplicating a variant, the new variant becomes the current variant and all the changes made by the users are applied to the new variants only, and all the ssv and ssm resources associated with the new variant will be given new name based on the variant name provided by the user. This allows the bundling of multiple variants of a system structure definition referencing a similar set of packaged resources as a single SSP. However there must still be one SSD file named SystemStructure.ssd at the root of the ZIP archive which will be considered as default variant.
oms_status_enu_t oms_duplicateVariant(const char* crefA, const char* crefB);
An example of creating a multi-variant modelling is presented below
oms_newModel("model")
oms_addSystem("model.root", "system_wc")
oms_addSubModel("model.root.A", "A.fmu")
oms_setReal("model.root.A.param1", "10")
oms_duplicateVariant("model", "varB")
oms_addSubModel("varB.root.B" ,"B.fmu")
oms_setReal("varB.root.A.param2", "20")
oms_export("varB", "variant.ssp")
The variant.ssp file will have the following structure
Variant.ssp
SystemStructure.ssd
varB.ssd
resources\
A.fmu
B.fmu
4.19. export¶
Exports a composite model to a SPP file.
oms_status_enu_t oms_export(const char* cref, const char* filename);
4.20. exportDependencyGraphs¶
Export the dependency graphs of a given model to dot files.
oms_status_enu_t oms_exportDependencyGraphs(const char* cref, const char* initialization, const char* event, const char* simulation);
4.21. exportSSMTemplate¶
Exports all signals that have start values of one or multiple FMUs to a SSM file that are read from modelDescription.xml with a mapping entry. The mapping entry specifies a single mapping between a parameter in the source and a parameter of the system or component being parameterized. The mapping entry contains two attributes namely source and target. The source attribute will be empty and needs to be manually mapped by the users associated with the parameter name defined in the SSV file, the target contains the name of parameter in the system or component to be parameterized. The function can be called for a top level model or a certain FMU component. If called for a top level model, start values of all FMUs are exported to the SSM file. If called for a component, start values of just this FMU are exported to the SSM file.
oms_status_enu_t oms_exportSSMTemplate(const char* cref, const char* filename)
4.22. exportSSVTemplate¶
Exports all signals that have start values of one or multiple FMUs to a SSV file that are read from modelDescription.xml. The function can be called for a top level model or a certain FMU component. If called for a top level model, start values of all FMUs are exported to the SSV file. If called for a component, start values of just this FMU are exported to the SSV file.
oms_status_enu_t oms_exportSSVTemplate(const char* cref, const char* filename)
4.23. exportSnapshot¶
Lists the SSD representation of a given model, system, or component.
Memory is allocated for contents. The caller is responsible to free it using the C-API. The Lua and Python bindings take care of the memory and the caller doesn’t need to call free.
oms_status_enu_t oms_exportSnapshot(const char* cref, char** contents);
4.24. freeMemory¶
Free the memory allocated by some other API. Pass the object for which memory is allocated.
void oms_freeMemory(void* obj);
4.25. getBoolean¶
Get boolean value of given signal.
oms_status_enu_t oms_getBoolean(const char* cref, bool* value);
4.26. getBus¶
Gets the bus object.
oms_status_enu_t oms_getBus(const char* cref, oms_busconnector_t** busConnector);
4.27. getComponentType¶
Gets the type of the given component.
oms_status_enu_t oms_getComponentType(const char* cref, oms_component_enu_t* type);
4.28. getConnections¶
Get list of all connections from a given component.
oms_status_enu_t oms_getConnections(const char* cref, oms_connection_t*** connections);
4.29. getConnector¶
Gets the connector object of the given connector cref.
oms_status_enu_t oms_getConnector(const char* cref, oms_connector_t** connector);
4.30. getDirectionalDerivative¶
This function computes the directional derivatives of an FMU.
oms_status_enu_t oms_getDirectionalDerivative(const char* cref, double* value);
4.31. getElement¶
Get element information of a given component reference.
oms_status_enu_t oms_getElement(const char* cref, oms_element_t** element);
4.32. getElements¶
Get list of all sub-components of a given component reference.
oms_status_enu_t oms_getElements(const char* cref, oms_element_t*** elements);
4.33. getFMUInfo¶
Returns FMU specific information.
oms_status_enu_t oms_getFMUInfo(const char* cref, const oms_fmu_info_t** fmuInfo);
4.34. getFixedStepSize¶
Gets the fixed step size. Can be used for the communication step size of co-simulation systems and also for the integrator step size in model exchange systems.
oms_status_enu_t oms_getFixedStepSize(const char* cref, double* stepSize);
4.35. getInteger¶
Get integer value of given signal.
oms_status_enu_t oms_getInteger(const char* cref, int* value);
4.36. getModelState¶
Gets the model state of the given model cref.
oms_status_enu_t oms_getModelState(const char* cref, oms_modelState_enu_t* modelState);
4.37. getReal¶
Get real value.
oms_status_enu_t oms_getReal(const char* cref, double* value);
4.38. getResultFile¶
Gets the result filename and buffer size of the given model cref.
oms_status_enu_t oms_getResultFile(const char* cref, char** filename, int* bufferSize);
4.39. getSolver¶
Gets the selected solver method of the given system.
oms_status_enu_t oms_getSolver(const char* cref, oms_solver_enu_t* solver);
4.40. getStartTime¶
Get the start time from the model.
oms_status_enu_t oms_getStartTime(const char* cref, double* startTime);
4.41. getStopTime¶
Get the stop time from the model.
oms_status_enu_t oms_getStopTime(const char* cref, double* stopTime);
4.42. getString¶
Get string value.
Memory is allocated for value. The caller is responsible to free it using the C-API. The Lua and Python bindings take care of the memory and the caller doesn’t need to call free.
oms_status_enu_t oms_getString(const char* cref, char** value);
4.43. getSubModelPath¶
Returns the path of a given component.
oms_status_enu_t oms_getSubModelPath(const char* cref, char** path);
4.44. getSystemType¶
Gets the type of the given system.
oms_status_enu_t oms_getSystemType(const char* cref, oms_system_enu_t* type);
4.45. getTime¶
Get the current simulation time from the model.
oms_status_enu_t oms_getTime(const char* cref, double* time);
4.46. getTolerance¶
Gets the tolerance of a given system or component.
oms_status_enu_t oms_getTolerance(const char* cref, double* relativeTolerance);
4.47. getVariableStepSize¶
Gets the step size parameters.
oms_status_enu_t oms_getVariableStepSize(const char* cref, double* initialStepSize, double* minimumStepSize, double* maximumStepSize);
4.48. getVersion¶
Returns the library’s version string.
const char* oms_getVersion();
4.49. importFile¶
Imports a composite model from a SSP file.
oms_status_enu_t oms_importFile(const char* filename, char** cref);
4.50. importSnapshot¶
Loads a snapshot to restore a previous model state. The model must be in virgin model state, which means it must not be instantiated.
oms_status_enu_t oms_importSnapshot(const char* cref, const char* snapshot, char** newCref);
4.51. initialize¶
Initializes a composite model.
oms_status_enu_t oms_initialize(const char* cref);
4.52. instantiate¶
Instantiates a given composite model.
oms_status_enu_t oms_instantiate(const char* cref);
4.53. list¶
Lists the SSD representation of a given model, system, or component.
Memory is allocated for contents. The caller is responsible to free it using the C-API. The Lua and Python bindings take care of the memory and the caller doesn’t need to call free.
oms_status_enu_t oms_list(const char* cref, char** contents);
4.54. listUnconnectedConnectors¶
Lists all unconnected connectors of a given system.
Memory is allocated for contents. The caller is responsible to free it using the C-API. The Lua and Python bindings take care of the memory and the caller doesn’t need to call free.
oms_status_enu_t oms_listUnconnectedConnectors(const char* cref, char** contents);
4.55. listVariants¶
This API shows the number of variants available [(e.g). SystemStructure.ssd, VarA.ssd, VarB.ssd ] from a ssp file.
oms_status_enu_t oms_listVariants(const char* cref);
An example for finding the number of available variants in a ssp file
oms_newModel("model")
oms_addSystem("model.root", "system_wc")
oms_addSubModel("model.root.A", "A.fmu")
oms_duplicateVariant("model", "varA")
oms_duplicateVariant("varA", "varB")
oms_listVariants("varB")
The API will list the available variants like below
<oms:Variants>
<oms:variant name="model" />
<oms:variant name="varB" />
<oms:variant name="varA" />
</oms:Variants>
4.56. loadSnapshot¶
Loads a snapshot to restore a previous model state. The model must be in virgin model state, which means it must not be instantiated.
oms_status_enu_t oms_loadSnapshot(const char* cref, const char* snapshot, char** newCref);
4.57. newModel¶
Creates a new and yet empty composite model.
oms_status_enu_t oms_newModel(const char* cref);
4.58. newResources¶
Adds a new empty resources to the SSP. The resource file is a “.ssv” file where the parameter values set by the users using “oms_setReal()”, “oms_setInteger()” and “oms_setReal()” are writtern to the file. Currently only “.ssv” files can be created.
The filename of the resource file is provided by the users using colon suffix at the end of cref. (e.g) “:root.ssv”
oms_status_enu_t oms_newResources(const char* cref)
4.59. referenceResources¶
Switches the references of “.ssv” and “.ssm” in a SSP file. Referencing of “.ssv” and “.ssm” files are currently supported. The API can be used in two ways.
Referencing only the “.ssv” file.
Referencing both the “.ssv” along with the “.ssm” file.
This API should be used in combination with “oms_deleteResources”.To switch with a new reference, the old reference must be deleted first using “oms_deleteResources” and then reference with new resources.
When deleting only the references of a “.ssv” file, if a parameter mapping file “.ssm” is binded to a “.ssv” file, then the reference of “.ssm” file will also be deleted. It is not possible to delete the references of “.ssm” seperately as the ssm file is binded to a ssv file. Hence it is not possible to switch the reference of “.ssm” file alone. So inorder to switch the reference of “.ssm” file, the users need to bind the reference of “.ssm” file along with the “.ssv”.
The filename of the reference or resource file is provided by the users using colon suffix at the end of cref (e.g) “:root.ssv”, and the “.ssm” file is optional and is provided by the user as the second argument to the API.
oms_status_enu_t oms_referenceResources(const char* cref, const char* ssmFile);
4.60. removeSignalsFromResults¶
Removes all variables that match the given regex to the result file.
oms_status_enu_t oms_removeSignalsFromResults(const char* cref, const char* regex);
The second argument, i.e. regex, is considered as a regular expression (C++11). “.*” and “(.)*” can be used to hit all variables.
4.61. rename¶
Renames a model, system, or component.
oms_status_enu_t oms_rename(const char* cref, const char* newCref);
4.62. replaceSubModel¶
Replaces an existing fmu component, with a new component provided by the user, When replacing the fmu checks are made in all ssp concepts like in ssd, ssv and ssm, so that connections and parameter settings are not lost. It is possible that the namings of inputs and parameters match, but the start values might have been changed, in such cases new start values will be applied in ssd, ssv and ssm. In case if the Types of inputs and outputs and parameters differed, then the variables are updated according to the new changes and the connections will be removed with warning messages to user. In case when replacing a fmu, if the fmu contains parameter mapping associated with the ssv file, then only the ssm file entries are updated and the start values in the ssv files will not be changed.
oms_status_enu_t oms_replaceSubModel(const char* cref, const char* fmuPath);
It is possible to import an partially developed fmu (i.e contains only modeldescription.xml without any binaries) in OMSimulator, and later can be replaced with a fully develped fmu. An example to use the API, oms_addSubModel(“model.root.A”, “../resources/replaceA.fmu”) oms_export(“model”, “test.ssp”) oms_import(“test.ssp”) oms_replaceSubModel(“model.root.A”, “../resources/replaceA_extended.fmu”)
4.63. reset¶
Reset the composite model after a simulation run.
The FMUs go into the same state as after instantiation.
oms_status_enu_t oms_reset(const char* cref);
4.64. setActivationRatio¶
Experimental feature for setting the activation ratio of FMUs for experimenting with multi-rate master algorithms.
oms_status_enu_t experimental_setActivationRatio(const char* cref, int k);
4.65. setBoolean¶
Sets the value of a given boolean signal.
oms_status_enu_t oms_setBoolean(const char* cref, bool value);
4.66. setBusGeometry¶
oms_status_enu_t oms_setBusGeometry(const char* bus, const ssd_connector_geometry_t* geometry);
4.67. setCommandLineOption¶
Sets special flags.
oms_status_enu_t oms_setCommandLineOption(const char* cmd);
Available flags:
info: Usage: OMSimulator [Options] [Lua script] [FMU] [SSP file]
Options:
--addParametersToCSV=<bool> false Export parameters to a .csv file
--algLoopSolver=<arg> "kinsol" Specifies the loop solver method (fixedpoint, kinsol) used for algebraic loops spanning multiple components.
--clearAllOptions Reset all flags to their default values
--CVODEMaxErrTestFails=<int> 100 Maximum number of error test failures for CVODE
--CVODEMaxNLSFailures=<int> 100 Maximum number of nonlinear convergence failures for CVODE
--CVODEMaxNLSIterations=<int> 5 Maximum number of nonlinear solver iterations for CVODE
--CVODEMaxSteps=<int> 1000 Maximum number of steps for CVODE
--deleteTempFiles=<bool> true Delete temporary files as soon as they are no longer needed
--directionalDerivatives=<bool> true Use directional derivatives to calculate the Jacobian for algebraic loops
--dumpAlgLoops=<bool> false Dump information for algebraic loops
--emitEvents=<bool> true Emit events during simulation
--help [-h] Display the help text
--ignoreInitialUnknowns=<bool> false Ignore initial unknowns from the modelDescription.xml
--initialStepSize=<double> 1e-6 Specify the initial step size
--inputExtrapolation=<bool> false Enable input extrapolation using derivative information
--intervals=<int> [-i] 500 Specify the number of communication points (arg > 1)
--logFile=<arg> [-l] "" Specify the log file (stdout is used if no log file is specified)
--logLevel=<int> 0 Set the log level (0: default, 1: debug, 2: debug+trace)
--master=<arg> "ma" Specify the master algorithm (ma)
--maxEventIteration=<int> 100 Specify the maximum number of iterations for handling a single event
--maxLoopIteration=<int> 10 Specify the maximum number of iterations for solving algebraic loops between system-level components. Internal algebraic loops of components are not affected.
--minimumStepSize=<double> 1e-12 Specify the minimum step size
--mode=<arg> [-m] "me" Force a certain FMI mode if the FMU provides both cs and me (cs, me)
--numProcs=<int> [-n] 1 Specify the maximum number of processors to use (0=auto, 1=default)
--progressBar=<bool> false Show a progress bar for the simulation progress in the terminal
--realTime=<bool> false Enable experimental feature for (soft) real-time co-simulation
--resultFile=<arg> [-r] "<default>" Specify the name of the output result file
--skipCSVHeader=<bool> true Skip exporting the CSV delimiter in the header
--solver=<arg> "cvode" Specify the integration method (euler, cvode)
--solverStats=<bool> false Add solver stats to the result file, e.g., step size; not supported for all solvers
--startTime=<double> [-s] 0 Specify the start time
--stepSize=<double> 1e-3 Specify the (maximum) step size
--stopTime=<double> [-t] 1 Specify the stop time
--stripRoot=<bool> false Remove the root system prefix from all exported signals
--suppressPath=<bool> false Suppress path information in info messages; especially useful for testing
--tempDir=<arg> "." Specify the temporary directory
--timeout=<int> 0 Specify the maximum allowed time in seconds for running a simulation (0 disables)
--tolerance=<double> 1e-4 Specify the relative tolerance
--version [-v] Display version information
--wallTime=<bool> false Add wall time information to the result file
--workingDir=<arg> "." Specify the working directory
--zeroNominal=<bool> false Accept FMUs with invalid nominal values and replace the invalid nominal values with 1.0
4.68. setConnectionGeometry¶
oms_status_enu_t oms_setConnectionGeometry(const char* crefA, const char* crefB, const ssd_connection_geometry_t* geometry);
4.69. setConnectorGeometry¶
Set geometry information to a given connector.
oms_status_enu_t oms_setConnectorGeometry(const char* cref, const ssd_connector_geometry_t* geometry);
4.70. setElementGeometry¶
Set geometry information to a given component.
oms_status_enu_t oms_setElementGeometry(const char* cref, const ssd_element_geometry_t* geometry);
4.71. setFixedStepSize¶
Sets the fixed step size. Can be used for the communication step size of co-simulation systems and also for the integrator step size in model exchange systems.
oms_status_enu_t oms_setFixedStepSize(const char* cref, double stepSize);
4.72. setInteger¶
Sets the value of a given integer signal.
oms_status_enu_t oms_setInteger(const char* cref, int value);
4.73. setLogFile¶
Redirects logging output to file or std streams. The warning/error counters are reset.
filename=”” to redirect to std streams and proper filename to redirect to file.
oms_status_enu_t oms_setLogFile(const char* filename);
4.74. setLoggingCallback¶
Sets a callback function for the logging system.
void oms_setLoggingCallback(void (*cb)(oms_message_type_enu_t type, const char* message));
4.75. setLoggingInterval¶
Set the logging interval of the simulation.
oms_status_enu_t oms_setLoggingInterval(const char* cref, double loggingInterval);
4.76. setLoggingLevel¶
Enables/Disables debug logging (logDebug and logTrace).
0 default, 1 default+debug, 2 default+debug+trace
void oms_setLoggingLevel(int logLevel);
4.77. setMaxLogFileSize¶
Sets maximum log file size in MB. If the file exceeds this limit, the logging will continue on stdout.
void oms_setMaxLogFileSize(const unsigned long size);
4.78. setReal¶
Sets the value of a given real signal.
oms_status_enu_t oms_setReal(const char* cref, double value);
This function can be called in different model states:
Before instantiation: setReal can be used to set start values or to define initial unknowns (e.g. parameters, states). The values are not immediately applied to the simulation unit, since it isn’t actually instantiated.
After instantiation and before initialization: Same as before instantiation, but the values are applied immediately to the simulation unit.
After initialization: Can be used to force external inputs, which might cause discrete changes of continuous signals.
4.79. setRealInputDerivative¶
Sets the first order derivative of a real input signal.
This can only be used for CS-FMU real input signals.
oms_status_enu_t oms_setRealInputDerivative(const char* cref, double value);
4.80. setResultFile¶
Set the result file of the simulation.
oms_status_enu_t oms_setResultFile(const char* cref, const char* filename, int bufferSize);
The creation of a result file is omitted if the filename is an empty string.
4.81. setSolver¶
Sets the solver method for the given system.
oms_status_enu_t oms_setSolver(const char* cref, oms_solver_enu_t solver);
4.82. setStartTime¶
Set the start time of the simulation.
oms_status_enu_t oms_setStartTime(const char* cref, double startTime);
4.83. setStopTime¶
Set the stop time of the simulation.
oms_status_enu_t oms_setStopTime(const char* cref, double stopTime);
4.84. setString¶
Sets the value of a given string signal.
oms_status_enu_t oms_setString(const char* cref, const char* value);
4.85. setTempDirectory¶
Set new temp directory.
oms_status_enu_t oms_setTempDirectory(const char* newTempDir);
4.86. setTolerance¶
Sets the tolerance for a given model or system.
oms_status_enu_t oms_setTolerance(const char* cref, double relativeTolerance);
Default values are 1e-4 for both relative and absolute tolerances.
A tolerance specified for a model is automatically applied to its root system, i.e. both calls do exactly the same:
oms_setTolerance("model", relativeTolerance);
oms_setTolerance("model.root", relativeTolerance);
Component, e.g. FMUs, pick up the tolerances from there system. That means it is not possible to define different tolerances for FMUs in the same system right now.
In a strongly coupled system (oms_system_sc), the relative tolerance is used for CVODE and the absolute tolerance is used to solve algebraic loops.
In a weakly coupled system (oms_system_wc), both the relative and absolute tolerances are used for the adaptive step master algorithms and the absolute tolerance is used to solve algebraic loops.
4.87. setUnit¶
Sets the unit of a given signal.
oms_status_enu_t oms_setUnit(const char* cref, const char* value);
4.88. setVariableStepSize¶
Sets the step size parameters for methods with stepsize control.
oms_status_enu_t oms_getVariableStepSize(const char* cref, double* initialStepSize, double* minimumStepSize, double* maximumStepSize);
4.89. setWorkingDirectory¶
Set a new working directory.
oms_status_enu_t oms_setWorkingDirectory(const char* newWorkingDir);
4.90. simulate¶
Simulates a composite model.
oms_status_enu_t oms_simulate(const char* cref);
4.91. simulate_realtime¶
Experimental feature for (soft) real-time simulation.
oms_status_enu_t experimental_simulate_realtime(const char* ident);
4.92. stepUntil¶
Simulates a composite model until a given time value.
oms_status_enu_t oms_stepUntil(const char* cref, double stopTime);
4.93. terminate¶
Terminates a given composite model.
oms_status_enu_t oms_terminate(const char* cref);