FMIImport.lk_fmi2FreeInstance
— Constantfmi2FreeInstance!(c::FMU2Component; popComponent::Bool = true)
Disposes the given instance, unloads the loaded model, and frees all the allocated memory and other resources that have been allocated by the functions of the FMU interface. If a null pointer is provided for “c”, the function call is ignored (does not have an effect).
Removes the component from the FMUs component list.
Arguments
c::FMU2Component
: Mutable struct represents an instantiated instance of an FMU in the FMI 2.0.2 Standard.
Returns
- nothing
Source
- FMISpec2.0.2 Link: https://fmi-standard.org/
- FMISpec2.0.2[p.22]: 2.1.5 Creation, Destruction and Logging of FMU Instances
- FMISpec2.0.2[p.16]: 2.1.2 Platform Dependent Definitions
See Also fmi2FreeInstance!
.
FMIBase.getValue
— MethodgetValue(solution::FMU2Solution, i::fmi2ValueReferenceFormat; isIndex::Bool=false)
Returns the values for a given value reference i
(for isIndex=false
) or the i-th value (for isIndex=true
). Recording of values must be enabled.
FMICore.fmi2CancelStep
— Methodfmi2CancelStep(c::FMU2Component)
Can be called if fmi2DoStep
returned fmi2Pending
in order to stop the current asynchronous execution.
Arguments
c::FMU2Component
: Mutable struct represents an instantiated instance of an FMU in the FMI 2.0.2 Standard.
Returns
status::fmi2Status
: Returnstatus
is an enumeration of typefmi2Status
and indicates the success of the function call.
More detailed:
fmi2OK
: all wellfmi2Warning
: things are not quite right, but the computation can continuefmi2Discard
: if the slave computed successfully only a subinterval of the communication stepfmi2Error
: the communication step could not be carried out at allfmi2Fatal
: if an error occurred which corrupted the FMU irreparablyfmi2Pending
: this status is returned if the slave executes the function asynchronously
Source
- FMISpec2.0.2 Link: https://fmi-standard.org/
- FMISpec2.0.2[p.16]: 2.1.2 Platform Dependent Definitions (fmi2TypesPlatform.h)
- FMISpec2.0.2[p.16]: 2.1.3 Status Returned by Functions
- FMISpec2.0.2[p.104]: 4.2.2 Computation
See also fmi2DoStep
.
FMICore.fmi2CompletedIntegratorStep!
— Methodfmi2CompletedIntegratorStep!(c::FMU2Component,
noSetFMUStatePriorToCurrentPoint::fmi2Boolean,
enterEventMode::Ptr{fmi2Boolean},
terminateSimulation::Ptr{fmi2Boolean})
This function must be called by the environment after every completed step of the integrator provided the capability flag completedIntegratorStepNotNeeded = false.
Arguments
c::FMU2Component
: Mutable struct represents an instantiated instance of an FMU in the FMI 2.0.2 Standard.noSetFMUStatePriorToCurrentPoint::fmi2Boolean
: ArgumentnoSetFMUStatePriorToCurrentPoint = fmi2True
iffmi2SetFMUState
will no longer be called for time instants prior to current time in this simulation run.enterEventMode::Ref{fmi2Boolean}
: ArgumententerEventMode
points to the return value (fmi2Boolean) which signals to the environment if the FMU shall callfmi2EnterEventMode
.fmi2Boolean
is an alias type forBoolean
data type.terminateSimulation::Ref{fmi2Boolean}
: ArgumentterminateSimulation
points to the return value (fmi2Boolean) which signals signal if the simulation shall be terminated.fmi2Boolean
is an alias type forBoolean
data type.
Returns
status::fmi2Status
: Returnstatus
is an enumeration of typefmi2Status
and indicates the success of the function call.
More detailed:
fmi2OK
: all wellfmi2Warning
: things are not quite right, but the computation can continuefmi2Discard
: if the slave computed successfully only a subinterval of the communication stepfmi2Error
: the communication step could not be carried out at allfmi2Fatal
: if an error occurred which corrupted the FMU irreparablyfmi2Pending
: this status is returned if the slave executes the function asynchronously
Source
- FMISpec2.0.2 Link: https://fmi-standard.org/
- FMISpec2.0.2[p.16]: 2.1.2 Platform Dependent Definitions (fmi2TypesPlatform.h)
- FMISpec2.0.2[p.16]: 2.1.3 Status Returned by Functions
- FMISpec2.0.2[p.83]: 3.2.2 Evaluation of Model Equations
See also fmi2CompletedIntegratorStep!
.
FMICore.fmi2DeSerializeFMUstate!
— Methodfmi2DeSerializeFMUstate!(c::FMU2Component, serializedState::AbstractArray{fmi2Byte}, size::Csize_t, FMUstate::Ref{fmi2FMUstate})
Deserializes the byte vector serializedState of length size, constructs a copy of the FMU state and stores the FMU state in the given address of the reference FMUstate
, the pointer to this copy.
Arguments
str::FMU2Component
: Mutable struct represents an instantiated instance of an FMU in the FMI 2.0.2 Standard.state::fmi2FMUstate
: Argumentstate
is a pointer to a data structure in the FMU that saves the internal FMU state of the actual or a previous time instant.serialzedState::AbstractArray{fmi2Byte}
: ArgumentserializedState
contains the copy of the serialized data referenced by the pointer FMUstate.size::Csize_t
: Argumentsize
defines the length of the serialized vector.FMUstate::Ref{fmi2FMUstate}
: ArgumentFMUstate
is an object that safely references data of typefmi3FMUstate
which is a pointer to a data structure in the FMU that saves the internal FMU state of the actual or a previous time instant.
Returns
status::fmi2Status
: Returnstatus
is an enumeration of typefmi2Status
and indicates the success of the function call.
More detailed:
fmi2OK
: all wellfmi2Warning
: things are not quite right, but the computation can continuefmi2Discard
: if the slave computed successfully only a subinterval of the communication stepfmi2Error
: the communication step could not be carried out at allfmi2Fatal
: if an error occurred which corrupted the FMU irreparablyfmi2Pending
: this status is returned if the slave executes the function asynchronously
Source
- FMISpec2.0.2 Link: https://fmi-standard.org/
- FMISpec2.0.2[p.16]: 2.1.2 Platform Dependent Definitions (fmi2TypesPlatform.h)
- FMISpec2.0.2[p.16]: 2.1.3 Status Returned by Functions
- FMISpec2.0.2[p.25]: 2.1.8 Getting and Setting the Complete FMU State
See also fmi2DeSerializeFMUstate!
.
FMICore.fmi2DoStep
— Functionfmi2DoStep(c::FMU2Component,
communicationStepSize::Union{Real, Nothing} = nothing;
currentCommunicationPoint::Union{Real, Nothing} = nothing,
noSetFMUStatePriorToCurrentPoint::Bool = true)
Does one step in the CoSimulation FMU
Arguments
C::FMU2Component
: Mutable struct represents an instantiated instance of an FMU in the FMI 2.0.2 Standard.communicationStepSize::Union{Real, Nothing} = nothing
: ArgumentcommunicationStepSize
contains a value of typeReal
orNothing
, if no argument is passed the default valuenothing
is used.communicationStepSize
defines the communiction step size.
Keywords
currentCommunicationPoint::Union{Real, Nothing} = nothing
: ArgumentcurrentCommunicationPoint
contains a value of typeReal
or typeNothing
. If no argument is passed the default valuenothing
is used.currentCommunicationPoint
defines the current communication point of the master.noSetFMUStatePriorToCurrentPoint::Bool = true
: ArgumentnoSetFMUStatePriorToCurrentPoint
contains a value of typeBoolean
. If no argument is passed the default valuetrue
is used.noSetFMUStatePriorToCurrentPoint
indicates whetherfmi2SetFMUState
is no longer called for times before thecurrentCommunicationPoint
in this simulation run Simulation run.
Returns
status::fmi2Status
: Returnstatus
is an enumeration of typefmi2Status
and indicates the success of the function call.
More detailed:
fmi2OK
: all wellfmi2Warning
: things are not quite right, but the computation can continuefmi2Discard
: if the slave computed successfully only a subinterval of the communication stepfmi2Error
: the communication step could not be carried out at allfmi2Fatal
: if an error occurred which corrupted the FMU irreparablyfmi2Pending
: this status is returned if the slave executes the function asynchronously
Source
- FMISpec2.0.2 Link: https://fmi-standard.org/
- FMISpec2.0.2[p.16]: 2.1.2 Platform Dependent Definitions (fmi2TypesPlatform.h)
- FMISpec2.0.2[p.16]: 2.1.3 Status Returned by Functions
- FMISpec2.0.2[p.104]: 4.2.2 Computation
See also fmi2DoStep
.
FMICore.fmi2DoStep
— Methodfmi2DoStep(c::FMU2Component,
currentCommunicationPoint::fmi2Real,
communicationStepSize::fmi2Real,
noSetFMUStatePriorToCurrentPoint::fmi2Boolean)
The computation of a time step is started.
Arguments
c::FMU2Component
: Mutable struct represents an instantiated instance of an FMU in the FMI 2.0.2 Standard.currentCommunicationPoint::fmi2Real
: ArgumentcurrentCommunicationPoint
contains a value of typefmi2Real
which is a identifier for a variable value .currentCommunicationPoint
defines the current communication point of the master.communicationStepSize::fmi2Real
: ArgumentcommunicationStepSize
contains a value of typefmi2Real
which is a identifier for a variable value.communicationStepSize
defines the communiction step size.
noSetFMUStatePriorToCurrentPoint::Bool = true
: Argument noSetFMUStatePriorToCurrentPoint
contains a value of type Boolean
. If no argument is passed the default value true
is used. noSetFMUStatePriorToCurrentPoint
indicates whether fmi2SetFMUState
is no longer called for times before the currentCommunicationPoint
in this simulation run Simulation run.
Returns
status::fmi2Status
: Returnstatus
is an enumeration of typefmi2Status
and indicates the success of the function call.
More detailed:
fmi2OK
: all wellfmi2Warning
: things are not quite right, but the computation can continuefmi2Discard
: if the slave computed successfully only a subinterval of the communication stepfmi2Error
: the communication step could not be carried out at allfmi2Fatal
: if an error occurred which corrupted the FMU irreparablyfmi2Pending
: this status is returned if the slave executes the function asynchronously
Source
- FMISpec2.0.2 Link: https://fmi-standard.org/
- FMISpec2.0.2[p.16]: 2.1.2 Platform Dependent Definitions (fmi2TypesPlatform.h)
- FMISpec2.0.2[p.16]: 2.1.3 Status Returned by Functions
- FMISpec2.0.2[p.104]: 4.2.2 Computation
See also fmi2DoStep
.
FMICore.fmi2EnterContinuousTimeMode
— Methodfmi2EnterContinuousTimeMode(c::FMU2Component; soft::Bool=false)
The model enters Continuous-Time Mode and all discrete-time equations become inactive and all relations are “frozen”. This function has to be called when changing from Event Mode (after the global event iteration in Event Mode over all involved FMUs and other models has converged) into Continuous-Time Mode.
Arguments
c::FMU2Component
: Mutable struct represents an instantiated instance of an FMU in the FMI 2.0.2 Standard.
Keywords
soft::Bool=false
: If the Keywordsoft = true
the command is only performed if the FMU is in an allowed state for this command.
Returns
status::fmi2Status
: Returnstatus
is an enumeration of typefmi2Status
and indicates the success of the function call.
More detailed:
fmi2OK
: all wellfmi2Warning
: things are not quite right, but the computation can continuefmi2Discard
: if the slave computed successfully only a subinterval of the communication stepfmi2Error
: the communication step could not be carried out at allfmi2Fatal
: if an error occurred which corrupted the FMU irreparablyfmi2Pending
: this status is returned if the slave executes the function asynchronously
Source
- FMISpec2.0.2 Link: https://fmi-standard.org/
- FMISpec2.0.2[p.16]: 2.1.2 Platform Dependent Definitions (fmi2TypesPlatform.h)
- FMISpec2.0.2[p.16]: 2.1.3 Status Returned by Functions
- FMISpec2.0.2[p.83]: 3.2.2 Evaluation of Model Equations
See also fmi2EnterContinuousTimeMode
.
FMICore.fmi2EnterEventMode
— Methodfmi2EnterEventMode(c::FMU2Component; soft::Bool=false)
The model enters Event Mode from the Continuous-Time Mode and discrete-time equations may become active (and relations are not “frozen”).
Arguments
c::FMU2Component
: Mutable struct represents an instantiated instance of an FMU in the FMI 2.0.2 Standard.
Keywords
soft::Bool=false
: If the Keywordsoft = true
the command is only performed if the FMU is in an allowed state for this command.
Returns
status::fmi2Status
: Returnstatus
is an enumeration of typefmi2Status
and indicates the success of the function call.
More detailed:
fmi2OK
: all wellfmi2Warning
: things are not quite right, but the computation can continuefmi2Discard
: if the slave computed successfully only a subinterval of the communication stepfmi2Error
: the communication step could not be carried out at allfmi2Fatal
: if an error occurred which corrupted the FMU irreparablyfmi2Pending
: this status is returned if the slave executes the function asynchronously
Source
- FMISpec2.0.2 Link: https://fmi-standard.org/
- FMISpec2.0.2[p.16]: 2.1.2 Platform Dependent Definitions (fmi2TypesPlatform.h)
- FMISpec2.0.2[p.16]: 2.1.3 Status Returned by Functions
- FMISpec2.0.2[p.83]: 3.2.2 Evaluation of Model Equations
See also fmi2EnterEventMode
.
FMICore.fmi2EnterInitializationMode
— Methodfmi2EnterInitializationMode(c::FMU2Component)
Informs the FMU to enter Initialization Mode. Before calling this function, all variables with attribute <ScalarVariable initial = "exact" or "approx"> can be set with the “fmi2SetXXX” functions (the ScalarVariable attributes are defined in the Model Description File, see section 2.2.7). Setting other variables is not allowed. Furthermore, fmi2SetupExperiment
must be called at least once before calling fmi2EnterInitializationMode
, in order that startTime
is defined.
Arguments
c::FMU2Component
: Argumentc
is a Mutable struct represents an instantiated instance of an FMU in the FMI 2.0.2 Standard.
Returns
status::fmi2Status
: Returnstatus
is an enumeration of typefmi2Status
and indicates the success of the function call.
More detailed:
fmi2OK
: all wellfmi2Warning
: things are not quite right, but the computation can continuefmi2Discard
: if the slave computed successfully only a subinterval of the communication stepfmi2Error
: the communication step could not be carried out at allfmi2Fatal
: if an error occurred which corrupted the FMU irreparablyfmi2Pending
: this status is returned if the slave executes the function asynchronously
Source
- FMISpec2.0.2 Link: https://fmi-standard.org/
- FMISpec2.0.2[p.22]: 2.1.2 Platform Dependent Definitions (fmi2TypesPlatform.h)
- FMISpec2.0.2[p.22]: 2.1.3 Status Returned by Functions
- FMISpec2.0.2[p.22]: 2.1.6 Initialization, Termination, and Resetting an FMU
See also fmi2EnterInitializationMode
.
FMICore.fmi2ExitInitializationMode
— Methodfmi2ExitInitializationMode(c::FMU2Component)
Informs the FMU to exit Initialization Mode.
Arguments
c::FMU2Component
: Argumentc
is a Mutable struct represents an instantiated instance of an FMU in the FMI 2.0.2 Standard.
Returns
status::fmi2Status
: Returnstatus
is an enumeration of typefmi2Status
and indicates the success of the function call.
More detailed:
fmi2OK
: all wellfmi2Warning
: things are not quite right, but the computation can continuefmi2Discard
: if the slave computed successfully only a subinterval of the communication stepfmi2Error
: the communication step could not be carried out at allfmi2Fatal
: if an error occurred which corrupted the FMU irreparablyfmi2Pending
: this status is returned if the slave executes the function asynchronously
Source
- FMISpec2.0.2 Link: https://fmi-standard.org/
- FMISpec2.0.2[p.22]: 2.1.2 Platform Dependent Definitions (fmi2TypesPlatform.h)
- FMISpec2.0.2[p.22]: 2.1.3 Status Returned by Functions
- FMISpec2.0.2[p.22]: 2.1.6 Initialization, Termination, and Resetting an FMU
See also fmi2EnterInitializationMode
.
FMICore.fmi2FreeFMUstate
— Methodfmi2FreeFMUstate!(c::FMU2Component, state::fmi2FMUstate)
Free the memory for the allocated FMU state
Arguments
c::FMU2Component
: Mutable struct represents an instantiated instance of an FMU in the FMI 2.0.2 Standard.state::fmi2FMUstate
: Argumentstate
is a pointer to a data structure in the FMU that saves the internal FMU state of the actual or a previous time instant.
Returns
- Return singleton instance of type
Nothing
, if there is no value to return (as in a C void function) or when a variable or field holds no value.
Source
- FMISpec2.0.2 Link: https://fmi-standard.org/
- FMISpec2.0.2[p.16]: 2.1.2 Platform Dependent Definitions (fmi2TypesPlatform.h)
- FMISpec2.0.2[p.16]: 2.1.3 Status Returned by Functions
- FMISpec2.0.2[p.25]: 2.1.8 Getting and Setting the Complete FMU State
See also fmi2FreeFMUstate!
.
FMICore.fmi2FreeFMUstate
— Methodfmi2FreeFMUstate(c::FMU2Component, FMUstate::Ref{fmi2FMUstate})
Frees all memory and other resources allocated with the fmi2GetFMUstate call for this FMUstate.
Arguments
c::FMU2Component
: Mutable struct represents an instantiated instance of an FMU in the FMI 2.0.2 Standard.FMUstate::Ref{fmi2FMUstate}
: ArgumentFMUstate
is an object that safely references data of typefmi3FMUstate
which is a pointer to a data structure in the FMU that saves the internal FMU state of the actual or a previous time instant.
Returns
status::fmi2Status
: Returnstatus
is an enumeration of typefmi2Status
and indicates the success of the function call.
More detailed:
fmi2OK
: all wellfmi2Warning
: things are not quite right, but the computation can continuefmi2Discard
: if the slave computed successfully only a subinterval of the communication stepfmi2Error
: the communication step could not be carried out at allfmi2Fatal
: if an error occurred which corrupted the FMU irreparablyfmi2Pending
: this status is returned if the slave executes the function asynchronously
Source
- FMISpec2.0.2 Link: https://fmi-standard.org/
- FMISpec2.0.2[p.16]: 2.1.2 Platform Dependent Definitions (fmi2TypesPlatform.h)
- FMISpec2.0.2[p.16]: 2.1.3 Status Returned by Functions
- FMISpec2.0.2[p.25]: 2.1.8 Getting and Setting the Complete FMU State
See also fmi2FreeFMUstate!
.
FMICore.fmi2GetBoolean!
— Methodfmi2GetBoolean!(c::FMU2Component, vr::AbstractArray{fmi2ValueReference}, nvr::Csize_t, value::AbstractArray{fmi2Boolean})
Writes the boolean values of an array of variables in the given field
fmi2GetBoolean! is only possible for arrays of values, please use an array instead of a scalar.
Arguments
c::FMU2Component
: Mutable struct represents an instantiated instance of an FMU in the FMI 2.0.2 Standard.vr::AbstractArray{fmi2ValueReference}
: Argumentvr
is an AbstractArray ofnvr
value handels called "ValueReference" that define the variable that shall be inquired.nvr::Csize_t
: Argumentnvr
defines the size ofvr
.value::AbstractArray{fmi2Boolean}
: Argumentvalues
is an array with the actual values of these variables.
Returns
status::fmi2Status
: Returnstatus
is an enumeration of typefmi2Status
and indicates the success of the function call.
More detailed:
fmi2OK
: all wellfmi2Warning
: things are not quite right, but the computation can continuefmi2Discard
: if the slave computed successfully only a subinterval of the communication stepfmi2Error
: the communication step could not be carried out at allfmi2Fatal
: if an error occurred which corrupted the FMU irreparablyfmi2Pending
: this status is returned if the slave executes the function asynchronously
Source
- FMISpec2.0.2 Link: https://fmi-standard.org/
- FMISpec2.0.2[p.24]: 2.1.7 Getting and Setting Variable Values
- FMISpec2.0.2[p.16]: 2.1.2 Platform Dependent Definitions
- FMISpec2.0.2[p.18]: 2.1.3 Status Returned by Functions
See also fmi2GetBoolean!
.
FMICore.fmi2GetBoolean!
— Methodfmi2GetBoolean!(c::FMU2Component, vr::fmi2ValueReferenceFormat, values::AbstractArray{fmi2Boolean})
Writes the boolean values of an array of variables in the given field
fmi2GetBoolean! is only possible for arrays of values, please use an array instead of a scalar.
Arguments
str::fmi2Struct
: Representative for an FMU in the FMI 2.0.2 Standard.
More detailed: fmi2Struct = Union{FMU2, FMU2Component}
str::FMU2
: Mutable struct representing a FMU and all it instantiated instances in the FMI 2.0.2 Standard.str::FMU2Component
: Mutable struct represents an instantiated instance of an FMU in the FMI 2.0.2 Standard.vr::fmi2ValueReferenceFormat
: Argumentvr
defines the value references of the variables.
More detailed: fmi2ValueReferenceFormat = Union{Nothing, String, Array{String,1}, fmi2ValueReference, Array{fmi2ValueReference,1}, Int64, Array{Int64,1}, Symbol}
vr::AbstractArray{fmi2ValueReference}
: Argumentvr
is an array ofnvr
value handels called "ValueReference" that define the variable that shall be inquired.nvr::Csize_t
: Argumentnvr
defines the size ofvr
.values::AbstractArray{fmi2Boolean}
: Argumentvalue
is an array with the actual values of these variables
Returns
- Return singleton instance of type
Nothing
, if there is no value to return (as in a C void function) or when a variable or field holds no value.
Source
- FMISpec2.0.2 Link: https://fmi-standard.org/
- FMISpec2.0.2[p.24]: 2.1.7 Getting and Setting Variable Values
- FMISpec2.0.2[p.16]: 2.1.2 Platform Dependent Definitions
- FMISpec2.0.2[p.18]: 2.1.3 Status Returned by Functions
See also fmi2GetBoolean!
.
FMICore.fmi2GetBooleanStatus!
— Methodfmi2GetBooleanStatus!(c::FMU2Component,
s::fmi2StatusKind,
value::Ref{fmi2Boolean})
Informs the master about the actual status of the simulation run. Which status information is to be returned is specified by the argument fmi2StatusKind
.
Arguments
c::FMU2Component
: Mutable struct represents an instantiated instance of an FMU in the FMI 2.0.2 Standard.s::fmi2StatusKind
: Arguments
defines which status information is to be returned.fmi2StatusKind
is an enumeration that defines which status is inquired.
The following status information can be retrieved from a slave:
fmi2DoStepStatus::fmi2Status
: Can be called when thefmi2DoStep
function returnedfmi2Pending
. The function deliversfmi2Pending
if the computation is not finished. Otherwise the function returns the result of the asynchronously executedfmi2DoStep
call.fmi2PendingStatus::fmi2String
: Can be called when thefmi2DoStep
function returnedfmi2Pending
. The function delivers a string which informs about the status of the currently running asynchronousfmi2DoStep
computationfmi2LastSuccessfulTime:: fmi2Real
: Returns the end time of the last successfully completed communication step. Can be called after fmi2DoStep(..) returned fmi2Discard.fmi2Terminated::fmi2Boolean
: Returnsfmi2True
, if the slave wants to terminate the simulation. Can be called after fmi2DoStep(..) returnedfmi2Discard
. Use fmi2LastSuccessfulTime to determine the time instant at which the slave terminated.value::Ref{fmi2Boolean}
: Argumentvalue
points to the return value (fmi2Boolean) which was requested.fmi2Boolean
is a alias type forBoolean
data type.
Returns
status::fmi2Status
: Returnstatus
is an enumeration of typefmi2Status
and indicates the success of the function call.
More detailed:
fmi2OK
: all wellfmi2Warning
: things are not quite right, but the computation can continuefmi2Discard
: if the slave computed successfully only a subinterval of the communication stepfmi2Error
: the communication step could not be carried out at allfmi2Fatal
: if an error occurred which corrupted the FMU irreparablyfmi2Pending
: this status is returned if the slave executes the function asynchronously
Source
- FMISpec2.0.2 Link: https://fmi-standard.org/
- FMISpec2.0.2[p.16]: 2.1.2 Platform Dependent Definitions (fmi2TypesPlatform.h)
- FMISpec2.0.2[p.16]: 2.1.3 Status Returned by Functions
- FMISpec2.0.2[p.106]: 4.2.3 Retrieving Status Information from the Slave
See also fmi2GetBooleanStatus!
.
FMICore.fmi2GetContinuousStates!
— Methodfmi2GetContinuousStates!(c::FMU2Component,
x::AbstractArray{fmi2Real},
nx::Csize_t)
Stores the new (continuous) state vector in x.
Arguments
c::FMU2Component
: Mutable struct represents an instantiated instance of an FMU in the FMI 2.0.2 Standard.x::AbstractArray{fmi2Real}
: Argumentx
contains values of typefmi2Real
which is a alias type forReal
data type.x
is theAbstractArray
which contains theReal
values of the vector that represent the new state vector.nx::Csize_t
: Argumentnx
defines the length of vectorx
and is provided for checking purposes
Returns
status::fmi2Status
: Returnstatus
is an enumeration of typefmi2Status
and indicates the success of the function call.
More detailed:
fmi2OK
: all wellfmi2Warning
: things are not quite right, but the computation can continuefmi2Discard
: if the slave computed successfully only a subinterval of the communication stepfmi2Error
: the communication step could not be carried out at allfmi2Fatal
: if an error occurred which corrupted the FMU irreparablyfmi2Pending
: this status is returned if the slave executes the function asynchronously
Source
- FMISpec2.0.2 Link: https://fmi-standard.org/
- FMISpec2.0.2[p.16]: 2.1.2 Platform Dependent Definitions (fmi2TypesPlatform.h)
- FMISpec2.0.2[p.16]: 2.1.3 Status Returned by Functions
- FMISpec2.0.2[p.83]: 3.2.2 Evaluation of Model Equations
See also fmi2GetEventIndicators!
.
FMICore.fmi2GetDerivatives!
— Methodfmi2GetDerivatives!(c::FMU2Component,
derivatives::AbstractArray{fmi2Real},
nx::Csize_t)
Compute state derivatives at the current time instant and for the current states.
Arguments
c::FMU2Component
: Mutable struct represents an instantiated instance of an FMU in the FMI 2.0.2 Standard.derivatives::AbstractArray{fmi2Real}
: Argumentderivatives
contains values of typefmi2Real
which is a alias type forReal
data type.derivatives
is theAbstractArray
which contains theReal
values of the vector that represent the derivatives. The ordering of the elements of the derivatives vector is identical to the ordering of the state vector.nx::Csize_t
: Argumentnx
defines the length of vectorderivatives
and is provided for checking purposes
Returns
status::fmi2Status
: Returnstatus
is an enumeration of typefmi2Status
and indicates the success of the function call.
More detailed:
fmi2OK
: all wellfmi2Warning
: things are not quite right, but the computation can continuefmi2Discard
: if the slave computed successfully only a subinterval of the communication stepfmi2Error
: the communication step could not be carried out at allfmi2Fatal
: if an error occurred which corrupted the FMU irreparablyfmi2Pending
: this status is returned if the slave executes the function asynchronously
Source
- FMISpec2.0.2 Link: https://fmi-standard.org/
- FMISpec2.0.2[p.16]: 2.1.2 Platform Dependent Definitions (fmi2TypesPlatform.h)
- FMISpec2.0.2[p.16]: 2.1.3 Status Returned by Functions
- FMISpec2.0.2[p.83]: 3.2.2 Evaluation of Model Equations
See also fmi2GetDerivatives!
.
FMICore.fmi2GetDerivatives!
— Methodfmi2GetDerivatives!(c::FMU2Component, derivatives::AbstractArray{fmi2Real})
Compute state derivatives at the current time instant and for the current states.
Arguments
c::FMU2Component
: Mutable struct represents an instantiated instance of an FMU in the FMI 2.0.2 Standard.derivatives::Array{fmi2Real}
: Storesfmi2Real
values representing thederivatives
for the current states. The ordering of the elements of the derivatives vector is identical to the ordering of the state vector.
Returns
status::fmi2Status
: Returnstatus
is an enumeration of typefmi2Status
and indicates the success of the function call.
More detailed:
fmi2OK
: all wellfmi2Warning
: things are not quite right, but the computation can continuefmi2Discard
: if the slave computed successfully only a subinterval of the communication stepfmi2Error
: the communication step could not be carried out at allfmi2Fatal
: if an error occurred which corrupted the FMU irreparablyfmi2Pending
: this status is returned if the slave executes the function asynchronously
Source
- FMISpec2.0.2 Link: https://fmi-standard.org/
- FMISpec2.0.2[p.16]: 2.1.2 Platform Dependent Definitions (fmi2TypesPlatform.h)
- FMISpec2.0.2[p.16]: 2.1.3 Status Returned by Functions
- FMISpec2.0.2[p.83]: 3.2.2 Evaluation of Model Equations
See also fmi2GetDerivatives!
.
FMICore.fmi2GetDirectionalDerivative!
— MethodfmiGetDirectionalDerivative!(c::FMU2Component,
vUnknown_ref::AbstractArray{fmi2ValueReference},
vKnown_ref::AbstractArray{fmi2ValueReference},
dvKnown::Array{fmi2Real},
dvUnknown::AbstractArray)
Wrapper Function call to compute the partial derivative with respect to the variables vKnown_ref
.
Computes the directional derivatives of an FMU. An FMU has different Modes and in every Mode an FMU might be described by different equations and different unknowns.The precise definitions are given in the mathematical descriptions of Model Exchange (section 3.1) and Co-Simulation (section 4.1). In every Mode, the general form of the FMU equations are: 𝐯unknown = 𝐡(𝐯known, 𝐯_rest)
v_unknown
: vector of unknown Real variables computed in the actual Mode:- Initialization Mode: unkowns kisted under
<ModelStructure><InitialUnknowns>
that have type Real. - Continuous-Time Mode (ModelExchange): The continuous-time outputs and state derivatives. (= the variables listed under
<ModelStructure><Outputs>
with type Real and variability =continuous
and the variables listed as state derivatives under<ModelStructure><Derivatives>)
. - Event Mode (ModelExchange): The same variables as in the Continuous-Time Mode and additionally variables under
<ModelStructure><Outputs>
with type Real and variability =discrete
. - Step Mode (CoSimulation): The variables listed under
<ModelStructure><Outputs>
with type Real and variability =continuous
ordiscrete
. If<ModelStructure><Derivatives>
is present, also the variables listed here as state derivatives.
- Initialization Mode: unkowns kisted under
v_known
: Real input variables of function h that changes its value in the actual Mode.v_rest
:Set of input variables of function h that either changes its value in the actual Mode but are non-Real variables, or do not change their values in this Mode, but change their values in other Modes
Computes a linear combination of the partial derivatives of h with respect to the selected input variables 𝐯_known:
Δv_unknown = (δh / δv_known) Δv_known
Arguments
c::FMU2Component
: Mutable struct represents an instantiated instance of an FMU in the FMI 2.0.2 Standard.vUnknown_ref::AbstracArray{fmi2ValueReference}
: ArgumentvUnknown_ref
contains values of typefmi2ValueReference
which are identifiers of a variable value of the model.vUnknown_ref
can be equated withv_unknown
(variable described above).vKnown_ref::AbstractArray{fmi2ValueReference}
: ArgumentvKnown_ref
contains values of typefmi2ValueReference
which are identifiers of a variable value of the model.vKnown_ref
can be equated withv_known
(variable described above).dvUnknown::AbstractArray{fmi2Real}
: Stores the directional derivative vector values.dvKnown::Union{AbstractArray{fmi2Real}, Nothing} = nothing
: If no seed vector is passed the valuenothing
is used. The vector values Compute the partial derivative with respect to the given entries in vectorvKnown_ref
with the matching evaluate ofdvKnown
.
Returns
status::fmi2Status
: Returnstatus
is an enumeration of typefmi2Status
and indicates the success of the function call.
More detailed:
fmi2OK
: all wellfmi2Warning
: things are not quite right, but the computation can continuefmi2Discard
: if the slave computed successfully only a subinterval of the communication stepfmi2Error
: the communication step could not be carried out at allfmi2Fatal
: if an error occurred which corrupted the FMU irreparablyfmi2Pending
: this status is returned if the slave executes the function asynchronously
Source
- FMISpec2.0.2 Link: https://fmi-standard.org/
- FMISpec2.0.2[p.16]: 2.1.2 Platform Dependent Definitions (fmi2TypesPlatform.h)
- FMISpec2.0.2[p.16]: 2.1.3 Status Returned by Functions
- FMISpec2.0.2[p.25]: 2.1.9 Getting Partial Derivatives
See also fmi2GetDirectionalDerivative!
.
FMICore.fmi2GetDirectionalDerivative!
— Methodfmi2GetDirectionalDerivative!(c::FMU2Component,
vUnknown_ref::AbstractArray{fmi2ValueReference},
nUnknown::Csize_t,
vKnown_ref::AbstractArray{fmi2ValueReference},
nKnown::Csize_t,
dvKnown::AbstractArray{fmi2Real},
dvUnknown::AbstractArray{fmi2Real})
Wrapper Function call to compute the partial derivative with respect to the variables vKnown_ref
.
Computes the directional derivatives of an FMU. An FMU has different Modes and in every Mode an FMU might be described by different equations and different unknowns. The precise definitions are given in the mathematical descriptions of Model Exchange (section 3.1) and Co-Simulation (section 4.1). In every Mode, the general form of the FMU equations are: 𝐯unknown = 𝐡(𝐯known, 𝐯_rest)
v_unknown
: vector of unknown Real variables computed in the actual Mode:- Initialization Mode: unkowns kisted under
<ModelStructure><InitialUnknowns>
that have type Real. - Continuous-Time Mode (ModelExchange): The continuous-time outputs and state derivatives. (= the variables listed under
<ModelStructure><Outputs>
with type Real and variability =continuous
and the variables listed as state derivatives under<ModelStructure><Derivatives>)
. - Event Mode (ModelExchange): The same variables as in the Continuous-Time Mode and additionally variables under
<ModelStructure><Outputs>
with type Real and variability =discrete
. - Step Mode (CoSimulation): The variables listed under
<ModelStructure><Outputs>
with type Real and variability =continuous
ordiscrete
. If<ModelStructure><Derivatives>
is present, also the variables listed here as state derivatives.
- Initialization Mode: unkowns kisted under
v_known
: Real input variables of function h that changes its value in the actual Mode.v_rest
:Set of input variables of function h that either changes its value in the actual Mode but are non-Real variables, or do not change their values in this Mode, but change their values in other Modes
Computes a linear combination of the partial derivatives of h with respect to the selected input variables 𝐯_known:
Δvunknown = (δh / δvknown) Δv_known
Arguments
c::FMU2Component
: Mutable struct represents an instantiated instance of an FMU in the FMI 2.0.2 Standard.vUnknown_ref::AbstracArray{fmi2ValueReference}
: ArgumentvUnknown_ref
contains values of typefmi2ValueReference
which are identifiers of a variable value of the model.vUnknown_ref
can be equated withv_unknown
(variable described above).nUnknown::Csize_t
: Length of theUnknown
Array.vKnown_ref::AbstractArray{fmi2ValueReference}
: ArgumentvKnown_ref
contains values of typefmi2ValueReference
which are identifiers of a variable value of the model.vKnown_ref
can be equated withv_known
(variable described above).nKnown::Csize_t
: Length of theKnown
Array.dvKnown::AbstractArray{fmi2Real}
:The vector values Compute the partial derivative with respect to the given entries in vectorvKnown_ref
with the matching evaluate ofdvKnown
.dvUnknown::AbstractArray{fmi2Real}
: Stores the directional derivative vector values.
Returns
status::fmi2Status
: Returnstatus
is an enumeration of typefmi2Status
and indicates the success of the function call.
More detailed:
fmi2OK
: all wellfmi2Warning
: things are not quite right, but the computation can continuefmi2Discard
: if the slave computed successfully only a subinterval of the communication stepfmi2Error
: the communication step could not be carried out at allfmi2Fatal
: if an error occurred which corrupted the FMU irreparablyfmi2Pending
: this status is returned if the slave executes the function asynchronously
Source
- FMISpec2.0.2 Link: https://fmi-standard.org/
- FMISpec2.0.2[p.16]: 2.1.2 Platform Dependent Definitions (fmi2TypesPlatform.h)
- FMISpec2.0.2[p.16]: 2.1.3 Status Returned by Functions
- FMISpec2.0.2[p.25]: 2.1.9 Getting Partial Derivatives
See also fmi2GetDirectionalDerivative!
.
FMICore.fmi2GetEventIndicators!
— Methodfmi2GetEventIndicators!(c::FMU2Component, eventIndicators::AbstractArray{fmi2Real}, ni::Csize_t)
Compute event indicators at the current time instant and for the current states.
Arguments
c::FMU2Component
: Mutable struct represents an instantiated instance of an FMU in the FMI 2.0.2 Standard.eventIndicators::AbstractArray{fmi2Real}
: ArgumenteventIndicators
contains values of typefmi2Real
which is a alias type forReal
data type.eventIndicators
is theAbstractArray
which contains theReal
values of the vector that represent the event indicators.ni::Csize_t
: Argumentni
defines the length of vectoreventIndicators
and is provided for checking purposes
Returns
status::fmi2Status
: Returnstatus
is an enumeration of typefmi2Status
and indicates the success of the function call.
More detailed:
fmi2OK
: all wellfmi2Warning
: things are not quite right, but the computation can continuefmi2Discard
: if the slave computed successfully only a subinterval of the communication stepfmi2Error
: the communication step could not be carried out at allfmi2Fatal
: if an error occurred which corrupted the FMU irreparablyfmi2Pending
: this status is returned if the slave executes the function asynchronously
Source
- FMISpec2.0.2 Link: https://fmi-standard.org/
- FMISpec2.0.2[p.16]: 2.1.2 Platform Dependent Definitions (fmi2TypesPlatform.h)
- FMISpec2.0.2[p.16]: 2.1.3 Status Returned by Functions
- FMISpec2.0.2[p.83]: 3.2.2 Evaluation of Model Equations
See also fmi2GetEventIndicators!
.
FMICore.fmi2GetEventIndicators!
— Methodfmi2GetEventIndicators!(c::FMU2Component, eventIndicators::AbstractArray{fmi2Real})
Returns the event indicators of the FMU.
Arguments
c::FMU2Component
: Mutable struct represents an instantiated instance of an FMU in the FMI 2.0.2 Standard.eventIndicators::AbstractArray{fmi2Real}
:The event indicators are in an AbstractArray represented by an array of "fmi2Real" values.
Returns
Source
- FMISpec2.0.2 Link: https://fmi-standard.org/
- FMISpec2.0.2[p.16]: 2.1.2 Platform Dependent Definitions (fmi2TypesPlatform.h)
- FMISpec2.0.2[p.16]: 2.1.3 Status Returned by Functions
- FMISpec2.0.2[p.83]: 3.2.2 Evaluation of Model Equations
FMICore.fmi2GetFMUstate!
— Methodfmi2GetFMUstate!(c::FMU2Component, FMUstate::Ref{fmi2FMUstate})
Makes a copy of the internal FMU state and returns a pointer to this copy.
Arguments
str::FMU2Component
: Mutable struct represents an instantiated instance of an FMU in the FMI 2.0.2 Standard.FMUstate::Ref{fmi2FMUstate}
:If on entryFMUstate == NULL
, a new allocation is required. IfFMUstate != NULL
, thenFMUstate
points to a previously returnedFMUstate
that has not been modified since.
Returns
status::fmi2Status
: Returnstatus
is an enumeration of typefmi2Status
and indicates the success of the function call.
More detailed:
fmi2OK
: all wellfmi2Warning
: things are not quite right, but the computation can continuefmi2Discard
: if the slave computed successfully only a subinterval of the communication stepfmi2Error
: the communication step could not be carried out at allfmi2Fatal
: if an error occurred which corrupted the FMU irreparablyfmi2Pending
: this status is returned if the slave executes the function asynchronously
Source
- FMISpec2.0.2 Link: https://fmi-standard.org/
- FMISpec2.0.2[p.16]: 2.1.2 Platform Dependent Definitions
- FMISpec2.0.2[p.18]: 2.1.3 Status Returned by Functions
- FMISpec2.0.2[p.24]: 2.1.7 Getting and Setting Variable Values
See also fmi2GetFMUstate!
.
FMICore.fmi2GetInteger!
— Methodfmi2GetInteger!(c::FMU2Component, vr::AbstractArray{fmi2ValueReference}, nvr::Csize_t, value::AbstractArray{fmi2Integer})
Writes the integer values of an array of variables in the given field
fmi2GetInteger! is only possible for arrays of values, please use an array instead of a scalar.
Arguments
c::FMU2Component
: Mutable struct represents an instantiated instance of an FMU in the FMI 2.0.2 Standard.vr::AbstractArray{fmi2ValueReference}
: Argumentvr
is an AbstractArray ofnvr
value handels, called "ValueReference" that define the variable that shall be inquired.nvr::Csize_t
: Argumentnvr
defines the size ofvr
.values::AbstractArray{fmi2Integer}
: Argumentvalues
is an AbstractArray with the actual values of these variables.
Returns
status::fmi2Status
: Returnstatus
is an enumeration of typefmi2Status
and indicates the success of the function call.
More detailed:
fmi2OK
: all wellfmi2Warning
: things are not quite right, but the computation can continuefmi2Discard
: if the slave computed successfully only a subinterval of the communication stepfmi2Error
: the communication step could not be carried out at allfmi2Fatal
: if an error occurred which corrupted the FMU irreparablyfmi2Pending
: this status is returned if the slave executes the function asynchronously
Source
- FMISpec2.0.2 Link: https://fmi-standard.org/
- FMISpec2.0.2[p.24]: 2.1.7 Getting and Setting Variable Values
- FMISpec2.0.2[p.16]: 2.1.2 Platform Dependent Definitions
- FMISpec2.0.2[p.18]: 2.1.3 Status Returned by Functions
See also fmi2GetInteger!
.
FMICore.fmi2GetInteger!
— Methodfmi2GetInteger!(c::FMU2Component, vr::fmi2ValueReferenceFormat, values::AbstractArray{fmi2Integer})
Writes the integer values of an array of variables in the given field
fmi2GetInteger! is only possible for arrays of values, please use an array instead of a scalar.
Arguments
c::fmi2Struct
: Representative for an FMU in the FMI 2.0.2 Standard.
More detailed: fmi2Struct = Union{FMU2, FMU2Component}
c::FMU2
: Mutable struct representing a FMU and all it instantiated instances in the FMI 2.0.2 Standard.c::FMU2Component
: Mutable struct represents an instantiated instance of an FMU in the FMI 2.0.2 Standard.vr::fmi2ValueReferenceFormat
: Argumentvr
defines the value references of the variables.
More detailed: fmi2ValueReferenceFormat = Union{Nothing, String, Array{String,1}, fmi2ValueReference, Array{fmi2ValueReference,1}, Int64, Array{Int64,1}, Symbol}
vr::Array{fmi2ValueReference}
: Argumentvr
is an array ofnvr
value handels called "ValueReference" that define the variable that shall be inquired.nvr::Csize_t
: Argumentnvr
defines the size ofvr
.values::Array{fmi2Integer}
: Argumentvalues
is an array with the actual values of these variables.
Returns
status::fmi2Status
: Returnstatus
is an enumeration of typefmi2Status
and indicates the success of the function call.
More detailed:
fmi2OK
: all wellfmi2Warning
: things are not quite right, but the computation can continuefmi2Discard
: if the slave computed successfully only a subinterval of the communication stepfmi2Error
: the communication step could not be carried out at allfmi2Fatal
: if an error occurred which corrupted the FMU irreparablyfmi2Pending
: this status is returned if the slave executes the function asynchronously
Source
- FMISpec2.0.2 Link: https://fmi-standard.org/
- FMISpec2.0.2[p.24]: 2.1.7 Getting and Setting Variable Values
- FMISpec2.0.2[p.16]: 2.1.2 Platform Dependent Definitions
- FMISpec2.0.2[p.18]: 2.1.3 Status Returned by Functions
See also fmi2GetInteger!
.
FMICore.fmi2GetIntegerStatus!
— Methodfmi2GetIntegerStatus!(c::FMU2Component,
s::fmi2StatusKind,
value::Ref{fmi2Integer})
Informs the master about the actual status of the simulation run. Which status information is to be returned is specified by the argument fmi2StatusKind
.
Arguments
c::FMU2Component
: Mutable struct represents an instantiated instance of an FMU in the FMI 2.0.2 Standard.s::fmi2StatusKind
: Arguments
defines which status information is to be returned.fmi2StatusKind
is an enumeration that defines which status is inquired.
The following status information can be retrieved from a slave:
fmi2DoStepStatus::fmi2Status
: Can be called when thefmi2DoStep
function returnedfmi2Pending
. The function deliversfmi2Pending
if the computation is not finished. Otherwise the function returns the result of the asynchronously executedfmi2DoStep
call.fmi2PendingStatus::fmi2String
: Can be called when thefmi2DoStep
function returnedfmi2Pending
. The function delivers a string which informs about the status of the currently running asynchronousfmi2DoStep
computationfmi2LastSuccessfulTime:: fmi2Real
: Returns the end time of the last successfully completed communication step. Can be called after fmi2DoStep(..) returned fmi2Discard.fmi2Terminated::fmi2Boolean
: Returnsfmi2True
, if the slave wants to terminate the simulation. Can be called after fmi2DoStep(..) returnedfmi2Discard
. Use fmi2LastSuccessfulTime to determine the time instant at which the slave terminated.value::Ref{fmi2Integer}
: Argumentvalue
points to the return value (fmi2Integer) which was requested.fmi2Integer
is a alias type forInteger
data type.
Returns
status::fmi2Status
: Returnstatus
is an enumeration of typefmi2Status
and indicates the success of the function call.
More detailed:
fmi2OK
: all wellfmi2Warning
: things are not quite right, but the computation can continuefmi2Discard
: if the slave computed successfully only a subinterval of the communication stepfmi2Error
: the communication step could not be carried out at allfmi2Fatal
: if an error occurred which corrupted the FMU irreparablyfmi2Pending
: this status is returned if the slave executes the function asynchronously
Source
- FMISpec2.0.2 Link: https://fmi-standard.org/
- FMISpec2.0.2[p.16]: 2.1.2 Platform Dependent Definitions (fmi2TypesPlatform.h)
- FMISpec2.0.2[p.16]: 2.1.3 Status Returned by Functions
- FMISpec2.0.2[p.106]: 4.2.3 Retrieving Status Information from the Slave
See also fmi2GetIntegerStatus!
.
FMICore.fmi2GetNominalsOfContinuousStates!
— Methodfmi2GetNominalsOfContinuousStates!(c::FMU2Component, x_nominal::AbstractArray{fmi2Real}, nx::Csize_t)
Stores the nominal values of the continuous states in x_nominal.
Arguments
c::FMU2Component
: Mutable struct represents an instantiated instance of an FMU in the FMI 2.0.2 Standard.x_nominal::AbstractArray{fmi2Real}
: Argumentx_nominal
contains values of typefmi2Real
which is a alias type forReal
data type.x_nominal
is theAbstractArray
which contains theReal
values of the vector that represent the nominal values of the continuous states.nx::Csize_t
: Argumentnx
defines the length of vectorx
and is provided for checking purposes
Returns
status::fmi2Status
: Returnstatus
is an enumeration of typefmi2Status
and indicates the success of the function call.
More detailed:
fmi2OK
: all wellfmi2Warning
: things are not quite right, but the computation can continuefmi2Discard
: if the slave computed successfully only a subinterval of the communication stepfmi2Error
: the communication step could not be carried out at allfmi2Fatal
: if an error occurred which corrupted the FMU irreparablyfmi2Pending
: this status is returned if the slave executes the function asynchronously
Source
- FMISpec2.0.2 Link: https://fmi-standard.org/
- FMISpec2.0.2[p.16]: 2.1.2 Platform Dependent Definitions (fmi2TypesPlatform.h)
- FMISpec2.0.2[p.16]: 2.1.3 Status Returned by Functions
- FMISpec2.0.2[p.83]: 3.2.2 Evaluation of Model Equations
See also fmi2GetEventIndicators!
.
FMICore.fmi2GetReal!
— Methodfmi2GetReal!(c::FMU2Component, vr::AbstractArray{fmi2ValueReference}, nvr::Csize_t, value::AbstractArray{fmi2Real})
Functions to get and set values of variables idetified by their valueReference
Arguments
c::FMU2Component
: Mutable struct represents an instantiated instance of an FMU in the FMI 2.0.2 Standard.vr::AbstractArray{fmi2ValueReference}
: Argumentvr
is an AbstractArray ofnvr
value handels called "ValueReference" that define the variable that shall be inquired.nvr::Csize_t
: Argumentnvr
defines the size ofvr
.values::AbstractArray{fm2Real}
: Argumentvalues
is an AbstractArray with the actual values of these variables.
Returns
status::fmi2Status
: Returnstatus
is an enumeration of typefmi2Status
and indicates the success of the function call.
More detailed:
fmi2OK
: all wellfmi2Warning
: things are not quite right, but the computation can continuefmi2Discard
: if the slave computed successfully only a subinterval of the communication stepfmi2Error
: the communication step could not be carried out at allfmi2Fatal
: if an error occurred which corrupted the FMU irreparablyfmi2Pending
: this status is returned if the slave executes the function asynchronously
Source
- FMISpec2.0.2 Link: https://fmi-standard.org/
- FMISpec2.0.2[p.18]: 2.1.3 Status Returned by Functions
- FMISpec2.0.2[p.24]: 2.1.7 Getting and Setting Variable Values
See also fmi2GetReal!
.
FMICore.fmi2GetReal!
— Methodfmi2GetReal!(c::FMU2Component, vr::fmi2ValueReferenceFormat, values::AbstractArray{fmi2Real})
Get the values of an array of fmi2Real variables.
rites the real values of an array of variables in the given field
Arguments
c::fmi2Struct
: Representative for an FMU in the FMI 2.0.2 Standard.
More detailed: fmi2Struct = Union{FMU2, FMU2Component}
c::FMU2
: Mutable struct representing a FMU and all it instantiated instances in the FMI 2.0.2 Standard.c::FMU2Component
: Mutable struct represents an instantiated instance of an FMU in the FMI 2.0.2 Standard.vr::fmi2ValueReferenceFormat
: Wildcards for how a user can pass a fmi[X]ValueReference
More detailed: fmi2ValueReferenceFormat = Union{Nothing, String, Array{String,1}, fmi2ValueReference, Array{fmi2ValueReference,1}, Int64, Array{Int64,1}, Symbol}
values::AbstractArray{fm2Real}
: Argumentvalues
is an AbstractArray with the actual values of these variables.
Returns
status::fmi2Status
: Returnstatus
is an enumeration of typefmi2Status
and indicates the success of the function call.
More detailed:
fmi2OK
: all wellfmi2Warning
: things are not quite right, but the computation can continuefmi2Discard
: if the slave computed successfully only a subinterval of the communication stepfmi2Error
: the communication step could not be carried out at allfmi2Fatal
: if an error occurred which corrupted the FMU irreparablyfmi2Pending
: this status is returned if the slave executes the function asynchronously
Source
- FMISpec2.0.2 Link: https://fmi-standard.org/
- FMISpec2.0.2[p.24]: 2.1.7 Getting and Setting Variable Values
- FMISpec2.0.2[p.18]: 2.1.3 Status Returned by Functions
See also fmi2GetReal!
.
FMICore.fmi2GetRealOutputDerivatives!
— Methodfmi2GetRealOutputDerivatives!(c::FMU2Component,
vr::AbstractArray{fmi2ValueReference},
nvr::Csize_t, order::AbstractArray{fmi2Integer},
value::AbstractArray{fmi2Real})
Sets the n-th time derivative of real input variables.
Arguments
c::FMU2Component
: Mutable struct represents an instantiated instance of an FMU in the FMI 2.0.2 Standard.vr::Array{fmi2ValueReference}
: Argumentvr
is an array ofnvr
value handels called "ValueReference" that t define the variables whose derivatives shall be set.nvr::Csize_t
: Argumentnvr
defines the size ofvr
.order::Array{fmi2Integer}
: Argumentorder
is an array of fmi2Integer values witch specifys the corresponding order of derivative of the real input variable.values::Array{fmi2Real}
: Argumentvalues
is an array with the actual values of these variables.
Returns
status::fmi2Status
: Returnstatus
is an enumeration of typefmi2Status
and indicates the success of the function call.
More detailed:
fmi2OK
: all wellfmi2Warning
: things are not quite right, but the computation can continuefmi2Discard
: if the slave computed successfully only a subinterval of the communication stepfmi2Error
: the communication step could not be carried out at allfmi2Fatal
: if an error occurred which corrupted the FMU irreparablyfmi2Pending
: this status is returned if the slave executes the function asynchronously
Source
- FMISpec2.0.2 Link: https://fmi-standard.org/
- FMISpec2.0.2[p.16]: 2.1.2 Platform Dependent Definitions
- FMISpec2.0.2[p.18]: 2.1.3 Status Returned by Functions
- FMISpec2.0.2[p.104]: 4.2.1 Transfer of Input / Output Values and Parameters
FMICore.fmi2GetRealStatus!
— Methodfmi2GetRealStatus!(c::FMU2Component,
s::fmi2StatusKind,
value::Ref{fmi2Real})
Informs the master about the actual status of the simulation run. Which status information is to be returned is specified by the argument fmi2StatusKind
.
Arguments
c::FMU2Component
: Mutable struct represents an instantiated instance of an FMU in the FMI 2.0.2 Standard.s::fmi2StatusKind
: Arguments
defines which status information is to be returned.fmi2StatusKind
is an enumeration that defines which status is inquired.
The following status information can be retrieved from a slave:
fmi2DoStepStatus::fmi2Status
: Can be called when thefmi2DoStep
function returnedfmi2Pending
. The function deliversfmi2Pending
if the computation is not finished. Otherwise the function returns the result of the asynchronously executedfmi2DoStep
call.fmi2PendingStatus::fmi2String
: Can be called when thefmi2DoStep
function returnedfmi2Pending
. The function delivers a string which informs about the status of the currently running asynchronousfmi2DoStep
computationfmi2LastSuccessfulTime:: fmi2Real
: Returns the end time of the last successfully completed communication step. Can be called after fmi2DoStep(..) returned fmi2Discard.fmi2Terminated::fmi2Boolean
: Returnsfmi2True
, if the slave wants to terminate the simulation. Can be called after fmi2DoStep(..) returnedfmi2Discard
. Use fmi2LastSuccessfulTime to determine the time instant at which the slave terminated.value::Ref{fmi2Real}
: Argumentvalue
points to the return value (fmi2Real) which was requested.fmi2Real
is a alias type forReal
data type.
Returns
status::fmi2Status
: Returnstatus
is an enumeration of typefmi2Status
and indicates the success of the function call.
More detailed:
fmi2OK
: all wellfmi2Warning
: things are not quite right, but the computation can continuefmi2Discard
: if the slave computed successfully only a subinterval of the communication stepfmi2Error
: the communication step could not be carried out at allfmi2Fatal
: if an error occurred which corrupted the FMU irreparablyfmi2Pending
: this status is returned if the slave executes the function asynchronously
Source
- FMISpec2.0.2 Link: https://fmi-standard.org/
- FMISpec2.0.2[p.16]: 2.1.2 Platform Dependent Definitions (fmi2TypesPlatform.h)
- FMISpec2.0.2[p.16]: 2.1.3 Status Returned by Functions
- FMISpec2.0.2[p.106]: 4.2.3 Retrieving Status Information from the Slave
See also fmi2GetRealStatus!
.
FMICore.fmi2GetStatus!
— Methodfmi2GetStatus!(c::FMU2Component,
s::fmi2StatusKind,
value::Ref{fmi2Status})
Informs the master about the actual status of the simulation run. Which status information is to be returned is specified by the argument fmi2StatusKind
.
Arguments
c::FMU2Component
: Mutable struct represents an instantiated instance of an FMU in the FMI 2.0.2 Standard.s::fmi2StatusKind
: Arguments
defines which status information is to be returned.fmi2StatusKind
is an enumeration that defines which status is inquired.
The following status information can be retrieved from a slave:
fmi2DoStepStatus::fmi2Status
: Can be called when thefmi2DoStep
function returnedfmi2Pending
. The function deliversfmi2Pending
if the computation is not finished. Otherwise the function returns the result of the asynchronously executedfmi2DoStep
call.fmi2PendingStatus::fmi2String
: Can be called when thefmi2DoStep
function returnedfmi2Pending
. The function delivers a string which informs about the status of the currently running asynchronousfmi2DoStep
computationfmi2LastSuccessfulTime:: fmi2Real
: Returns the end time of the last successfully completed communication step. Can be called after fmi2DoStep(..) returned fmi2Discard.fmi2Terminated::fmi2Boolean
: Returnsfmi2True
, if the slave wants to terminate the simulation. Can be called after fmi2DoStep(..) returnedfmi2Discard
. Use fmi2LastSuccessfulTime to determine the time instant at which the slave terminated.value::Ref{fmi2Status}
: Thevalue
argument points to a status flag that was requested.
Returns
status::fmi2Status
: Returnstatus
is an enumeration of typefmi2Status
and indicates the success of the function call.
More detailed:
fmi2OK
: all wellfmi2Warning
: things are not quite right, but the computation can continuefmi2Discard
: if the slave computed successfully only a subinterval of the communication stepfmi2Error
: the communication step could not be carried out at allfmi2Fatal
: if an error occurred which corrupted the FMU irreparablyfmi2Pending
: this status is returned if the slave executes the function asynchronously
Source
- FMISpec2.0.2 Link: https://fmi-standard.org/
- FMISpec2.0.2[p.16]: 2.1.2 Platform Dependent Definitions (fmi2TypesPlatform.h)
- FMISpec2.0.2[p.16]: 2.1.3 Status Returned by Functions
- FMISpec2.0.2[p.106]: 4.2.3 Retrieving Status Information from the Slave
See also fmi2GetStatus!
.
FMICore.fmi2GetString!
— Methodfmi2GetString!(c::FMU2Component, vr::AbstractArray{fmi2ValueReference}, nvr::Csize_t, value::Union{AbstractArray{Ptr{Cchar}}, AbstractArray{Ptr{UInt8}}})
Functions to get and set values of variables idetified by their valueReference
These functions are especially used to get the actual values of output variables if a model is connected with other models.
Arguments
str::FMU2Component
: Mutable struct represents an instantiated instance of an FMU in the FMI 2.0.2 Standard.vr::AbstractArray{fmi2ValueReference}
: Argumentvr
is an array ofnvr
value handels called "ValueReference" that define the variable that shall be inquired.nvr::Csize_t
: Argumentnvr
defines the size ofvr
.value::Union{AbstractArray{Ptr{Cchar}, AbstractArray{Ptr{UInt8}}}
: Thevalue
argument is an AbstractArray of values whose memory address refers to data of type Cchar or UInt8and describes a vector with the actual values of these. variables.
Returns
status::fmi2Status
: Returnstatus
is an enumeration of typefmi2Status
and indicates the success of the function call.
More detailed:
fmi2OK
: all wellfmi2Warning
: things are not quite right, but the computation can continuefmi2Discard
: if the slave computed successfully only a subinterval of the communication stepfmi2Error
: the communication step could not be carried out at allfmi2Fatal
: if an error occurred which corrupted the FMU irreparablyfmi2Pending
: this status is returned if the slave executes the function asynchronously
Source
- FMISpec2.0.2 Link: https://fmi-standard.org/
- FMISpec2.0.2[p.16]: 2.1.2 Platform Dependent Definitions
- FMISpec2.0.2[p.18]: 2.1.3 Status Returned by Functions
- FMISpec2.0.2[p.24]: 2.1.7 Getting and Setting Variable Values
See also fmi2GetString!
.
FMICore.fmi2GetString!
— Methodfmi2GetString!(c::FMU2Component, vr::fmi2ValueReferenceFormat, values::AbstractArray{fmi2String})
Writes the string values of an array of variables in the given field
These functions are especially used to get the actual values of output variables if a model is connected with other models.
Arguments
str::fmi2Struct
: Representative for an FMU in the FMI 2.0.2 Standard.
More detailed: fmi2Struct = Union{FMU2, FMU2Component}
str::FMU2
: Mutable struct representing a FMU and all it instantiated instances in the FMI 2.0.2 Standard.str::FMU2Component
: Mutable struct represents an instantiated instance of an FMU in the FMI 2.0.2 Standard.vr::fmi2ValueReferenceFormat
: Argumentvr
defines the value references of the variables.
More detailed: fmi2ValueReferenceFormat = Union{Nothing, String, Array{String,1}, fmi2ValueReference, Array{fmi2ValueReference,1}, Int64, Array{Int64,1}, Symbol}
values::AbstractArray{fmi2String}
: Argumentvalues
is an AbstractArray with the actual values of these variables
Returns
- Return singleton instance of type
Nothing
, if there is no value to return (as in a C void function) or when a variable or field holds no value.
Source
- FMISpec2.0.2 Link: https://fmi-standard.org/
- FMISpec2.0.2[p.24]: 2.1.7 Getting and Setting Variable Values
- FMISpec2.0.2[p.16]: 2.1.2 Platform Dependent Definitions
- FMISpec2.0.2[p.18]: 2.1.3 Status Returned by Functions
See also fmi2GetString!
.
FMICore.fmi2GetStringStatus!
— Methodfmi2GetStringStatus!(c::FMU2Component,
s::fmi2StatusKind,
value::Ref{fmi2String})
Informs the master about the actual status of the simulation run. Which status information is to be returned is specified by the argument fmi2StatusKind
.
Arguments
c::FMU2Component
: Mutable struct represents an instantiated instance of an FMU in the FMI 2.0.2 Standard.s::fmi2StatusKind
: Arguments
defines which status information is to be returned.fmi2StatusKind
is an enumeration that defines which status is inquired.
The following status information can be retrieved from a slave:
fmi2DoStepStatus::fmi2Status
: Can be called when thefmi2DoStep
function returnedfmi2Pending
. The function deliversfmi2Pending
if the computation is not finished. Otherwise the function returns the result of the asynchronously executedfmi2DoStep
call.fmi2PendingStatus::fmi2String
: Can be called when thefmi2DoStep
function returnedfmi2Pending
. The function delivers a string which informs about the status of the currently running asynchronousfmi2DoStep
computationfmi2LastSuccessfulTime:: fmi2Real
: Returns the end time of the last successfully completed communication step. Can be called after fmi2DoStep(..) returned fmi2Discard.fmi2Terminated::fmi2Boolean
: Returnsfmi2True
, if the slave wants to terminate the simulation. Can be called after fmi2DoStep(..) returnedfmi2Discard
. Use fmi2LastSuccessfulTime to determine the time instant at which the slave terminated.value:Ref{fmi2String}:
Argumentvalue
points to the return value (fmi2String) which was requested.fmi2String
is a alias type forString
data type.
Returns
status::fmi2Status
: Returnstatus
is an enumeration of typefmi2Status
and indicates the success of the function call.
More detailed:
fmi2OK
: all wellfmi2Warning
: things are not quite right, but the computation can continuefmi2Discard
: if the slave computed successfully only a subinterval of the communication stepfmi2Error
: the communication step could not be carried out at allfmi2Fatal
: if an error occurred which corrupted the FMU irreparablyfmi2Pending
: this status is returned if the slave executes the function asynchronously
Source
- FMISpec2.0.2 Link: https://fmi-standard.org/
- FMISpec2.0.2[p.16]: 2.1.2 Platform Dependent Definitions (fmi2TypesPlatform.h)
- FMISpec2.0.2[p.16]: 2.1.3 Status Returned by Functions
- FMISpec2.0.2[p.106]: 4.2.3 Retrieving Status Information from the Slave
See also fmi2GetStringStatus!
.
FMICore.fmi2GetTypesPlatform
— Methodfmi2GetTypesPlatform(fmu::FMU2)
Returns the string to uniquely identify the “fmi2TypesPlatform.h” header file used for compilation of the functions of the FMU. The standard header file, as documented in this specification, has fmi2TypesPlatform set to “default” (so this function usually returns “default”).
Arguments
fmu::FMU2
: Mutable struct representing a FMU and all it instantiated instances in the FMI 2.0.2 Standard.
Returns
- Returns the string to uniquely identify the “fmi2TypesPlatform.h” header file used for compilation of the functions of the FMU.
Source
- FMISpec2.0.2 Link: https://fmi-standard.org/
- FMISpec2.0.2[p.22]: 2.1.4 Inquire Platform and Version Number of Header Files
- FMISpec2.0.2[p.16]: 2.1.2 Platform Dependent Definitions
FMICore.fmi2GetVersion
— Methodfmi2GetVersion(fmu::FMU2)
Returns the version of the “fmi2Functions.h” header file which was used to compile the functions of the FMU.
Arguments
fmu::FMU2
: Mutable struct representing a FMU and all it instantiated instances in the FMI 2.0.2 Standard.
Returns
- Returns a string from the address of a C-style (NUL-terminated) string. The string represents the version of the “fmi2Functions.h” header file which was used to compile the functions of the FMU. The function returns “fmiVersion” which is defined in this header file. The standard header file as documented in this specification has version “2.0”
Source
- FMISpec2.0.2 Link: https://fmi-standard.org/
- FMISpec2.0.2[p.22]: 2.1.4 Inquire Platform and Version Number of Header Files
- FMISpec2.0.2[p.16]: 2.1.2 Platform Dependent Definitions
FMICore.fmi2NewDiscreteStates!
— Methodfmi2NewDiscreteStates!(c::FMU2Component, eventInfo::fmi2EventInfo)
The FMU is in Event Mode and the super dense time is incremented by this call.
Arguments
c::FMU2Component
: Mutable struct represents an instantiated instance of an FMU in the FMI 2.0.2 Standard.eventInfo::fmi2EventInfo*
: Strut withfmi2Boolean
Variables that
More detailed:
newDiscreteStatesNeeded::fmi2Boolean
: IfnewDiscreteStatesNeeded = fmi2True
the FMU should stay in Event Mode, and the FMU requires to set new inputs to the FMU to compute and get the outputs and to call
fmi2NewDiscreteStates again. If all FMUs return newDiscreteStatesNeeded = fmi2False
call fmi2EnterContinuousTimeMode.
terminateSimulation::fmi2Boolean
: IfterminateSimulation = fmi2True
callfmi2Terminate
nominalsOfContinuousStatesChanged::fmi2Boolean
: IfnominalsOfContinuousStatesChanged = fmi2True
then the nominal values of the states have changed due to the function call and can be inquired withfmi2GetNominalsOfContinuousStates
.valuesOfContinuousStatesChanged::fmi2Boolean
: IfvaluesOfContinuousStatesChanged = fmi2True
, then at least one element of the continuous state vector has changed its value due to the function call. The new values of the states can be retrieved withfmi2GetContinuousStates
. If no element of the continuous state vector has changed its value,valuesOfContinuousStatesChanged
must return fmi2False.nextEventTimeDefined::fmi2Boolean
: IfnextEventTimeDefined = fmi2True
, then the simulation shall integrate at most untiltime = nextEventTime
, and shall callfmi2EnterEventMode
at this time instant. If integration is stopped before nextEventTime, the definition ofnextEventTime
becomes obsolete.nextEventTime::fmi2Real
: next event ifnextEventTimeDefined=fmi2True
Returns
status::fmi2Status
: Returnstatus
is an enumeration of typefmi2Status
and indicates the success of the function call.
More detailed:
fmi2OK
: all wellfmi2Warning
: things are not quite right, but the computation can continuefmi2Discard
: if the slave computed successfully only a subinterval of the communication stepfmi2Error
: the communication step could not be carried out at allfmi2Fatal
: if an error occurred which corrupted the FMU irreparablyfmi2Pending
: this status is returned if the slave executes the function asynchronously
Source
- FMISpec2.0.2 Link: https://fmi-standard.org/
- FMISpec2.0.2[p.16]: 2.1.2 Platform Dependent Definitions (fmi2TypesPlatform.h)
- FMISpec2.0.2[p.16]: 2.1.3 Status Returned by Functions
- FMISpec2.0.2[p.83]: 3.2.2 Evaluation of Model Equations
See also fmi2NewDiscreteStates
.
FMICore.fmi2Reset
— Methodfmi2Reset(c::FMU2Component; soft::Bool=false)
Is called by the environment to reset the FMU after a simulation run. The FMU goes into the same state as if fmi2Instantiate would have been called.All variables have their default values. Before starting a new run, fmi2SetupExperiment and fmi2EnterInitializationMode have to be called.
Arguments
c::FMU2Component
: Argumentc
is a Mutable struct represents an instantiated instance of an FMU in the FMI 2.0.2 Standard.
Keywords
soft::Bool=false
: If the Keywordsoft = true
the command is only performed if the FMU is in an allowed state for this command.
Returns
status::fmi2Status
: Returnstatus
is an enumeration of typefmi2Status
and indicates the success of the function call.
More detailed:
fmi2OK
: all wellfmi2Warning
: things are not quite right, but the computation can continuefmi2Discard
: if the slave computed successfully only a subinterval of the communication stepfmi2Error
: the communication step could not be carried out at allfmi2Fatal
: if an error occurred which corrupted the FMU irreparablyfmi2Pending
: this status is returned if the slave executes the function asynchronously
Source
- FMISpec2.0.3 Link: https://fmi-standard.org/
- FMISpec2.0.3[p.16]: 2.1.2 Platform Dependent Definitions (fmi2TypesPlatform.h)
- FMISpec2.0.3[p.18]: 2.1.3 Status Returned by Functions
- FMISpec2.0.3[p.22]: 2.1.6 Initialization, Termination, and Resetting an FMU
See also fmi2Terminate
.
FMICore.fmi2SerializeFMUstate!
— Methodfmi2SerializeFMUstate!(c::FMU2Component, FMUstate::fmi2FMUstate, serialzedState::AbstractArray{fmi2Byte}, size::Csize_t)
Serializes the data which is referenced by pointer FMUstate
and copies this data in to the byte vector serializedState
of length size
, that must be provided by the environment.
Arguments
str::FMU2Component
: Mutable struct represents an instantiated instance of an FMU in the FMI 2.0.2 Standard.state::fmi2FMUstate
: Argumentstate
is a pointer to a data structure in the FMU that saves the internal FMU state of the actual or a previous time instant.serialzedState::AbstractArray{fmi2Byte}
: ArgumentserializedState
contains the copy of the serialized data referenced by the pointer FMUstate.size::Csize_t
: Argumentsize
defines the length of the serialized vector.
Returns
status::fmi2Status
: Returnstatus
is an enumeration of typefmi2Status
and indicates the success of the function call.
More detailed:
fmi2OK
: all wellfmi2Warning
: things are not quite right, but the computation can continuefmi2Discard
: if the slave computed successfully only a subinterval of the communication stepfmi2Error
: the communication step could not be carried out at allfmi2Fatal
: if an error occurred which corrupted the FMU irreparablyfmi2Pending
: this status is returned if the slave executes the function asynchronously
Source
- FMISpec2.0.2 Link: https://fmi-standard.org/
- FMISpec2.0.2[p.16]: 2.1.2 Platform Dependent Definitions (fmi2TypesPlatform.h)
- FMISpec2.0.2[p.16]: 2.1.3 Status Returned by Functions
- FMISpec2.0.2[p.25]: 2.1.8 Getting and Setting the Complete FMU State
See also fmi2SerializeFMUstate
.
FMICore.fmi2SerializedFMUstateSize!
— Methodfmi2SerializedFMUstateSize!(c::FMU2Component, FMUstate::fmi2FMUstate, size::Ref{Csize_t})
Stores the size of the byte vector in the given referenced Address, in order that FMUstate can be stored in it.
Argument
c::FMU2Component
: Mutable struct represents an instantiated instance of an FMU in the FMI 2.0.2 Standard.FMUstate::fmi2FMUstate
: ArgumentFMUstate
is a pointer to a data structure in the FMU that saves the internal FMU state of the actual or a previous time instant.size::Ref{Csize_t}
: Argumentsize
is an object that safely references a value of typeCsize_t
and defines the size of the byte vector in which the FMUstate can be stored.
Returns
status::fmi2Status
: Returnstatus
is an enumeration of typefmi2Status
and indicates the success of the function call.
More detailed:
fmi2OK
: all wellfmi2Warning
: things are not quite right, but the computation can continuefmi2Discard
: if the slave computed successfully only a subinterval of the communication stepfmi2Error
: the communication step could not be carried out at allfmi2Fatal
: if an error occurred which corrupted the FMU irreparablyfmi2Pending
: this status is returned if the slave executes the function asynchronously
Source
- FMISpec2.0.2 Link: https://fmi-standard.org/
- FMISpec2.0.2[p.16]: 2.1.2 Platform Dependent Definitions (fmi2TypesPlatform.h)
- FMISpec2.0.2[p.16]: 2.1.3 Status Returned by Functions
- FMISpec2.0.2[p.25]: 2.1.8 Getting and Setting the Complete FMU State
See also fmi2SerializedFMUstateSize!
.
FMICore.fmi2SetBoolean
— Methodfmi2SetBoolean(c::FMU2Component, vr::AbstractArray{fmi2ValueReference}, nvr::Csize_t, value::AbstractArray{fmi2Boolean})
Functions to get and set values of variables idetified by their valueReference
Arguments
c::FMU2Component
: Mutable struct represents an instantiated instance of an FMU in the FMI 2.0.2 Standard.vr::AbstractArray{fmi2ValueReference}
: Argumentvr
is an array ofnvr
value handels called "ValueReference" that define the variable that shall be inquired.nvr::Csize_t
: Argumentnvr
defines the size ofvr
.value::AbstractArray{fmi2Boolean}
: Argumentvalues
is an array with the actual values of these variables.
Returns
status::fmi2Status
: Returnstatus
is an enumeration of typefmi2Status
and indicates the success of the function call.
More detailed:
fmi2OK
: all wellfmi2Warning
: things are not quite right, but the computation can continuefmi2Discard
: if the slave computed successfully only a subinterval of the communication stepfmi2Error
: the communication step could not be carried out at allfmi2Fatal
: if an error occurred which corrupted the FMU irreparablyfmi2Pending
: this status is returned if the slave executes the function asynchronously
Source
- FMISpec2.0.2 Link: https://fmi-standard.org/
- FMISpec2.0.2[p.24]: 2.1.7 Getting and Setting Variable Values
- FMISpec2.0.2[p.16]: 2.1.2 Platform Dependent Definitions
- FMISpec2.0.2[p.18]: 2.1.3 Status Returned by Functions
See also fmi2GetBoolean
.
FMICore.fmi2SetBoolean
— Methodfmi2SetBoolean(c::FMU2Component, vr::fmi2ValueReferenceFormat, values::Union{AbstractArray{Bool}, Bool})
Set the values of an array of boolean variables
Arguments
c::FMU2Component
: Mutable struct represents an instantiated instance of an FMU in the FMI 2.0.2 Standard.vr::fmi2ValueReferenceFormat
: Argumentvr
defines the value references of the variables.
More detailed: fmi2ValueReferenceFormat = Union{Nothing, String, Array{String,1}, fmi2ValueReference, Array{fmi2ValueReference,1}, Int64, Array{Int64,1}, Symbol}
values::Union{Array{Bool}, Bool}
: Argumentvalues
is an array or a single value with type Boolean or any subtyp
Returns
status::fmi2Status
: Returnstatus
is an enumeration of typefmi2Status
and indicates the success of the function call.
More detailed:
fmi2OK
: all wellfmi2Warning
: things are not quite right, but the computation can continuefmi2Discard
: if the slave computed successfully only a subinterval of the communication stepfmi2Error
: the communication step could not be carried out at allfmi2Fatal
: if an error occurred which corrupted the FMU irreparablyfmi2Pending
: this status is returned if the slave executes the function asynchronously
Source
- FMISpec2.0.2 Link: https://fmi-standard.org/
- FMISpec2.0.2[p.24]: 2.1.7 Getting and Setting Variable Values
- FMISpec2.0.2[p.16]: 2.1.2 Platform Dependent Definitions
- FMISpec2.0.2[p.18]: 2.1.3 Status Returned by Functions
See also fmi2GetBoolean!
.
FMICore.fmi2SetContinuousStates
— MethodfmiSetContinuousStates(c::FMU2Component,
x::Union{AbstractArray{Float32},AbstractArray{Float64}})
Set a new (continuous) state vector and reinitialize chaching of variables that depend on states.
Arguments
c::FMU2Component
: Mutable struct represents an instantiated instance of an FMU in the FMI 2.0.2 Standard.x::Union{AbstractArray{Float32},AbstractArray{Float64}}
:Argumentx
is theAbstractArray
of the vector values ofFloat64
orFloat32
.
Returns
status::fmi2Status
: Returnstatus
is an enumeration of typefmi2Status
and indicates the success of the function call.
More detailed:
fmi2OK
: all wellfmi2Warning
: things are not quite right, but the computation can continuefmi2Discard
: if the slave computed successfully only a subinterval of the communication stepfmi2Error
: the communication step could not be carried out at allfmi2Fatal
: if an error occurred which corrupted the FMU irreparablyfmi2Pending
: this status is returned if the slave executes the function asynchronously
Source
- FMISpec2.0.2 Link: https://fmi-standard.org/
- FMISpec2.0.2[p.16]: 2.1.2 Platform Dependent Definitions (fmi2TypesPlatform.h)
- FMISpec2.0.2[p.16]: 2.1.3 Status Returned by Functions
- FMISpec2.0.2[p.83]: 3.2.1 Providing Independent Variables and Re-initialization of Caching
See also fmi2SetContinuousStates
.
FMICore.fmi2SetDebugLogging
— Methodfmi2SetDebugLogging(c::FMU2Component, logginOn::fmi2Boolean, nCategories::Unsigned, categories::Ptr{Nothing})
Control the use of the logging callback function, version independent.
Arguments
c::FMU2Component
: Argumentc
is a Mutable struct represents an instantiated instance of an FMU in the FMI 2.0.2 Standard.logginOn::fmi2Boolean
: IfloggingOn = fmi2True
, debug logging is enabled for the log categories specified in categories, otherwise it is disabled. Typefmi2Boolean
is defined as an alias Type for the C-Type Boolean and is to be used withfmi2True
andfmi2False
.nCategories::Unsigned
: ArgumentnCategories
defines the length of the argumentcategories
.categories::Ptr{Nothing}
:
Returns
status::fmi2Status
: Returnstatus
is an enumeration of typefmi2Status
and indicates the success of the function call.
More detailed:
fmi2OK
: all wellfmi2Warning
: things are not quite right, but the computation can continuefmi2Discard
: if the slave computed successfully only a subinterval of the communication stepfmi2Error
: the communication step could not be carried out at allfmi2Fatal
: if an error occurred which corrupted the FMU irreparablyfmi2Pending
: this status is returned if the slave executes the function asynchronously
Source
- FMISpec2.0.2 Link: https://fmi-standard.org/
- FMISpec2.0.2[p.22]: 2.1.2 Platform Dependent Definitions (fmi2TypesPlatform.h)
- FMISpec2.0.2[p.22]: 2.1.3 Status Returned by Functions
- FMISpec2.0.2[p.22]: 2.1.5 Creation, Destruction and Logging of FMU Instances
See also fmi2SetDebugLogging
.
FMICore.fmi2SetDebugLogging
— Methodfmi2SetDebugLogging(c::FMU2Component)
Control the use of the logging callback function, version independent.
Arguments
c::FMU2Component
: Argumentc
is a mutable struct representing an instantiated instance of an FMU in the FMI 2.0.2 Standard.
Returns
status::fmi2Status
: Returnstatus
is an enumeration of typefmi2Status
and indicates the success of the function call.
More detailed:
fmi2OK
: all wellfmi2Warning
: things are not quite right, but the computation can continuefmi2Discard
: if the slave computed successfully only a subinterval of the communication stepfmi2Error
: the communication step could not be carried out at allfmi2Fatal
: if an error occurred which corrupted the FMU irreparablyfmi2Pending
: this status is returned if the slave executes the function asynchronously
Source
- FMISpec2.0.2 Link: https://fmi-standard.org/
- FMISpec2.0.2[p.22]: 2.1.2 Platform Dependent Definitions (fmi2TypesPlatform.h)
- FMISpec2.0.2[p.22]: 2.1.3 Status Returned by Functions
- FMISpec2.0.2[p.22]: 2.1.5 Creation, Destruction and Logging of FMU Instances
See also fmi2SetDebugLogging
.
FMICore.fmi2SetFMUstate
— Methodfmi2SetFMUstate(c::FMU2Component, FMUstate::fmi2FMUstate)
Copies the content of the previously copied FMUstate back and uses it as actual new FMU state.
Arguments
str::fmi2Struct
: Representative for an FMU in the FMI 2.0.2 Standard.
More detailed: fmi2Struct = Union{FMU2, FMU2Component}
str::FMU2
: Mutable struct representing a FMU and all it instantiated instances in the FMI 2.0.2 Standard.str::FMU2Component
: Mutable struct represents an instantiated instance of an FMU in the FMI 2.0.2 Standard.FMUstate::fmi2FMUstate
: ArgumentFMUstate
is a pointer to a data structure in the FMU that saves the internal FMU state of the actual or a previous time instant.
Returns
status::fmi2Status
: Returnstatus
is an enumeration of typefmi2Status
and indicates the success of the function call.
More detailed:
fmi2OK
: all wellfmi2Warning
: things are not quite right, but the computation can continuefmi2Discard
: if the slave computed successfully only a subinterval of the communication stepfmi2Error
: the communication step could not be carried out at allfmi2Fatal
: if an error occurred which corrupted the FMU irreparablyfmi2Pending
: this status is returned if the slave executes the function asynchronously
Source
- FMISpec2.0.2 Link: https://fmi-standard.org/
- FMISpec2.0.2[p.16]: 2.1.2 Platform Dependent Definitions (fmi2TypesPlatform.h)
- FMISpec2.0.2[p.16]: 2.1.3 Status Returned by Functions
- FMISpec2.0.2[p.25]: 2.1.8 Getting and Setting the Complete FMU State
See also fmi2GetFMUstate
.
FMICore.fmi2SetInteger
— Methodfmi2SetInteger(c::FMU2Component, vr::AbstractArray{fmi2ValueReference}, nvr::Csize_t, value::AbstractArray{fmi2Integer})
Set the values of an array of integer variables
Arguments
c::FMU2Component
: Mutable struct represents an instantiated instance of an FMU in the FMI 2.0.2 Standard.vr::AbstractArray{fmi2ValueReference}
: Argumentvr
is an AbstractArray ofnvr
value handels, called "ValueReference" that define the variable that shall be inquired.nvr::Csize_t
: Argumentnvr
defines the size ofvr
.values::AbstractArray{fmi2Integer}
: Argumentvalues
is an AbstractArray with the actual values of these variables.
Returns
status::fmi2Status
: Returnstatus
is an enumeration of typefmi2Status
and indicates the success of the function call.
More detailed:
fmi2OK
: all wellfmi2Warning
: things are not quite right, but the computation can continuefmi2Discard
: if the slave computed successfully only a subinterval of the communication stepfmi2Error
: the communication step could not be carried out at allfmi2Fatal
: if an error occurred which corrupted the FMU irreparablyfmi2Pending
: this status is returned if the slave executes the function asynchronously
Source
- FMISpec2.0.2 Link: https://fmi-standard.org/
- FMISpec2.0.2[p.24]: 2.1.7 Getting and Setting Variable Values
- FMISpec2.0.2[p.16]: 2.1.2 Platform Dependent Definitions
- FMISpec2.0.2[p.18]: 2.1.3 Status Returned by Functions
See also fmi2GetInteger!
.
FMICore.fmi2SetInteger
— Methodfmi2SetInteger(c::FMU2Component, vr::fmi2ValueReferenceFormat, values::Union{AbstractArray{<:Integer}, <:Integer})
Set the values of an array of integer variables
Arguments
c::fmi2Struct
: Representative for an FMU in the FMI 2.0.2 Standard.
More detailed: fmi2Struct = Union{FMU2, FMU2Component}
c::FMU2
: Mutable struct representing a FMU and all it instantiated instances in the FMI 2.0.2 Standard.c::FMU2Component
: Mutable struct represents an instantiated instance of an FMU in the FMI 2.0.2 Standard.vr::fmi2ValueReferenceFormat
: Argumentvr
defines the value references of the variables.
More detailed: fmi2ValueReferenceFormat = Union{Nothing, String, Array{String,1}, fmi2ValueReference, Array{fmi2ValueReference,1}, Int64, Array{Int64,1}, Symbol}
vr::Array{fmi2ValueReference}
: Argumentvr
is an array ofnvr
value handels called "ValueReference" that define the variable that shall be inquired.values::Union{Array{<:Integer}, <:Integer}
: Argumentvalues
is an array or a single value with type Integer or any subtyp
Returns
status::fmi2Status
: Returnstatus
indicates the success of the function call.
Source
- FMISpec2.0.2 Link: https://fmi-standard.org/
- FMISpec2.0.2[p.24]: 2.1.7 Getting and Setting Variable Values
- FMISpec2.0.2[p.16]: 2.1.2 Platform Dependent Definitions
- FMISpec2.0.2[p.18]: 2.1.3 Status Returned by Functions
See also fmi2SetInteger
.
FMICore.fmi2SetReal
— Methodfmi2SetReal(c::FMU2Component, vr::AbstractArray{fmi2ValueReference}, nvr::Csize_t, value::AbstractArray{fmi2Real})
Functions to get and set values of variables idetified by their valueReference
Arguments
c::FMU2Component
: Mutable struct represents an instantiated instance of an FMU in the FMI 2.0.2 Standard.vr::AbstractArray{fmi2ValueReference}
: Argumentvr
is an AbstractArray ofnvr
value handels, called "ValueReference" that define the variable that shall be inquired.nvr::Csize_t
: Argumentnvr
defines the size ofvr
.values::AbstractArray{fm2Real}
: Argumentvalues
is an AbstractArray with the actual values of these variables.
Returns
status::fmi2Status
: Returnstatus
is an enumeration of typefmi2Status
and indicates the success of the function call.
More detailed:
fmi2OK
: all wellfmi2Warning
: things are not quite right, but the computation can continuefmi2Discard
: if the slave computed successfully only a subinterval of the communication stepfmi2Error
: the communication step could not be carried out at allfmi2Fatal
: if an error occurred which corrupted the FMU irreparablyfmi2Pending
: this status is returned if the slave executes the function asynchronously
Source
- FMISpec2.0.2 Link: https://fmi-standard.org/
- FMISpec2.0.2[p.18]: 2.1.3 Status Returned by Functions
- FMISpec2.0.2[p.24]: 2.1.7 Getting and Setting Variable Values
See also fmi2GetReal
.
FMICore.fmi2SetReal
— Methodfmi2SetReal(c::FMU2Component, vr::fmi2ValueReferenceFormat, values::Union{AbstractArray{<:Real}, <:Real})
Set the values of an array of real variables
Arguments
c::fmi2Struct
: Representative for an FMU in the FMI 2.0.2 Standard.
More detailed: fmi2Struct = Union{FMU2, FMU2Component}
c::FMU2
: Mutable struct representing a FMU and all it instantiated instances in the FMI 2.0.2 Standard.c::FMU2Component
: Mutable struct represents an instantiated instance of an FMU in the FMI 2.0.2 Standard.vr::fmi2ValueReferenceFormat
: Wildcards for how a user can pass a fmi[X]ValueReference
More detailed: fmi2ValueReferenceFormat = Union{Nothing, String, Array{String,1}, fmi2ValueReference, Array{fmi2ValueReference,1}, Int64, Array{Int64,1}, Symbol}
values::Union{Array{<:Real}, <:Real}
: Argumentvalues
is an array with the actual values of these variables.
Returns
status::fmi2Status
: Returnstatus
is an enumeration of typefmi2Status
and indicates the success of the function call.
More detailed:
fmi2OK
: all wellfmi2Warning
: things are not quite right, but the computation can continuefmi2Discard
: if the slave computed successfully only a subinterval of the communication stepfmi2Error
: the communication step could not be carried out at allfmi2Fatal
: if an error occurred which corrupted the FMU irreparablyfmi2Pending
: this status is returned if the slave executes the function asynchronously
Source
- FMISpec2.0.2 Link: https://fmi-standard.org/
- FMISpec2.0.2[p.24]: 2.1.7 Getting and Setting Variable Values
- FMISpec2.0.2[p.16]: 2.1.2 Platform Dependent Definitions
- FMISpec2.0.2[p.18]: 2.1.3 Status Returned by Functions
See also fmi2SetReal
.
FMICore.fmi2SetRealInputDerivatives
— Methodfmi2SetRealInputDerivatives(c::FMU2Component,
vr::AbstractArray{fmi2ValueReference},
nvr::Csize_t,
order::AbstractArray{fmi2Integer},
value::AbstractArray{fmi2Real})
Sets the n-th time derivative of real input variables.
Arguments
c::FMU2Component
: Mutable struct represents an instantiated instance of an FMU in the FMI 2.0.2 Standard.vr::Array{fmi2ValueReference}
: Argumentvr
is an array ofnvr
value handels called "ValueReference" that t define the variables whose derivatives shall be set.nvr::Csize_t
: Argumentnvr
defines the size ofvr
.order::AbstractArray{fmi2Integer}
: Argumentorder
is an AbstractArray of fmi2Integer values witch specifys the corresponding order of derivative of the real input variable.values::AbstractArray{fmi2Real}
: Argumentvalues
is an AbstractArray with the actual values of these variables.
Returns
status::fmi2Status
: Returnstatus
is an enumeration of typefmi2Status
and indicates the success of the function call.
More detailed:
fmi2OK
: all wellfmi2Warning
: things are not quite right, but the computation can continuefmi2Discard
: if the slave computed successfully only a subinterval of the communication stepfmi2Error
: the communication step could not be carried out at allfmi2Fatal
: if an error occurred which corrupted the FMU irreparablyfmi2Pending
: this status is returned if the slave executes the function asynchronously
Source
- FMISpec2.0.2 Link: https://fmi-standard.org/
- FMISpec2.0.2[p.16]: 2.1.2 Platform Dependent Definitions
- FMISpec2.0.2[p.18]: 2.1.3 Status Returned by Functions
- FMISpec2.0.2[p.104]: 4.2.1 Transfer of Input / Output Values and Parameters
See also fmi2SetRealInputDerivatives
.
FMICore.fmi2SetRealInputDerivatives
— Methodfmi2SetRealInputDerivatives(c::FMU2Component,
vr::AbstractArray{fmi2ValueReference},
order::AbstractArray{fmi2Integer},
values::AbstractArray{fmi2Real})
Sets the n-th time derivative of real input variables.
Arguments
c::FMU2Component
: Mutable struct represents an instantiated instance of an FMU in the FMI 2.0.2 Standard.vr::Array{fmi2ValueReference}
: Argumentvr
is an array ofnvr
value handels called "ValueReference" that define the variables whose derivatives shall be set.order::AbstractArray{fmi2Integer}
: Argumentorder
is an AbstractArray of fmi2Integer values witch specifys the corresponding order of derivative of the real input variable.values::AbstractArray{fmi2Real}
: Argumentvalues
is an AbstractArray with the actual values of these variables.
Returns
status::fmi2Status
: Returnstatus
is an enumeration of typefmi2Status
and indicates the success of the function call.
More detailed:
fmi2OK
: all wellfmi2Warning
: things are not quite right, but the computation can continuefmi2Discard
: if the slave computed successfully only a subinterval of the communication stepfmi2Error
: the communication step could not be carried out at allfmi2Fatal
: if an error occurred which corrupted the FMU irreparablyfmi2Pending
: this status is returned if the slave executes the function asynchronously
Source
- FMISpec2.0.2 Link: https://fmi-standard.org/
- FMISpec2.0.2[p.16]: 2.1.2 Platform Dependent Definitions
- FMISpec2.0.2[p.18]: 2.1.3 Status Returned by Functions
- FMISpec2.0.2[p.104]: 4.2.1 Transfer of Input / Output Values and Parameters
See also fmi2SetRealInputDerivatives
.
FMICore.fmi2SetString
— Methodfmi2SetString(c::FMU2Component, vr::AbstractArray{fmi2ValueReference}, nvr::Csize_t, value::Union{AbstractArray{Ptr{Cchar}}, AbstractArray{Ptr{UInt8}}})
Set the values of an array of string variables
For the exact rules on which type of variables fmi2SetXXX can be called see FMISpec2.0.2 section 2.2.7 , as well as FMISpec2.0.2 section 3.2.3 in case of ModelExchange and FMISpec2.0.2 section 4.2.4 in case ofCoSimulation.
Arguments
str::FMU2Component
: Mutable struct represents an instantiated instance of an FMU in the FMI 2.0.2 Standard.vr::AbstractArray{fmi2ValueReference}
: Argumentvr
is an array ofnvr
value handels called "ValueReference" that define the variable that shall be inquired.nvr::Csize_t
: Argumentnvr
defines the size ofvr
.value::Union{AbstractArray{Ptr{Cchar}, AbstractArray{Ptr{UInt8}}}
: Thevalue
argument is an AbstractArray of values whose memory address refers to data of type Cchar or UInt8and describes a vector with the actual values of these. variables.
Returns
status::fmi2Status
: Returnstatus
is an enumeration of typefmi2Status
and indicates the success of the function call.
More detailed:
fmi2OK
: all wellfmi2Warning
: things are not quite right, but the computation can continuefmi2Discard
: if the slave computed successfully only a subinterval of the communication stepfmi2Error
: the communication step could not be carried out at allfmi2Fatal
: if an error occurred which corrupted the FMU irreparablyfmi2Pending
: this status is returned if the slave executes the function asynchronously
Source
- FMISpec2.0.2 Link: https://fmi-standard.org/
- FMISpec2.0.2[p.16]: 2.1.2 Platform Dependent Definitions
- FMISpec2.0.2[p.18]: 2.1.3 Status Returned by Functions
- FMISpec2.0.2[p.24]: 2.1.7 Getting and Setting Variable Values
See also fmi2GetString!
.
FMICore.fmi2SetString
— Methodfmi2SetString(c::FMU2Component, vr::fmi2ValueReferenceFormat, values::Union{AbstractArray{String}, String})
Set the values of an array of string variables
For the exact rules on which type of variables fmi2SetXXX can be called see FMISpec2.0.2 section 2.2.7 , as well as FMISpec2.0.2 section 3.2.3 in case of ModelExchange and FMISpec2.0.2 section 4.2.4 in case of CoSimulation.
Arguments
c::FMU2Component
: Mutable struct represents an instantiated instance of an FMU in the FMI 2.0.2 Standard.vr::fmi2ValueReferenceFormat
: Argumentvr
defines the value references of the variables.
More detailed: fmi2ValueReferenceFormat = Union{Nothing, String, Array{String,1}, fmi2ValueReference, Array{fmi2ValueReference,1}, Int64, Array{Int64,1}, Symbol}
values::Union{Array{String}, String}
: Argumentvalues
is an array or a single value with type String.
Returns
status::fmi2Status
: Returnstatus
is an enumeration of typefmi2Status
and indicates the success of the function call.
More detailed:
fmi2OK
: all wellfmi2Warning
: things are not quite right, but the computation can continuefmi2Discard
: if the slave computed successfully only a subinterval of the communication stepfmi2Error
: the communication step could not be carried out at allfmi2Fatal
: if an error occurred which corrupted the FMU irreparablyfmi2Pending
: this status is returned if the slave executes the function asynchronously
Source
- FMISpec2.0.2 Link: https://fmi-standard.org/
- FMISpec2.0.2[p.16]: 2.1.2 Platform Dependent Definitions
- FMISpec2.0.2[p.18]: 2.1.3 Status Returned by Functions
- FMISpec2.0.2[p.24]: 2.1.7 Getting and Setting Variable Values
- FMISpec2.0.2[p.46]: 2.2.7 Definition of Model Variables
- FMISpec2.0.2[p.46]: 3.2.3 State Machine of Calling Sequence
- FMISpec2.0.2[p.108]: 4.2.4 State Machine of Calling Sequence from Master to Slave
See also fmi2SetString
.
FMICore.fmi2SetTime
— Methodfmi2SetTime(c::FMU2Component,
time::fmi2Real;
soft::Bool=false,
track::Bool=true,
force::Bool=c.fmu.executionConfig.force,
time_shift::Bool=c.fmu.executionConfig.autoTimeShift)
Set a new time instant and re-initialize caching of variables that depend on time, provided the newly provided time value is different to the previously set time value (variables that depend solely on constants or parameters need not to be newly computed in the sequel, but the previously computed values can be reused).
Arguments
c::FMU2Component
: Mutable struct represents an instantiated instance of an FMU in the FMI 2.0.2 Standard.time::fmi2Real
: Argumenttime
contains a value of typefmi2Real
which is a alias type forReal
data type.time
sets the independent variable time t.
Keywords
soft::Bool=false
: If the Keywordsoft = true
the command is only performed if the FMU is in an allowed state for this command.
-track::Bool=true
: If the Keyword track = true
time_shift::Bool=c.fmu.executionConfig.autoTimeShift
:
Returns
status::fmi2Status
: Returnstatus
is an enumeration of typefmi2Status
and indicates the success of the function call.
More detailed:
fmi2OK
: all wellfmi2Warning
: things are not quite right, but the computation can continuefmi2Discard
: if the slave computed successfully only a subinterval of the communication stepfmi2Error
: the communication step could not be carried out at allfmi2Fatal
: if an error occurred which corrupted the FMU irreparablyfmi2Pending
: this status is returned if the slave executes the function asynchronously
Source
- FMISpec2.0.2 Link: https://fmi-standard.org/
- FMISpec2.0.2[p.16]: 2.1.2 Platform Dependent Definitions (fmi2TypesPlatform.h)
- FMISpec2.0.2[p.16]: 2.1.3 Status Returned by Functions
- FMISpec2.0.2[p.83]: 3.2.1 Providing Independent Variables and Re-initialization of Caching
See also fmi2SetTime
.
FMICore.fmi2SetTime
— MethodfmiSetTime(c::FMU2Component, t::Real)
Set a new time instant and re-initialize caching of variables that depend on time.
Arguments
c::FMU2Component
: Mutable struct represents an instantiated instance of an FMU in the FMI 2.0.2 Standard.t::Real
: Argumentt
contains a value of typeReal
.t
sets the independent variable time t.
Returns
status::fmi2Status
: Returnstatus
is an enumeration of typefmi2Status
and indicates the success of the function call.
More detailed:
fmi2OK
: all wellfmi2Warning
: things are not quite right, but the computation can continuefmi2Discard
: if the slave computed successfully only a subinterval of the communication stepfmi2Error
: the communication step could not be carried out at allfmi2Fatal
: if an error occurred which corrupted the FMU irreparablyfmi2Pending
: this status is returned if the slave executes the function asynchronously
Source
- FMISpec2.0.2 Link: https://fmi-standard.org/
- FMISpec2.0.2[p.16]: 2.1.2 Platform Dependent Definitions (fmi2TypesPlatform.h)
- FMISpec2.0.2[p.16]: 2.1.3 Status Returned by Functions
- FMISpec2.0.2[p.83]: 3.2.1 Providing Independent Variables and Re-initialization of Caching
See also fmi2SetTime
FMICore.fmi2SetupExperiment
— Functionfmi2SetupExperiment(c::FMU2Component,
startTime::Union{Real, Nothing} = nothing,
stopTime::Union{Real, Nothing} = nothing;
tolerance::Union{Real, Nothing} = nothing)
Setup the simulation but without defining all of the parameters.
Arguments
c::fmi2Struct
: Representative for an FMU in the FMI 2.0.2 Standard.
More detailed: fmi2Struct = Union{FMU2, FMU2Component}
c::FMU2
: Mutable struct representing a FMU and all it instantiated instances in the FMI 2.0.2 Standard.c::FMU2Component
: Mutable struct representing an instantiated instance of an FMU in the FMI 2.0.2 Standard.startTime::Union{Real, Nothing} = nothing
:startTime
is a real number which sets the value of starting time of the experiment. The default value is set automatically if doing nothing (default =nothing
).stopTime::Union{Real, Nothing} = nothing
:stopTime
is a real number which sets the value of ending time of the experiment. The default value is set automatically if doing nothing (default =nothing
).
Keywords
tolerance::Union{Real, Nothing} = nothing
:tolerance
is a real number which sets the value of tolerance range. The default value is set automatically if doing nothing (default =nothing
).
Returns
- Returns a warning if
str.state
is not called infmi2ComponentStateInstantiated
. status::fmi2Status
: Returnstatus
is an enumeration of typefmi2Status
and indicates the success of the function call.
More detailed:
fmi2OK
: all wellfmi2Warning
: things are not quite right, but the computation can continuefmi2Discard
: if the slave computed successfully only a subinterval of the communication stepfmi2Error
: the communication step could not be carried out at allfmi2Fatal
: if an error occurred which corrupted the FMU irreparablyfmi2Pending
: this status is returned if the slave executes the function asynchronously
Source
- FMISpec2.0.2 Link: https://fmi-standard.org/
- FMISpec2.0.2[p.23]: 2.1.6 Initialization, Termination, and Resetting an FMU
- FMISpec2.0.2[p.18]: 2.1.3 Status Returned by Functions
See also fmi2SetupExperiment
.
FMICore.fmi2SetupExperiment
— Methodfmi2SetupExperiment(c::FMU2Component, toleranceDefined::fmi2Boolean, tolerance::fmi2Real, startTime::fmi2Real, stopTimeDefined::fmi2Boolean, stopTime::fmi2Real)
Informs the FMU to setup the experiment. This function must be called after fmi2Instantiate
and before fmi2EnterInitializationMode
is called.
Arguments
c::FMU2Component
: Argumentc
is a Mutable struct represents an instantiated instance of an FMU in the FMI 2.0.2 Standard.toleranceDefined::fmi2Boolean
: ArgumentstoleranceDefined
depend on the FMU type:- fmuType = fmi2ModelExchange: If
toleranceDefined = fmi2True
, then the model is called with a numerical integration scheme where the step size is controlled by usingtolerance
for error estimation. In such a case, all numerical algorithms used inside the model (for example, to solve non-linear algebraic equations) should also operate with an error estimation of an appropriate smaller relative tolerance. - fmuType = fmi2CoSimulation: If
toleranceDefined = fmi2True
, then the communication interval of the slave is controlled by error estimation. In case the slave utilizes a numerical integrator with variable step size and error estimation, it is suggested to use “tolerance” for the error estimation of the internal integrator (usually as relative tolerance). An FMU for Co-Simulation might ignore this argument.
- fmuType = fmi2ModelExchange: If
startTime::fmi2Real
: ArgumentstartTime
can be used to check whether the model is valid within the given boundaries or to allocate memory which is necessary for storing results. It is the fixed initial value of the independent variable and if the independent variable istime
,startTime
is the starting time of initializaton.stopTimeDefined::fmi2Boolean
: IfstopTimeDefined = fmi2True
, then stopTime is the defined final value of the independent variable and ifstopTimeDefined = fmi2False
, then no final value
of the independent variable is defined and argument stopTime
is meaningless.
stopTime::fmi2Real
: ArgumentstopTime
can be used to check whether the model is valid within the given boundaries or to allocate memory which is necessary for storing results. It is the fixed final value of the independent variable and if the independent variable is “time”, stopTime is the stop time of the simulation.
Returns
status::fmi2Status
: Returnstatus
is an enumeration of typefmi2Status
and indicates the success of the function call.
More detailed:
fmi2OK
: all wellfmi2Warning
: things are not quite right, but the computation can continuefmi2Discard
: if the slave computed successfully only a subinterval of the communication stepfmi2Error
: the communication step could not be carried out at allfmi2Fatal
: if an error occurred which corrupted the FMU irreparablyfmi2Pending
: this status is returned if the slave executes the function asynchronously
Source
- FMISpec2.0.2 Link: https://fmi-standard.org/
- FMISpec2.0.2[p.22]: 2.1.2 Platform Dependent Definitions (fmi2TypesPlatform.h)
- FMISpec2.0.2[p.22]: 2.1.3 Status Returned by Functions
- FMISpec2.0.2[p.22]: 2.1.6 Initialization, Termination, and Resetting an FMU
See also fmi2SetupExperiment
.
FMICore.fmi2Terminate
— Methodfmi2Terminate(c::FMU2Component; soft::Bool=false)
Informs the FMU that the simulation run is terminated.
Arguments
c::FMU2Component
: Argumentc
is a Mutable struct represents an instantiated instance of an FMU in the FMI 2.0.2 Standard.
Keywords
soft::Bool=false
: If the Keywordsoft = true
the command is only performed if the FMU is in an allowed state for this command.
Returns
status::fmi2Status
: Returnstatus
is an enumeration of typefmi2Status
and indicates the success of the function call.
More detailed:
fmi2OK
: all wellfmi2Warning
: things are not quite right, but the computation can continuefmi2Discard
: if the slave computed successfully only a subinterval of the communication stepfmi2Error
: the communication step could not be carried out at allfmi2Fatal
: if an error occurred which corrupted the FMU irreparablyfmi2Pending
: this status is returned if the slave executes the function asynchronously
Source
- FMISpec2.0.2 Link: https://fmi-standard.org/
- FMISpec2.0.2[p.22]: 2.1.2 Platform Dependent Definitions (fmi2TypesPlatform.h)
- FMISpec2.0.2[p.22]: 2.1.3 Status Returned by Functions
- FMISpec2.0.2[p.22]: 2.1.6 Initialization, Termination, and Resetting an FMU
See also fmi2Terminate
.
FMICore.fmi3ActivateModelPartition
— Methodfmi3ActivateModelPartition(c::FMU3Instance, vr::fmi3ValueReference, activationTime::AbstractArray{fmi3Float64})
During Clock Activation Mode (see 5.2.2.) after fmi3ActivateModelPartition
has been called for a calculated, tunable or changing Clock the FMU provides the information on when the Clock will tick again, i.e. when the corresponding model partition has to be scheduled the next time.
Each fmi3ActivateModelPartition
call is associated with the computation of an exposed model partition of the FMU and therefore to an input Clock.
TODO argmuents
Arguments
c::FMU3Instance
: Argumentc
is a Mutable struct represents an instantiated instance of an FMU in the FMI 3.0 Standard.vr::fmi3ValueReference
: Argumentvr
is the value handel called "ValueReference" that define the variable that shall be inquired.activationTime::AbstractArray{fmi3Float64}
:
Returns
status::fmi3Status
: Returnstatus
is an enumeration of typefmi3Status
and indicates the success of the function call.
More detailed:
fmi3OK
: all wellfmi3Warning
: things are not quite right, but the computation can continuefmi3Discard
: if the slave computed successfully only a subinterval of the communication stepfmi3Error
: the communication step could not be carried out at allfmi3Fatal
: if an error occurred which corrupted the FMU irreparably
Source
- FMISpec3.0 Link: https://fmi-standard.org/
- FMISpec3.0: 2.2.3 Platform Dependent Definitions
- FMISpec3.0: 2.2.4 Status Returned by Functions
- FMISpec3.0: 5.2.2. State: Clock Activation Mode
See also fmi3ActivateModelPartition
.
FMICore.fmi3CompletedIntegratorStep!
— Methodfmi3CompletedIntegratorStep!(c::FMU3Instance,
noSetFMUStatePriorToCurrentPoint::fmi3Boolean,
enterEventMode::Ref{fmi3Boolean},
terminateSimulation::Ref{fmi3Boolean})
This function must be called by the environment after every completed step of the integrator provided the capability flag needsCompletedIntegratorStep == true
. If enterEventMode == fmi3True
, the event mode must be entered If terminateSimulation == fmi3True
, the simulation shall be terminated
Arguments
c::FMU3Instance
: Mutable struct represents an instantiated instance of an FMU in the FMI 3.0 Standard.noSetFMUStatePriorToCurrentPoint::fmi3Boolean
: ArgumentnoSetFMUStatePriorToCurrentPoint = fmi3True
iffmi3SetFMUState
will no longer be called for time instants prior to current time in this simulation run.enterEventMode::Ref{fmi3Boolean}
: ArgumententerEventMode
points to the return value (fmi3Boolean) which signals to the environment if the FMU shall callfmi3EnterEventMode
.fmi3Boolean
is an alias type forBoolean
data type.terminateSimulation::Ref{fmi3Boolean}
: ArgumentterminateSimulation
points to the return value (fmi3Boolean) which signals signal if the simulation shall be terminated.fmi3Boolean
is an alias type forBoolean
data type.
Returns
status::fmi3Status
: Returnstatus
is an enumeration of typefmi3Status
and indicates the success of the function call.
More detailed:
fmi3OK
: all wellfmi3Warning
: things are not quite right, but the computation can continuefmi3Discard
: if the slave computed successfully only a subinterval of the communication stepfmi3Error
: the communication step could not be carried out at allfmi3Fatal
: if an error occurred which corrupted the FMU irreparably
Source
- FMISpec3.0 Link: https://fmi-standard.org/
- FMISpec3.0: 2.2.3 Platform Dependent Definitions
- FMISpec3.0: 2.2.4 Status Returned by Functions
- FMISpec3.0: 3.2.1. State: Continuous-Time Mode
See also fmi3CompletedIntegratorStep!
.
FMICore.fmi3DeSerializeFMUState!
— Methodfmi3DeSerializeFMUState!(c::FMU3Instance, serialzedState::AbstractArray{fmi3Byte}, size::Csize_t, FMUstate::Ref{fmi3FMUState})
Deserializes the byte vector serializedState of length size, constructs a copy of the FMU state and stores the FMU state in the given address of the reference FMUstate
, the pointer to this copy.
Arguments
c::FMU3Instance
: Argumentc
is a Mutable struct represents an instantiated instance of an FMU in the FMI 3.0 Standard.FMUstate::fmi3FMUstate
: ArgumentFMUstate
is a pointer to a data structure in the FMU that saves the internal FMU state of the actual or a previous time instant.serialzedState::AbstractArray{fmi3Byte}
: ArgumentserializedState
contains the copy of the serialized data referenced by the pointer FMUstate.size::Ref{Csize_t}
: Argumentsize
is an object that safely references a value of typeCsize_t
and defines the size of the byte vector in which the FMUstate can be stored.
Returns
status::fmi3Status
: Returnstatus
is an enumeration of typefmi3Status
and indicates the success of the function call.
More detailed:
fmi3OK
: all wellfmi3Warning
: things are not quite right, but the computation can continuefmi3Discard
: if the slave computed successfully only a subinterval of the communication stepfmi3Error
: the communication step could not be carried out at allfmi3Fatal
: if an error occurred which corrupted the FMU irreparably
Source
- FMISpec3.0 Link: https://fmi-standard.org/
- FMISpec3.0: 2.2.3 Platform Dependent Definitions
- FMISpec3.0: 2.2.4 Status Returned by Functions
- FMISpec3.0: 2.2.6.4. Getting and Setting the Complete FMU State
See also fmi3DeSerializeFMUState!
.
FMICore.fmi3DoStep!
— Functionfmi3DoStep!(c::FMU3Instance, currentCommunicationPoint::Union{Real, Nothing} = nothing, communicationStepSize::Union{Real, Nothing} = nothing, noSetFMUStatePriorToCurrentPoint::Bool = true,
eventEncountered::fmi3Boolean = fmi3False, terminateSimulation::fmi3Boolean = fmi3False, earlyReturn::fmi3Boolean = fmi3False, lastSuccessfulTime::fmi3Float64 = 0.0)
The computation of a time step is started.
TODO argmuents
Arguments
c::FMU3Instance
: Mutable struct represents an instantiated instance of an FMU in the FMI 3.0 Standard.currentCommunicationPoint::Union{Real, Nothing} = nothing
communicationStepSize::Union{Real, Nothing} = nothing
noSetFMUStatePriorToCurrentPoint::Bool = true
eventEncountered::fmi3Boolean = fmi3False
terminateSimulation::fmi3Boolean = fmi3False
earlyReturn::fmi3Boolean = fmi3False
lastSuccessfulTime::fmi3Float64 = 0.0
Returns
status::fmi3Status
: Returnstatus
is an enumeration of typefmi3Status
and indicates the success of the function call.
More detailed:
fmi3OK
: all wellfmi3Warning
: things are not quite right, but the computation can continuefmi3Discard
: if the slave computed successfully only a subinterval of the communication stepfmi3Error
: the communication step could not be carried out at allfmi3Fatal
: if an error occurred which corrupted the FMU irreparably
Source
- FMISpec3.0 Link: https://fmi-standard.org/
- FMISpec3.0: 2.2.3 Platform Dependent Definitions
- FMISpec3.0: 2.2.4 Status Returned by Functions
- FMISpec3.0: 4.2.1. State: Step Mode
See also fmi3DoStep!
.
FMICore.fmi3DoStep!
— Methodfmi3DoStep!(c::FMU3Instance, currentCommunicationPoint::fmi3Float64, communicationStepSize::fmi3Float64, noSetFMUStatePriorToCurrentPoint::fmi3Boolean,
eventEncountered::Ref{fmi3Boolean}, terminateSimulation::Ref{fmi3Boolean}, earlyReturn::Ref{fmi3Boolean}, lastSuccessfulTime::Ref{fmi3Float64})
The computation of a time step is started.
TODO argmuents
Arguments
c::FMU3Instance
: Mutable struct represents an instantiated instance of an FMU in the FMI 3.0 Standard.currentCommunicationPoint::fmi3Float64
:communicationStepSize::fmi3Float64
:noSetFMUStatePriorToCurrentPoint::fmi3Boolean
:eventEncountered::Ref{fmi3Boolean}
:terminateSimulation::Ref{fmi3Boolean}
:earlyReturn::Ref{fmi3Boolean}
:lastSuccessfulTime::Ref{fmi3Float64}
:
Returns
status::fmi3Status
: Returnstatus
is an enumeration of typefmi3Status
and indicates the success of the function call.
More detailed:
fmi3OK
: all wellfmi3Warning
: things are not quite right, but the computation can continuefmi3Discard
: if the slave computed successfully only a subinterval of the communication stepfmi3Error
: the communication step could not be carried out at allfmi3Fatal
: if an error occurred which corrupted the FMU irreparably
Source
- FMISpec3.0 Link: https://fmi-standard.org/
- FMISpec3.0: 2.2.3 Platform Dependent Definitions
- FMISpec3.0: 2.2.4 Status Returned by Functions
- FMISpec3.0: 4.2.1. State: Step Mode
See also fmi3DoStep!
.
FMICore.fmi3EnterConfigurationMode
— Methodfmi3EnterConfigurationMode(c::FMU3Instance; soft::Bool=false)
If the importer needs to change structural parameters, it must move the FMU into Configuration Mode using fmi3EnterConfigurationMode.
Arguments
c::FMU3Instance
: Mutable struct represents an instantiated instance of an FMU in the FMI 3.0 Standard.
Keywords
soft::Bool=false
: If the Keywordsoft = true
thefmi3Teminate
needs to be called in statefmi3InstanceStateContinuousTimeMode
orfmi3InstanceStateEventMode
.
Returns
status::fmi3Status
: Returnstatus
is an enumeration of typefmi3Status
and indicates the success of the function call.
More detailed:
fmi3OK
: all wellfmi3Warning
: things are not quite right, but the computation can continuefmi3Discard
: if the slave computed successfully only a subinterval of the communication stepfmi3Error
: the communication step could not be carried out at allfmi3Fatal
: if an error occurred which corrupted the FMU irreparably
Source
- FMISpec3.0 Link: https://fmi-standard.org/
- FMISpec3.0: 2.2.3 Platform Dependent Definitions
- FMISpec3.0: 2.2.4 Status Returned by Functions
- FMISpec3.0: 2.3.2. State: Instantiated
See also fmi3EnterConfigurationMode
.
FMICore.fmi3EnterContinuousTimeMode
— Methodfmi3EnterContinuousTimeMode(c::FMU3Instance; soft::Bool=false)
The model enters Continuous-Time Mode and all discrete-time equations become inactive and all relations are “frozen”. This function has to be called when changing from Event Mode (after the global event iteration in Event Mode over all involved FMUs and other models has converged) into Continuous-Time Mode.
Arguments
c::FMU3Instance
: Mutable struct represents an instantiated instance of an FMU in the FMI 3.0 Standard.
Keywords
soft::Bool=false
: If the Keywordsoft = true
thefmi3Teminate
needs to be called in statefmi3InstanceStateContinuousTimeMode
orfmi3InstanceStateEventMode
.
Returns
status::fmi3Status
: Returnstatus
is an enumeration of typefmi3Status
and indicates the success of the function call.
More detailed:
fmi3OK
: all wellfmi3Warning
: things are not quite right, but the computation can continuefmi3Discard
: if the slave computed successfully only a subinterval of the communication stepfmi3Error
: the communication step could not be carried out at allfmi3Fatal
: if an error occurred which corrupted the FMU irreparably
Source
- FMISpec3.0 Link: https://fmi-standard.org/
- FMISpec3.0: 2.2.3 Platform Dependent Definitions
- FMISpec3.0: 2.2.4 Status Returned by Functions
- FMISpec3.0: 2.3.5. State: Event Mode
See also fmi3EnterContinuousTimeMode
.
FMICore.fmi3EnterEventMode
— Methodfmi3EnterEventMode(c::FMU3Instance, stepEvent::Bool, stateEvent::Bool, rootsFound::AbstractArray{fmi3Int32}, nEventIndicators::Csize_t, timeEvent::Bool)
The model enters Event Mode from the Continuous-Time Mode in ModelExchange oder Step Mode in CoSimulation and discrete-time equations may become active (and relations are not “frozen”).
TODO argmuents
Arguments
c::FMU3Instance
: Mutable struct represents an instantiated instance of an FMU in the FMI 3.0 Standard.stepEvent::Bool
:stateEvent::Bool
:rootsFound::AbstractArray{fmi3Int32}
:nEventIndicators::Csize_t
:timeEvent::Bool
:
Returns
status::fmi3Status
: Returnstatus
is an enumeration of typefmi3Status
and indicates the success of the function call.
More detailed:
fmi3OK
: all wellfmi3Warning
: things are not quite right, but the computation can continuefmi3Discard
: if the slave computed successfully only a subinterval of the communication stepfmi3Error
: the communication step could not be carried out at allfmi3Fatal
: if an error occurred which corrupted the FMU irreparably
Source
- FMISpec3.0 Link: https://fmi-standard.org/
- FMISpec3.0: 2.2.3 Platform Dependent Definitions
- FMISpec3.0: 2.2.4 Status Returned by Functions
- FMISpec3.0: 3.2.1. State: Continuous-Time Mode
See also fmi3EnterEventMode
.
FMICore.fmi3EnterEventMode
— Methodfmi3EnterEventMode(c::FMU3Instance, stepEvent::fmi3Boolean, stateEvent::fmi3Boolean, rootsFound::AbstractArray{fmi3Int32}, nEventIndicators::Csize_t, timeEvent::fmi3Boolean; soft::Bool=false)
The model enters Event Mode from the Continuous-Time Mode in ModelExchange oder Step Mode in CoSimulation and discrete-time equations may become active (and relations are not “frozen”).
TODO argmuents
Arguments
c::FMU3Instance
: Mutable struct represents an instantiated instance of an FMU in the FMI 3.0 Standard.stepEvent::fmi3Boolean
:stateEvent::fmi3Boolean
:rootsFound::AbstractArray{fmi3Int32}
:nEventIndicators::Csize_t
:timeEvent::fmi3Boolean
:soft::Bool=false
:
Keywords
soft::Bool=false
: If the Keywordsoft = true
thefmi3Teminate
needs to be called in statefmi3InstanceStateContinuousTimeMode
orfmi3InstanceStateEventMode
.
Returns
status::fmi3Status
: Returnstatus
is an enumeration of typefmi3Status
and indicates the success of the function call.
More detailed:
fmi3OK
: all wellfmi3Warning
: things are not quite right, but the computation can continuefmi3Discard
: if the slave computed successfully only a subinterval of the communication stepfmi3Error
: the communication step could not be carried out at allfmi3Fatal
: if an error occurred which corrupted the FMU irreparably
Source
- FMISpec3.0 Link: https://fmi-standard.org/
- FMISpec3.0: 2.2.3 Platform Dependent Definitions
- FMISpec3.0: 2.2.4 Status Returned by Functions
- FMISpec3.0: 3.2.1. State: Continuous-Time Mode
See also fmi3EnterEventMode
.
FMICore.fmi3EnterInitializationMode
— Functionfmi3EnterInitializationMode(c::FMU3Instance, startTime::Union{Real, Nothing} = nothing, stopTime::Union{Real, Nothing} = nothing; tolerance::Union{Real, Nothing} = nothing)
FMU enters Initialization mode.
Arguments
c::FMU3Instance
: Mutable struct represents an instantiated instance of an FMU in the FMI 3.0 Standard.startTime::Union{Real, Nothing} = nothing
:startTime
is a real number which sets the value of starting time of the experiment. The default value is set automatically if doing nothing (default =nothing
).stopTime::Union{Real, Nothing} = nothing
:stopTime
is a real number which sets the value of ending time of the experiment. The default value is set automatically if doing nothing (default =nothing
).
Keywords
tolerance::Union{Real, Nothing} = nothing
:tolerance
is a real number which sets the value of tolerance range. The default value is set automatically if doing nothing (default =nothing
).
Returns
- Returns a warning if
str.state
is not called infmi3InstanceStateInstantiated
. status::fmi3Status
: Returnstatus
is an enumeration of typefmi3Status
and indicates the success of the function call.
More detailed:
fmi3OK
: all wellfmi3Warning
: things are not quite right, but the computation can continuefmi3Discard
: if the slave computed successfully only a subinterval of the communication stepfmi3Error
: the communication step could not be carried out at allfmi3Fatal
: if an error occurred which corrupted the FMU irreparably
Source
- FMISpec3.0 Link: https://fmi-standard.org/
- FMISpec3.0: 2.2.4 Status Returned by Functions
- FMISpec3.0: 2.3.2. State: Instantiated
See also fmi3EnterInitializationMode
.
FMICore.fmi3EnterInitializationMode
— Methodfmi3EnterInitializationMode(c::FMU3Instance, toleranceDefined::fmi3Boolean,
tolerance::fmi3Float64,
startTime::fmi3Float64,
stopTimeDefined::fmi3Boolean,
stopTime::fmi3Float64)
Informs the FMU to enter Initialization Mode. Before calling this function, all variables with attribute <Datatype initial = "exact" or "approx"> can be set with the “fmi3SetXXX” functions (the ScalarVariable attributes are defined in the Model Description File, see section 2.4.7). Setting other variables is not allowed. Also sets the simulation start and stop time.
Arguments
c::FMU3Instance
: Argumentc
is a Mutable struct represents an instantiated instance of an FMU in the FMI 3.0 Standard.toleranceDefined::fmi3Boolean
: ArgumentstoleranceDefined
depend on the FMU type:- fmuType = fmi3ModelExchange: If
toleranceDefined = fmi3True
, then the model is called with a numerical integration scheme where the step size is controlled by usingtolerance
for error estimation. In such a case, all numerical algorithms used inside the model (for example, to solve non-linear algebraic equations) should also operate with an error estimation of an appropriate smaller relative tolerance. - fmuType = fmi3CoSimulation: If
toleranceDefined = fmi3True
, then the communication interval of the slave is controlled by error estimation. In case the slave utilizes a numerical integrator with variable step size and error estimation, it is suggested to use “tolerance” for the error estimation of the internal integrator (usually as relative tolerance). An FMU for Co-Simulation might ignore this argument.
- fmuType = fmi3ModelExchange: If
tolerance::fmi3Float64
: Argumenttolerance
is the desired tolerancestartTime::fmi3Float64
: ArgumentstartTime
can be used to check whether the model is valid within the given boundaries or to allocate memory which is necessary for storing results. It is the fixed initial value of the independent variable and if the independent variable istime
,startTime
is the starting time of initializaton.stopTimeDefined::fmi3Boolean
: IfstopTimeDefined = fmi3True
, then stopTime is the defined final value of the independent variable and ifstopTimeDefined = fmi3False
, then no final value
of the independent variable is defined and argument stopTime
is meaningless.
stopTime::fmi3Float64
: ArgumentstopTime
can be used to check whether the model is valid within the given boundaries or to allocate memory which is necessary for storing results. It is the fixed final value of the independent variable and if the independent variable is “time”, stopTime is the stop time of the simulation.
Returns
status::fmi3Status
: Returnstatus
is an enumeration of typefmi3Status
and indicates the success of the function call.
More detailed: - fmi3OK
: all well - fmi3Warning
: things are not quite right, but the computation can continue - fmi3Discard
: if the slave computed successfully only a subinterval of the communication step - fmi3Error
: the communication step could not be carried out at all - fmi3Fatal
: if an error occurred which corrupted the FMU irreparably
Source
- FMISpec3.0 Link: https://fmi-standard.org/
- FMISpec3.0: 2.2.3 Platform Dependent Definitions
- FMISpec3.0: 2.2.4 Status Returned by Functions
- FMISpec3.0: 2.3.2. State: Instantiated
See also fmi3EnterInitializationMode
.
FMICore.fmi3EnterStepMode
— Methodfmi3EnterStepMode(c::FMU3Instance; soft::Bool=false)
This function must be called to change from Event Mode into Step Mode in Co-Simulation (see 4.2.).
Arguments
c::FMU3Instance
: Mutable struct represents an instantiated instance of an FMU in the FMI 3.0 Standard.
Keywords
soft::Bool=false
: If the Keywordsoft = true
thefmi3Teminate
needs to be called in statefmi3InstanceStateContinuousTimeMode
orfmi3InstanceStateEventMode
.
Returns
status::fmi3Status
: Returnstatus
is an enumeration of typefmi3Status
and indicates the success of the function call.
More detailed:
fmi3OK
: all wellfmi3Warning
: things are not quite right, but the computation can continuefmi3Discard
: if the slave computed successfully only a subinterval of the communication stepfmi3Error
: the communication step could not be carried out at allfmi3Fatal
: if an error occurred which corrupted the FMU irreparably
Source
- FMISpec3.0 Link: https://fmi-standard.org/
- FMISpec3.0: 2.2.3 Platform Dependent Definitions
- FMISpec3.0: 2.2.4 Status Returned by Functions
- FMISpec3.0: 2.3.5. State: Event Mode
See also fmi3EnterStepMode
.
FMICore.fmi3EvaluateDiscreteStates
— Methodfmi3EvaluateDiscreteStates(c::FMU3Instance)
This function is called to trigger the evaluation of fdisc to compute the current values of discrete states from previous values. The FMU signals the support of fmi3EvaluateDiscreteStates via the capability flag providesEvaluateDiscreteStates.
Arguments
c::FMU3Instance
: Mutable struct represents an instantiated instance of an FMU in the FMI 3.0 Standard.
Returns
status::fmi3Status
: Returnstatus
is an enumeration of typefmi3Status
and indicates the success of the function call.
More detailed:
fmi3OK
: all wellfmi3Warning
: things are not quite right, but the computation can continuefmi3Discard
: if the slave computed successfully only a subinterval of the communication stepfmi3Error
: the communication step could not be carried out at allfmi3Fatal
: if an error occurred which corrupted the FMU irreparably
Source
- FMISpec3.0 Link: https://fmi-standard.org/
- FMISpec3.0: 2.2.3 Platform Dependent Definitions
- FMISpec3.0: 2.2.4 Status Returned by Functions
- FMISpec3.0: 2.3.3. State: Initialization Mode
See also fmi3EvaluateDiscreteStates
.
FMICore.fmi3ExitConfigurationMode
— Methodfmi3ExitConfigurationMode(c::FMU3Instance; soft::Bool=false)
Exits the Configuration Mode and returns to state Instantiated.
Arguments
c::FMU3Instance
: Mutable struct represents an instantiated instance of an FMU in the FMI 3.0 Standard.
Keywords
soft::Bool=false
: If the Keywordsoft = true
thefmi3Teminate
needs to be called in statefmi3InstanceStateContinuousTimeMode
orfmi3InstanceStateEventMode
.
Returns
status::fmi3Status
: Returnstatus
is an enumeration of typefmi3Status
and indicates the success of the function call.
More detailed:
fmi3OK
: all wellfmi3Warning
: things are not quite right, but the computation can continuefmi3Discard
: if the slave computed successfully only a subinterval of the communication stepfmi3Error
: the communication step could not be carried out at allfmi3Fatal
: if an error occurred which corrupted the FMU irreparably
Source
- FMISpec3.0 Link: https://fmi-standard.org/
- FMISpec3.0: 2.2.3 Platform Dependent Definitions
- FMISpec3.0: 2.2.4 Status Returned by Functions
- FMISpec3.0: 2.3.6. State: Configuration Mode
See also fmi3ExitConfigurationMode
.
FMICore.fmi3ExitInitializationMode
— Methodfmi3ExitInitializationMode(c::FMU3Instance)
Informs the FMU to exit Initialization Mode.
Arguments
c::FMU3Instance
: Argumentc
is a Mutable struct represents an instantiated instance of an FMU in the FMI 3.0 Standard.
Returns
status::fmi3Status
: Returnstatus
is an enumeration of typefmi3Status
and indicates the success of the function call.
More detailed: - fmi3OK
: all well - fmi3Warning
: things are not quite right, but the computation can continue - fmi3Discard
: if the slave computed successfully only a subinterval of the communication step - fmi3Error
: the communication step could not be carried out at all - fmi3Fatal
: if an error occurred which corrupted the FMU irreparably
Source
- FMISpec3.0 Link: https://fmi-standard.org/
- FMISpec3.0: 2.2.3 Platform Dependent Definitions
- FMISpec3.0: 2.2.4 Status Returned by Functions
- FMISpec3.0: 2.3.3. State: Initialization Mode
See also fmi3ExitInitializationMode
.
FMICore.fmi3FreeFMUState
— Methodfmi3FreeFMUState!(c::FMU3Instance, state::fmi3FMUState)
Free the allocated memory for the FMU state.
Arguments
c::FMU3Instance
: Mutable struct represents an instantiated instance of an FMU in the FMI 3.0 Standard.state::fmi3FMUState
: Argumentstate
is a pointer to a data structure in the FMU that saves the internal FMU state of the actual or a previous time instant.
Returns
- Return singleton instance of type
Nothing
, if there is no value to return (as in a C void function) or when a variable or field holds no value.
Source
- FMISpec3.0 Link: https://fmi-standard.org/
- FMISpec3.0: 2.2.3 Platform Dependent Definitions
- FMISpec3.0: 2.2.6.4. Getting and Setting the Complete FMU State
FMICore.fmi3FreeFMUState
— Methodfmi3FreeFMUState(c::FMU3Instance, FMUstate::Ref{fmi3FMUState})
Frees all memory and other resources allocated with the fmi3GetFMUstate
call for this FMUstate.
Arguments
c::FMU3Instance
: Argumentc
is a Mutable struct represents an instantiated instance of an FMU in the FMI 3.0 Standard.FMUstate::fmi3FMUstate
: ArgumentFMUstate
is a pointer to a data structure in the FMU that saves the internal FMU state of the actual or a previous time instant.
Returns
status::fmi3Status
: Returnstatus
is an enumeration of typefmi3Status
and indicates the success of the function call.
More detailed:
fmi3OK
: all wellfmi3Warning
: things are not quite right, but the computation can continuefmi3Discard
: if the slave computed successfully only a subinterval of the communication stepfmi3Error
: the communication step could not be carried out at allfmi3Fatal
: if an error occurred which corrupted the FMU irreparably
Source
- FMISpec3.0 Link: https://fmi-standard.org/
- FMISpec3.0: 2.2.3 Platform Dependent Definitions
- FMISpec3.0: 2.2.4 Status Returned by Functions
- FMISpec3.0: 2.2.6.4. Getting and Setting the Complete FMU State
FMICore.fmi3GetAdjointDerivative!
— Methodfmi3GetAdjointDerivative!(c::FMU3Instance,
unknowns::AbstractArray{fmi3ValueReference},
knowns::AbstractArray{fmi3ValueReference},
sensitivity::AbstractArray{fmi3Float64},
seed::AbstractArray{fmi3Float64})
Wrapper Function call to compute the partial derivative with respect to the variables unknowns
.
Computes the adjoint derivatives of an FMU. An FMU has different Modes and in every Mode an FMU might be described by different equations and different unknowns. The precise definitions are given in the mathematical descriptions of Model Exchange (section 3) and Co-Simulation (section 4). In every Mode, the general form of the FMU equations are: unknowns = 𝐡(knowns, rest)
unknowns
: vector of unknown Real variables computed in the actual Mode:- Initialization Mode: unkowns kisted under
<ModelStructure><InitialUnknown>
that have type Real. - Continuous-Time Mode (ModelExchange): The continuous-time outputs and state derivatives. (= the variables listed under
<ModelStructure><Output>
with type Real and variability =continuous
and the variables listed as state derivatives under<ModelStructure><ContinuousStateDerivative>)
. - Event Mode (ModelExchange/CoSimulation): The same variables as in the Continuous-Time Mode and additionally variables under
<ModelStructure><Output>
with type Real and variability =discrete
. - Step Mode (CoSimulation): The variables listed under
<ModelStructure><Output>
with type Real and variability =continuous
ordiscrete
. If<ModelStructure><ContinuousStateDerivative>
is present, also the variables listed here as state derivatives.
- Initialization Mode: unkowns kisted under
knowns
: Real input variables of function h that changes its value in the actual Mode.rest
: Set of input variables of function h that either changes its value in the actual Mode but are non-Real variables, or do not change their values in this Mode, but change their values in other Modes
Computes a linear combination of the partial derivatives of h with respect to the selected input variables 𝐯_known:
Δunknowns = (δh / δknowns) Δknowns
Arguments
c::FMU3Instance
Mutable struct represents an instantiated instance of an FMU in the FMI 3.0 Standard.unknowns::AbstracArray{fmi3ValueReference}
: Argumentunknowns
contains values of typefmi3ValueReference
which are identifiers of a variable value of the model.unknowns
can be equated withunknowns
(variable described above).knowns::AbstractArray{fmi3ValueReference}
: Argumentknowns
contains values of typefmi3ValueReference
which are identifiers of a variable value of the model.knowns
can be equated withknowns
(variable described above).sensitivity::AbstractArray{fmi3Float64}
: Stores the directional derivative vector values.seed::AbstractArray{fmi3Float64}
:The vector values Compute the partial derivative with respect to the given entries in vectorknowns
with the matching evaluate ofsensitivity
.
Returns
status::fmi3Status
: Returnstatus
is an enumeration of typefmi3Status
and indicates the success of the function call.
More detailed:
fmi3OK
: all wellfmi3Warning
: things are not quite right, but the computation can continuefmi3Discard
: if the slave computed successfully only a subinterval of the communication stepfmi3Error
: the communication step could not be carried out at allfmi3Fatal
: if an error occurred which corrupted the FMU irreparably
Source
- FMISpec3.0 Link: https://fmi-standard.org/
- FMISpec3.0: 2.2.3 Platform Dependent Definitions
- FMISpec3.0: 2.2.4 Status Returned by Functions
- FMISpec3.0: 2.2.11. Getting Partial Derivatives
See also fmi3GetAdjointDerivative!
.
FMICore.fmi3GetAdjointDerivative!
— Methodfmi3GetAdjointDerivative!(c::FMU3Instance,
unknowns::AbstractArray{fmi3ValueReference},
nUnknowns::Csize_t,
knowns::AbstractArray{fmi3ValueReference},
nKnowns::Csize_t,
seed::AbstractArray{fmi3Float64},
nSeed::Csize_t,
sensitivity::AbstractArray{fmi3Float64},
nSensitivity::Csize_t)
Wrapper Function call to compute the partial derivative with respect to the variables unknowns
.
Computes the adjoint derivatives of an FMU. An FMU has different Modes and in every Mode an FMU might be described by different equations and different unknowns. The precise definitions are given in the mathematical descriptions of Model Exchange (section 3) and Co-Simulation (section 4). In every Mode, the general form of the FMU equations are: unknowns = 𝐡(knowns, rest)
unknowns
: vector of unknown Real variables computed in the actual Mode:- Initialization Mode: unkowns kisted under
<ModelStructure><InitialUnknown>
that have type Real. - Continuous-Time Mode (ModelExchange): The continuous-time outputs and state derivatives. (= the variables listed under
<ModelStructure><Output>
with type Real and variability =continuous
and the variables listed as state derivatives under<ModelStructure><ContinuousStateDerivative>)
. - Event Mode (ModelExchange/CoSimulation): The same variables as in the Continuous-Time Mode and additionally variables under
<ModelStructure><Output>
with type Real and variability =discrete
. - Step Mode (CoSimulation): The variables listed under
<ModelStructure><Output>
with type Real and variability =continuous
ordiscrete
. If<ModelStructure><ContinuousStateDerivative>
is present, also the variables listed here as state derivatives. knowns
: Real input variables of function h that changes its value in the actual Mode.rest
: Set of input variables of function h that either changes its value in the actual Mode but are non-Real variables, or do not change their values in this Mode, but change their values in other Modes
Computes a linear combination of the partial derivatives of h with respect to the selected input variables 𝐯_known:
Δunknowns = (δh / δknowns) Δknowns
Arguments
c::FMU3Instance
: Mutable struct represents an instantiated instance of an FMU in the FMI 3.0 Standard.unknowns::AbstracArray{fmi3ValueReference}
: Argumentunknowns
contains values of typefmi3ValueReference
which are identifiers of a variable value of the model.unknowns
can be equated withunknowns
(variable described above).nUnknowns::Csize_t
:knowns::AbstractArray{fmi3ValueReference}
: Argumentknowns
contains values of typefmi3ValueReference
which are identifiers of a variable value of the model.knowns
can be equated withknowns
(variable described above).nKnowns::Csize_t
:seed::AbstractArray{fmi3Float64}
:The vector values Compute the partial derivative with respect to the given entries in vectorknowns
with the matching evaluate ofsensitivity
.nKnowns::Csize_t
:sensitivity::AbstractArray{fmi3Float64}
: Stores the adjoint derivative vector values.nKnowns::Csize_t
:
Returns
status::fmi3Status
: Returnstatus
is an enumeration of typefmi3Status
and indicates the success of the function call.
More detailed:
fmi3OK
: all wellfmi3Warning
: things are not quite right, but the computation can continuefmi3Discard
: if the slave computed successfully only a subinterval of the communication stepfmi3Error
: the communication step could not be carried out at allfmi3Fatal
: if an error occurred which corrupted the FMU irreparably
Source
- FMISpec3.0 Link: https://fmi-standard.org/
- FMISpec3.0: 2.2.3 Platform Dependent Definitions
- FMISpec3.0: 2.2.4 Status Returned by Functions
- FMISpec3.0: 2.2.11. Getting Partial Derivatives
See also fmi3GetAdjointDerivative!
.
FMICore.fmi3GetBinary!
— Methodfmi3GetBinary!(c::FMU3Instance, vr::AbstractArray{fmi3ValueReference}, nvr::Csize_t, valueSizes::AbstractArray{Csize_t}, value::AbstractArray{fmi3Binary}, nvalue::Csize_t)
Functions to get and set values of variables idetified by their valueReference.
Arguments
c::FMU3Instance
: Argumentc
is a Mutable struct represents an instantiated instance of an FMU in the FMI 3.0 Standard.vr::AbstractArray{fmi3ValueReference}
: Argumentvr
is an AbstractArray ofnvr
value handels called "ValueReference" that define the variable that shall be inquired.nvr::Csize_t
: Argumentnvr
defines the size ofvr
.valueSizes::AbstractArray{Csize_t}
: ArgumentvalueSizes
defines the size of a binary element of each variable.value::AbstractArray{fmi3Binary}
: Argumentvalues
is an AbstractArray with the actual values of these variables.nvalue::Csize_t
: Argumentnvalue
defines the size ofvalues
.
Returns
status::fmi3Status
: Returnstatus
is an enumeration of typefmi3Status
and indicates the success of the function call.
More detailed:
fmi3OK
: all wellfmi3Warning
: things are not quite right, but the computation can continuefmi3Discard
: if the slave computed successfully only a subinterval of the communication stepfmi3Error
: the communication step could not be carried out at allfmi3Fatal
: if an error occurred which corrupted the FMU irreparably
Source
- FMISpec3.0 Link: https://fmi-standard.org/
- FMISpec3.0: 2.2.3 Platform Dependent Definitions
- FMISpec3.0: 2.2.4 Status Returned by Functions
- FMISpec3.0: 2.2.6.2. Getting and Setting Variable Values
See also fmi3GetBinary!
.
FMICore.fmi3GetBinary!
— Methodfmi3GetBinary!(c::FMU3Instance, vr::fmi3ValueReferenceFormat, values::AbstractArray{fmi3Binary})
Writes the binary values of an array of variables in the given field
fmi3GetBinary! is only possible for arrays of values, please use an array instead of a scalar.
Arguments
c::FMU3Instance
: Mutable struct represents an instantiated instance of an FMU in the FMI 3.0 Standard.vr::fmi3ValueReferenceFormat
: Wildcards for how a user can pass a fmi[X]ValueReference
More detailed: fmi3ValueReferenceFormat = Union{Nothing, String, Array{String,1}, fmi3ValueReference, Array{fmi3ValueReference,1}, Int64, Array{Int64,1}, Symbol}
values::AbstractArray{fmi3Binary}
: Argumentvalues
is an AbstractArray with the actual values of these variables.
Returns
status::fmi3Status
: Returnstatus
is an enumeration of typefmi3Status
and indicates the success of the function call.
More detailed:
fmi3OK
: all wellfmi3Warning
: things are not quite right, but the computation can continuefmi3Discard
: if the slave computed successfully only a subinterval of the communication stepfmi3Error
: the communication step could not be carried out at allfmi3Fatal
: if an error occurred which corrupted the FMU irreparably
Source
- FMISpec3.0 Link: https://fmi-standard.org/
- FMISpec3.0: 2.2.4 Status Returned by Functions
- FMISpec3.0: 2.2.6.2. Getting and Setting Variable Values
See also fmi3GetBinary!
.
FMICore.fmi3GetBoolean!
— Methodfmi3GetBoolean!(c::FMU3Instance, vr::AbstractArray{fmi3ValueReference}, nvr::Csize_t, value::AbstractArray{fmi3Boolean}, nvalue::Csize_t)
Functions to get and set values of variables idetified by their valueReference.
Arguments
c::FMU3Instance
: Argumentc
is a Mutable struct represents an instantiated instance of an FMU in the FMI 3.0 Standard.vr::AbstractArray{fmi3ValueReference}
: Argumentvr
is an AbstractArray ofnvr
value handels called "ValueReference" that define the variable that shall be inquired.nvr::Csize_t
: Argumentnvr
defines the size ofvr
.values::AbstractArray{fmi3Boolean}
: Argumentvalues
is an AbstractArray with the actual values of these variables.nvalue::Csize_t
: Argumentnvalue
defines the size ofvalues
.
Returns
status::fmi3Status
: Returnstatus
is an enumeration of typefmi3Status
and indicates the success of the function call.
More detailed: - fmi3OK
: all well - fmi3Warning
: things are not quite right, but the computation can continue - fmi3Discard
: if the slave computed successfully only a subinterval of the communication step - fmi3Error
: the communication step could not be carried out at all - fmi3Fatal
: if an error occurred which corrupted the FMU irreparably
Source
- FMISpec3.0 Link: https://fmi-standard.org/
- FMISpec3.0: 2.2.3 Platform Dependent Definitions
- FMISpec3.0: 2.2.4 Status Returned by Functions
- FMISpec3.0: 2.2.6.2. Getting and Setting Variable Values
See also fmi3GetBoolean!
.
FMICore.fmi3GetBoolean!
— Methodfmi3GetBoolean!(c::FMU3Instance, vr::fmi3ValueReferenceFormat, values::AbstractArray{fmi3Boolean})
Writes the boolean values of an array of variables in the given field
fmi3GetBoolean! is only possible for arrays of values, please use an array instead of a scalar.
Arguments
c::FMU3Instance
: Mutable struct represents an instantiated instance of an FMU in the FMI 3.0 Standard.vr::fmi3ValueReferenceFormat
: Wildcards for how a user can pass a fmi[X]ValueReference
More detailed: fmi3ValueReferenceFormat = Union{Nothing, String, Array{String,1}, fmi3ValueReference, Array{fmi3ValueReference,1}, Int64, Array{Int64,1}, Symbol}
values::AbstractArray{fmi3Boolean}
: Argumentvalues
is an AbstractArray with the actual values of these variables.
Returns
status::fmi3Status
: Returnstatus
is an enumeration of typefmi3Status
and indicates the success of the function call.
More detailed:
fmi3OK
: all wellfmi3Warning
: things are not quite right, but the computation can continuefmi3Discard
: if the slave computed successfully only a subinterval of the communication stepfmi3Error
: the communication step could not be carried out at allfmi3Fatal
: if an error occurred which corrupted the FMU irreparably
Source
- FMISpec3.0 Link: https://fmi-standard.org/
- FMISpec3.0: 2.2.4 Status Returned by Functions
- FMISpec3.0: 2.2.6.2. Getting and Setting Variable Values
See also fmi3GetBoolean!
.
FMICore.fmi3GetClock!
— Methodfmi3GetClock!(c::FMU3Instance, vr::AbstractArray{fmi3ValueReference}, nvr::Csize_t, value::AbstractArray{fmi3Clock}, nvalue::Csize_t)
Functions to get and set values of variables idetified by their valueReference.
Arguments
c::FMU3Instance
: Argumentc
is a Mutable struct represents an instantiated instance of an FMU in the FMI 3.0 Standard.vr::AbstractArray{fmi3ValueReference}
: Argumentvr
is an AbstractArray ofnvr
value handels called "ValueReference" that define the variable that shall be inquired.nvr::Csize_t
: Argumentnvr
defines the size ofvr
.value::AbstractArray{fmi3Clock}
: Argumentvalues
is an AbstractArray with the actual values of these variables.nvalue::Csize_t
: Argumentnvalue
defines the size ofvalues
.
Returns
status::fmi3Status
: Returnstatus
is an enumeration of typefmi3Status
and indicates the success of the function call.
More detailed:
fmi3OK
: all wellfmi3Warning
: things are not quite right, but the computation can continuefmi3Discard
: if the slave computed successfully only a subinterval of the communication stepfmi3Error
: the communication step could not be carried out at allfmi3Fatal
: if an error occurred which corrupted the FMU irreparably
Source
- FMISpec3.0 Link: https://fmi-standard.org/
- FMISpec3.0: 2.2.3 Platform Dependent Definitions
- FMISpec3.0: 2.2.4 Status Returned by Functions
- FMISpec3.0: 2.2.6.2. Getting and Setting Variable Values
See also fmi3GetClock!
.
FMICore.fmi3GetClock!
— Methodfmi3GetClock!(c::FMU3Instance, vr::fmi3ValueReferenceFormat, values::AbstractArray{fmi3Clock})
Writes the clock values of an array of variables in the given field
fmi3GetClock! is only possible for arrays of values, please use an array instead of a scalar.
Arguments
c::FMU3Instance
: Mutable struct represents an instantiated instance of an FMU in the FMI 3.0 Standard.vr::fmi3ValueReferenceFormat
: Wildcards for how a user can pass a fmi[X]ValueReference
More detailed: fmi3ValueReferenceFormat = Union{Nothing, String, Array{String,1}, fmi3ValueReference, Array{fmi3ValueReference,1}, Int64, Array{Int64,1}, Symbol}
values::AbstractArray{fmi3Clock}
: Argumentvalues
is an AbstractArray with the actual values of these variables.
Returns
status::fmi3Status
: Returnstatus
is an enumeration of typefmi3Status
and indicates the success of the function call.
More detailed:
fmi3OK
: all wellfmi3Warning
: things are not quite right, but the computation can continuefmi3Discard
: if the slave computed successfully only a subinterval of the communication stepfmi3Error
: the communication step could not be carried out at allfmi3Fatal
: if an error occurred which corrupted the FMU irreparably
Source
- FMISpec3.0 Link: https://fmi-standard.org/
- FMISpec3.0: 2.2.4 Status Returned by Functions
- FMISpec3.0: 2.2.6.2. Getting and Setting Variable Values
See also fmi3GetClock!
.
FMICore.fmi3GetContinuousStateDerivatives!
— Methodfmi3GetContinuousStateDerivatives!(c::FMU3Instance,
derivatives::AbstractArray{fmi3Float64},
nx::Csize_t)
Compute state derivatives at the current time instant and for the current states.
Arguments
c::FMU3Instance
: Mutable struct represents an instantiated instance of an FMU in the FMI 3.0 Standard.derivatives::AbstractArray{fmi3Float64}
: Argumentderivatives
contains values of typefmi3Float64
which is a alias type forReal
data type.derivatives
is theAbstractArray
which contains theReal
values of the vector that represent the derivatives. The ordering of the elements of the derivatives vector is identical to the ordering of the state vector.nx::Csize_t
: Argumentnx
defines the length of vectorderivatives
and is provided for checking purposes
Returns
status::fmi3Status
: Returnstatus
is an enumeration of typefmi3Status
and indicates the success of the function call.
More detailed:
fmi3OK
: all wellfmi3Warning
: things are not quite right, but the computation can continuefmi3Discard
: if the slave computed successfully only a subinterval of the communication stepfmi3Error
: the communication step could not be carried out at allfmi3Fatal
: if an error occurred which corrupted the FMU irreparably
Source
- FMISpec3.0 Link: https://fmi-standard.org/
- FMISpec3.0: 2.2.3 Platform Dependent Definitions
- FMISpec3.0: 2.2.4 Status Returned by Functions
- FMISpec3.0: 3.2.1. State: Continuous-Time Mode
See also fmi3GetContinuousStateDerivatives!
.
FMICore.fmi3GetContinuousStateDerivatives!
— Methodfmi3GetContinuousStateDerivatives!(c::FMU3Instance, derivatives::Array{fmi3Float64})
Compute state derivatives at the current time instant and for the current states.
Arguments
c::FMU3Instance
: Mutable struct represents an instantiated instance of an FMU in the FMI 3.0 Standard.derivatives::AbstractArray{fmi3Float64}
: Argumentderivatives
contains values of typefmi3Float64
which is a alias type forReal
data type.derivatives
is theAbstractArray
which contains theReal
values of the vector that represent the derivatives. The ordering of the elements of the derivatives vector is identical to the ordering of the state vector.
Returns
status::fmi3Status
: Returnstatus
is an enumeration of typefmi3Status
and indicates the success of the function call.
More detailed:
fmi3OK
: all wellfmi3Warning
: things are not quite right, but the computation can continuefmi3Discard
: if the slave computed successfully only a subinterval of the communication stepfmi3Error
: the communication step could not be carried out at allfmi3Fatal
: if an error occurred which corrupted the FMU irreparably
Source
- FMISpec3.0 Link: https://fmi-standard.org/
- FMISpec3.0: 2.2.3 Platform Dependent Definitions
- FMISpec3.0: 2.2.4 Status Returned by Functions
- FMISpec3.0: 3.2.1. State: Continuous-Time Mode
See also fmi3GetContinuousStateDerivatives!
.
FMICore.fmi3GetContinuousStates!
— Methodfmi3GetContinuousStates!(c::FMU3Instance, nominals::AbstractArray{fmi3Float64}, nContinuousStates::Csize_t)
Return the states at the current time instant.
This function must be called if fmi3UpdateDiscreteStates
returned with valuesOfContinuousStatesChanged == fmi3True
. Not allowed in Co-Simulation and Scheduled Execution.
Arguments
c::FMU3Instance
: Mutable struct represents an instantiated instance of an FMU in the FMI 2.0.2 Standard.nominals::AbstractArray{fmi3Float64}
: Argumentnominals
contains values of typefmi3Float64
which is a alias type forReal
data type.nominals
is theAbstractArray
which contains theReal
values of the vector that represent the new state vector.nContinuousStates::Csize_t
: ArgumentnContinuousStates
defines the length of vectornominals
and is provided for checking purposes
Returns
status::fmi3Status
: Returnstatus
is an enumeration of typefmi3Status
and indicates the success of the function call.
More detailed:
fmi3OK
: all wellfmi3Warning
: things are not quite right, but the computation can continuefmi3Discard
: if the slave computed successfully only a subinterval of the communication stepfmi3Error
: the communication step could not be carried out at allfmi3Fatal
: if an error occurred which corrupted the FMU irreparably
Source
- FMISpec3.0 Link: https://fmi-standard.org/
- FMISpec3.0: 2.2.3 Platform Dependent Definitions
- FMISpec3.0: 2.2.4 Status Returned by Functions
- FMISpec3.0: 2.3.3. State: Initialization Mode
See also fmi3GetContinuousStates!
.
FMICore.fmi3GetDirectionalDerivative!
— Methodfmi3GetDirectionalDerivative!(c::FMU3Instance,
unknowns::AbstractArray{fmi3ValueReference},
knowns::AbstractArray{fmi3ValueReference},
sensitivity::AbstractArray{fmi3Float64},
seed::AbstractArray{fmi3Float64})
Wrapper Function call to compute the partial derivative with respect to the variables unknowns
.
Computes the directional derivatives of an FMU. An FMU has different Modes and in every Mode an FMU might be described by different equations and different unknowns. The precise definitions are given in the mathematical descriptions of Model Exchange (section 3) and Co-Simulation (section 4). In every Mode, the general form of the FMU equations are: unknowns = 𝐡(knowns, rest)
unknowns
: vector of unknown Real variables computed in the actual Mode:- Initialization Mode: unkowns kisted under
<ModelStructure><InitialUnknown>
that have type Real. - Continuous-Time Mode (ModelExchange): The continuous-time outputs and state derivatives. (= the variables listed under
<ModelStructure><Output>
with type Real and variability =continuous
and the variables listed as state derivatives under<ModelStructure><ContinuousStateDerivative>)
. - Event Mode (ModelExchange/CoSimulation): The same variables as in the Continuous-Time Mode and additionally variables under
<ModelStructure><Output>
with type Real and variability =discrete
. - Step Mode (CoSimulation): The variables listed under
<ModelStructure><Output>
with type Real and variability =continuous
ordiscrete
. If<ModelStructure><ContinuousStateDerivative>
is present, also the variables listed here as state derivatives.
- Initialization Mode: unkowns kisted under
knowns
: Real input variables of function h that changes its value in the actual Mode.rest
: Set of input variables of function h that either changes its value in the actual Mode but are non-Real variables, or do not change their values in this Mode, but change their values in other Modes
Computes a linear combination of the partial derivatives of h with respect to the selected input variables 𝐯_known:
Δunknowns = (δh / δknowns) Δknowns
Arguments
c::FMU3Instance
Mutable struct represents an instantiated instance of an FMU in the FMI 3.0 Standard.unknowns::AbstracArray{fmi3ValueReference}
: Argumentunknowns
contains values of typefmi3ValueReference
which are identifiers of a variable value of the model.unknowns
can be equated withunknowns
(variable described above).knowns::AbstractArray{fmi3ValueReference}
: Argumentknowns
contains values of typefmi3ValueReference
which are identifiers of a variable value of the model.knowns
can be equated withknowns
(variable described above).sensitivity::AbstractArray{fmi3Float64}
: Stores the directional derivative vector values.seed::AbstractArray{fmi3Float64}
:The vector values Compute the partial derivative with respect to the given entries in vectorknowns
with the matching evaluate ofsensitivity
.
Returns
status::fmi3Status
: Returnstatus
is an enumeration of typefmi3Status
and indicates the success of the function call.
More detailed:
fmi3OK
: all wellfmi3Warning
: things are not quite right, but the computation can continuefmi3Discard
: if the slave computed successfully only a subinterval of the communication stepfmi3Error
: the communication step could not be carried out at allfmi3Fatal
: if an error occurred which corrupted the FMU irreparably
Source
- FMISpec3.0 Link: https://fmi-standard.org/
- FMISpec3.0: 2.2.3 Platform Dependent Definitions
- FMISpec3.0: 2.2.4 Status Returned by Functions
- FMISpec3.0: 2.2.11. Getting Partial Derivatives
See also fmi3GetDirectionalDerivative!
.
FMICore.fmi3GetDirectionalDerivative!
— Methodfmi3GetDirectionalDerivative!(c::FMU3Instance,
unknowns::AbstractArray{fmi3ValueReference},
nUnknowns::Csize_t,
knowns::AbstractArray{fmi3ValueReference},
nKnowns::Csize_t,
seed::AbstractArray{fmi3Float64},
nSeed::Csize_t,
sensitivity::AbstractArray{fmi3Float64},
nSensitivity::Csize_t)
Wrapper Function call to compute the partial derivative with respect to the variables unknowns
.
Computes the directional derivatives of an FMU. An FMU has different Modes and in every Mode an FMU might be described by different equations and different unknowns. The precise definitions are given in the mathematical descriptions of Model Exchange (section 3) and Co-Simulation (section 4). In every Mode, the general form of the FMU equations are: unknowns = 𝐡(knowns, rest)
unknowns
: vector of unknown Real variables computed in the actual Mode:- Initialization Mode: unkowns kisted under
<ModelStructure><InitialUnknown>
that have type Real. - Continuous-Time Mode (ModelExchange): The continuous-time outputs and state derivatives. (= the variables listed under
<ModelStructure><Output>
with type Real and variability =continuous
and the variables listed as state derivatives under<ModelStructure><ContinuousStateDerivative>)
. - Event Mode (ModelExchange/CoSimulation): The same variables as in the Continuous-Time Mode and additionally variables under
<ModelStructure><Output>
with type Real and variability =discrete
. - Step Mode (CoSimulation): The variables listed under
<ModelStructure><Output>
with type Real and variability =continuous
ordiscrete
. If<ModelStructure><ContinuousStateDerivative>
is present, also the variables listed here as state derivatives. knowns
: Real input variables of function h that changes its value in the actual Mode.rest
: Set of input variables of function h that either changes its value in the actual Mode but are non-Real variables, or do not change their values in this Mode, but change their values in other Modes
Computes a linear combination of the partial derivatives of h with respect to the selected input variables 𝐯_known:
Δunknowns = (δh / δknowns) Δknowns
Arguments
c::FMU3Instance
Mutable struct represents an instantiated instance of an FMU in the FMI 3.0 Standard.unknowns::AbstracArray{fmi3ValueReference}
: Argumentunknowns
contains values of typefmi3ValueReference
which are identifiers of a variable value of the model.unknowns
can be equated withunknowns
(variable described above).nUnknowns::Csize_t
:knowns::AbstractArray{fmi3ValueReference}
: Argumentknowns
contains values of typefmi3ValueReference
which are identifiers of a variable value of the model.knowns
can be equated withknowns
(variable described above).nKnowns::Csize_t
:seed::AbstractArray{fmi3Float64}
:The vector values Compute the partial derivative with respect to the given entries in vectorknowns
with the matching evaluate ofsensitivity
.nKnowns::Csize_t
:sensitivity::AbstractArray{fmi3Float64}
: Stores the directional derivative vector values.nKnowns::Csize_t
:
Returns
status::fmi3Status
: Returnstatus
is an enumeration of typefmi3Status
and indicates the success of the function call.
More detailed:
fmi3OK
: all wellfmi3Warning
: things are not quite right, but the computation can continuefmi3Discard
: if the slave computed successfully only a subinterval of the communication stepfmi3Error
: the communication step could not be carried out at allfmi3Fatal
: if an error occurred which corrupted the FMU irreparably
Source
- FMISpec3.0 Link: https://fmi-standard.org/
- FMISpec3.0: 2.2.3 Platform Dependent Definitions
- FMISpec3.0: 2.2.4 Status Returned by Functions
- FMISpec3.0: 2.2.11. Getting Partial Derivatives
See also fmi3GetDirectionalDerivative
.
FMICore.fmi3GetEventIndicators!
— Methodfmi3GetEventIndicators!(c::FMU3Instance, eventIndicators::AbstractArray{fmi3Float64}, ni::Csize_t)
Compute event indicators at the current time instant and for the current states. EventIndicators signal Events by their sign change.
Arguments
c::FMU3Instance
: Mutable struct represents an instantiated instance of an FMU in the FMI 3.0 Standard.eventIndicators::AbstractArray{fmi3Float64}
: ArgumenteventIndicators
contains values of typefmi3Float64
which is a alias type forReal
data type.eventIndicators
is theAbstractArray
which contains theReal
values of the vector that represent the event indicators.ni::Csize_t
: Argumentni
defines the length of vectoreventIndicators
and is provided for checking purposes
Returns
status::fmi3Status
: Returnstatus
is an enumeration of typefmi3Status
and indicates the success of the function call.
More detailed:
fmi3OK
: all wellfmi3Warning
: things are not quite right, but the computation can continuefmi3Discard
: if the slave computed successfully only a subinterval of the communication stepfmi3Error
: the communication step could not be carried out at allfmi3Fatal
: if an error occurred which corrupted the FMU irreparably
Source
- FMISpec3.0 Link: https://fmi-standard.org/
- FMISpec3.0: 2.2.3 Platform Dependent Definitions
- FMISpec3.0: 2.2.4 Status Returned by Functions
- FMISpec3.0: 3.2.1. State: Continuous-Time Mode
See also fmi3GetEventIndicators!
.
FMICore.fmi3GetFMUState!
— Methodfmi3GetFMUState!(c::FMU3Instance, FMUstate::Ref{fmi3FMUState})
Makes a copy of the internal FMU state and returns a pointer to this copy
Arguments
c::FMU3Instance
: Argumentc
is a Mutable struct represents an instantiated instance of an FMU in the FMI 3.0 Standard.FMUstate::Ref{fmi3FMUstate}
:If on entryFMUstate == NULL
, a new allocation is required. IfFMUstate != NULL
, thenFMUstate
points to a previously returnedFMUstate
that has not been modified since.
Returns
status::fmi3Status
: Returnstatus
is an enumeration of typefmi3Status
and indicates the success of the function call.
More detailed:
fmi3OK
: all wellfmi3Warning
: things are not quite right, but the computation can continuefmi3Discard
: if the slave computed successfully only a subinterval of the communication stepfmi3Error
: the communication step could not be carried out at allfmi3Fatal
: if an error occurred which corrupted the FMU irreparably
Source
- FMISpec3.0 Link: https://fmi-standard.org/
- FMISpec3.0: 2.2.3 Platform Dependent Definitions
- FMISpec3.0: 2.2.4 Status Returned by Functions
- FMISpec3.0: 2.2.6.4. Getting and Setting the Complete FMU State
See also fmi3GetFMUState!
.
FMICore.fmi3GetFloat32!
— Methodfmi3GetFloat32!(c::FMU3Instance, vr::AbstractArray{fmi3ValueReference}, nvr::Csize_t, value::AbstractArray{fmi3Float32}, nvalue::Csize_t)
Functions to get and set values of variables idetified by their valueReference.
Arguments
c::FMU3Instance
: Argumentc
is a Mutable struct represents an instantiated instance of an FMU in the FMI 3.0 Standard.vr::AbstractArray{fmi3ValueReference}
: Argumentvr
is an AbstractArray ofnvr
value handels called "ValueReference" that define the variable that shall be inquired.nvr::Csize_t
: Argumentnvr
defines the size ofvr
.values::AbstractArray{fmi3Float32}
: Argumentvalues
is an AbstractArray with the actual values of these variables.nvalue::Csize_t
: Argumentnvalue
defines the size ofvalues
.
Returns
status::fmi3Status
: Returnstatus
is an enumeration of typefmi3Status
and indicates the success of the function call.
More detailed: - fmi3OK
: all well - fmi3Warning
: things are not quite right, but the computation can continue - fmi3Discard
: if the slave computed successfully only a subinterval of the communication step - fmi3Error
: the communication step could not be carried out at all - fmi3Fatal
: if an error occurred which corrupted the FMU irreparably
Source
- FMISpec3.0 Link: https://fmi-standard.org/
- FMISpec3.0: 2.2.3 Platform Dependent Definitions
- FMISpec3.0: 2.2.4 Status Returned by Functions
- FMISpec3.0: 2.2.6.2. Getting and Setting Variable Values
See also fmi3GetFloat32!
.
FMICore.fmi3GetFloat32!
— Methodfmi3GetFloat32!(c::FMU3Instance, vr::fmi3ValueReferenceFormat, values::AbstractArray{fmi3Float32})
Writes the real values of an array of variables in the given field
fmi3GetFloat32! is only possible for arrays of values, please use an array instead of a scalar.
Arguments
c::FMU3Instance
: Mutable struct represents an instantiated instance of an FMU in the FMI 3.0 Standard.vr::fmi3ValueReferenceFormat
: Wildcards for how a user can pass a fmi[X]ValueReference
More detailed: fmi3ValueReferenceFormat = Union{Nothing, String, Array{String,1}, fmi3ValueReference, Array{fmi3ValueReference,1}, Int64, Array{Int64,1}, Symbol}
values::AbstractArray{fmi3Float32}
: Argumentvalues
is an AbstractArray with the actual values of these variables.
Returns
status::fmi3Status
: Returnstatus
is an enumeration of typefmi3Status
and indicates the success of the function call.
More detailed:
fmi3OK
: all wellfmi3Warning
: things are not quite right, but the computation can continuefmi3Discard
: if the slave computed successfully only a subinterval of the communication stepfmi3Error
: the communication step could not be carried out at allfmi3Fatal
: if an error occurred which corrupted the FMU irreparably
Source
- FMISpec3.0 Link: https://fmi-standard.org/
- FMISpec3.0: 2.2.4 Status Returned by Functions
- FMISpec3.0: 2.2.6.2. Getting and Setting Variable Values
See also fmi3GetFloat32!
.
FMICore.fmi3GetFloat64!
— Methodfmi3GetFloat64!(c::FMU3Instance, vr::AbstractArray{fmi3ValueReference}, nvr::Csize_t, value::AbstractArray{fmi3Float64}, nvalue::Csize_t)
Functions to get and set values of variables idetified by their valueReference.
Arguments
c::FMU3Instance
: Argumentc
is a Mutable struct represents an instantiated instance of an FMU in the FMI 3.0 Standard.vr::AbstractArray{fmi3ValueReference}
: Argumentvr
is an AbstractArray ofnvr
value handels called "ValueReference" that define the variable that shall be inquired.nvr::Csize_t
: Argumentnvr
defines the size ofvr
.values::AbstractArray{fmi3Float64}
: Argumentvalues
is an AbstractArray with the actual values of these variables.nvalue::Csize_t
: Argumentnvalue
defines the size ofvalues
.
Returns
status::fmi3Status
: Returnstatus
is an enumeration of typefmi3Status
and indicates the success of the function call.
More detailed: - fmi3OK
: all well - fmi3Warning
: things are not quite right, but the computation can continue - fmi3Discard
: if the slave computed successfully only a subinterval of the communication step - fmi3Error
: the communication step could not be carried out at all - fmi3Fatal
: if an error occurred which corrupted the FMU irreparably
Source
- FMISpec3.0 Link: https://fmi-standard.org/
- FMISpec3.0: 2.2.3 Platform Dependent Definitions
- FMISpec3.0: 2.2.4 Status Returned by Functions
- FMISpec3.0: 2.2.6.2. Getting and Setting Variable Values
See also fmi3GetFloat64!
.
FMICore.fmi3GetFloat64!
— Methodfmi3GetFloat64!(c::FMU3Instance, vr::fmi3ValueReferenceFormat, values::AbstractArray{fmi3Float64})
Writes the real values of an array of variables in the given field
fmi3GetFloat64! is only possible for arrays of values, please use an array instead of a scalar.
Arguments
c::FMU3Instance
: Mutable struct represents an instantiated instance of an FMU in the FMI 3.0 Standard.vr::fmi3ValueReferenceFormat
: Wildcards for how a user can pass a fmi[X]ValueReference
More detailed: fmi3ValueReferenceFormat = Union{Nothing, String, Array{String,1}, fmi3ValueReference, Array{fmi3ValueReference,1}, Int64, Array{Int64,1}, Symbol}
values::AbstractArray{fmi3Float64}
: Argumentvalues
is an AbstractArray with the actual values of these variables.
Returns
status::fmi3Status
: Returnstatus
is an enumeration of typefmi3Status
and indicates the success of the function call.
More detailed:
fmi3OK
: all wellfmi3Warning
: things are not quite right, but the computation can continuefmi3Discard
: if the slave computed successfully only a subinterval of the communication stepfmi3Error
: the communication step could not be carried out at allfmi3Fatal
: if an error occurred which corrupted the FMU irreparably
Source
- FMISpec3.0 Link: https://fmi-standard.org/
- FMISpec3.0: 2.2.4 Status Returned by Functions
- FMISpec3.0: 2.2.6.2. Getting and Setting Variable Values
See also fmi3GetFloat64!
.
FMICore.fmi3GetInt16!
— Methodfmi3GetInt16!(c::FMU3Instance, vr::AbstractArray{fmi3ValueReference}, nvr::Csize_t, value::AbstractArray{fmi3Int16}, nvalue::Csize_t)
Functions to get and set values of variables idetified by their valueReference.
Arguments
c::FMU3Instance
: Argumentc
is a Mutable struct represents an instantiated instance of an FMU in the FMI 3.0 Standard.vr::AbstractArray{fmi3ValueReference}
: Argumentvr
is an AbstractArray ofnvr
value handels called "ValueReference" that define the variable that shall be inquired.nvr::Csize_t
: Argumentnvr
defines the size ofvr
.values::AbstractArray{fmi3Int16}
: Argumentvalues
is an AbstractArray with the actual values of these variables.nvalue::Csize_t
: Argumentnvalue
defines the size ofvalues
.
Returns
status::fmi3Status
: Returnstatus
is an enumeration of typefmi3Status
and indicates the success of the function call.
More detailed: - fmi3OK
: all well - fmi3Warning
: things are not quite right, but the computation can continue - fmi3Discard
: if the slave computed successfully only a subinterval of the communication step - fmi3Error
: the communication step could not be carried out at all - fmi3Fatal
: if an error occurred which corrupted the FMU irreparably
Source
- FMISpec3.0 Link: https://fmi-standard.org/
- FMISpec3.0: 2.2.3 Platform Dependent Definitions
- FMISpec3.0: 2.2.4 Status Returned by Functions
- FMISpec3.0: 2.2.6.2. Getting and Setting Variable Values
See also fmi3GetInt16!
.
FMICore.fmi3GetInt16!
— Methodfmi3GetInt16!(c::FMU3Instance, vr::fmi3ValueReferenceFormat, values::AbstractArray{fmi3Int16})
Writes the integer values of an array of variables in the given field
fmi3GetInt16! is only possible for arrays of values, please use an array instead of a scalar.
Arguments
c::FMU3Instance
: Mutable struct represents an instantiated instance of an FMU in the FMI 3.0 Standard.vr::fmi3ValueReferenceFormat
: Wildcards for how a user can pass a fmi[X]ValueReference
More detailed: fmi3ValueReferenceFormat = Union{Nothing, String, Array{String,1}, fmi3ValueReference, Array{fmi3ValueReference,1}, Int64, Array{Int64,1}, Symbol}
values::AbstractArray{fmi3Int16}
: Argumentvalues
is an AbstractArray with the actual values of these variables.
Returns
status::fmi3Status
: Returnstatus
is an enumeration of typefmi3Status
and indicates the success of the function call.
More detailed:
fmi3OK
: all wellfmi3Warning
: things are not quite right, but the computation can continuefmi3Discard
: if the slave computed successfully only a subinterval of the communication stepfmi3Error
: the communication step could not be carried out at allfmi3Fatal
: if an error occurred which corrupted the FMU irreparably
Source
- FMISpec3.0 Link: https://fmi-standard.org/
- FMISpec3.0: 2.2.4 Status Returned by Functions
- FMISpec3.0: 2.2.6.2. Getting and Setting Variable Values
See also fmi3GetInt16!
.
FMICore.fmi3GetInt32!
— Methodfmi3GetInt32!(c::FMU3Instance, vr::AbstractArray{fmi3ValueReference}, nvr::Csize_t, value::AbstractArray{fmi3Int32}, nvalue::Csize_t)
Functions to get and set values of variables idetified by their valueReference.
Arguments
c::FMU3Instance
: Argumentc
is a Mutable struct represents an instantiated instance of an FMU in the FMI 3.0 Standard.vr::AbstractArray{fmi3ValueReference}
: Argumentvr
is an AbstractArray ofnvr
value handels called "ValueReference" that define the variable that shall be inquired.nvr::Csize_t
: Argumentnvr
defines the size ofvr
.values::AbstractArray{fmi3Int32}
: Argumentvalues
is an AbstractArray with the actual values of these variables.nvalue::Csize_t
: Argumentnvalue
defines the size ofvalues
.
Returns
status::fmi3Status
: Returnstatus
is an enumeration of typefmi3Status
and indicates the success of the function call.
More detailed: - fmi3OK
: all well - fmi3Warning
: things are not quite right, but the computation can continue - fmi3Discard
: if the slave computed successfully only a subinterval of the communication step - fmi3Error
: the communication step could not be carried out at all - fmi3Fatal
: if an error occurred which corrupted the FMU irreparably
Source
- FMISpec3.0 Link: https://fmi-standard.org/
- FMISpec3.0: 2.2.3 Platform Dependent Definitions
- FMISpec3.0: 2.2.4 Status Returned by Functions
- FMISpec3.0: 2.2.6.2. Getting and Setting Variable Values
See also fmi3GetInt32!
.
FMICore.fmi3GetInt32!
— Methodfmi3GetInt32!(c::FMU3Instance, vr::fmi3ValueReferenceFormat, values::AbstractArray{fmi3Int32})
Writes the integer values of an array of variables in the given field
fmi3GetInt32! is only possible for arrays of values, please use an array instead of a scalar.
Arguments
c::FMU3Instance
: Mutable struct represents an instantiated instance of an FMU in the FMI 3.0 Standard.vr::fmi3ValueReferenceFormat
: Wildcards for how a user can pass a fmi[X]ValueReference
More detailed: fmi3ValueReferenceFormat = Union{Nothing, String, Array{String,1}, fmi3ValueReference, Array{fmi3ValueReference,1}, Int64, Array{Int64,1}, Symbol}
values::AbstractArray{fmi3Int32}
: Argumentvalues
is an AbstractArray with the actual values of these variables.
Returns
status::fmi3Status
: Returnstatus
is an enumeration of typefmi3Status
and indicates the success of the function call.
More detailed:
fmi3OK
: all wellfmi3Warning
: things are not quite right, but the computation can continuefmi3Discard
: if the slave computed successfully only a subinterval of the communication stepfmi3Error
: the communication step could not be carried out at allfmi3Fatal
: if an error occurred which corrupted the FMU irreparably
Source
- FMISpec3.0 Link: https://fmi-standard.org/
- FMISpec3.0: 2.2.4 Status Returned by Functions
- FMISpec3.0: 2.2.6.2. Getting and Setting Variable Values
See also fmi3GetInt32!
.
FMICore.fmi3GetInt64!
— Methodfmi3GetInt64!(c::FMU3Instance, vr::AbstractArray{fmi3ValueReference}, nvr::Csize_t, value::AbstractArray{fmi3Int64}, nvalue::Csize_t)
Functions to get and set values of variables idetified by their valueReference.
Arguments
c::FMU3Instance
: Argumentc
is a Mutable struct represents an instantiated instance of an FMU in the FMI 3.0 Standard.vr::AbstractArray{fmi3ValueReference}
: Argumentvr
is an AbstractArray ofnvr
value handels called "ValueReference" that define the variable that shall be inquired.nvr::Csize_t
: Argumentnvr
defines the size ofvr
.values::AbstractArray{fmi3Int64}
: Argumentvalues
is an AbstractArray with the actual values of these variables.nvalue::Csize_t
: Argumentnvalue
defines the size ofvalues
.
Returns
status::fmi3Status
: Returnstatus
is an enumeration of typefmi3Status
and indicates the success of the function call.
More detailed: - fmi3OK
: all well - fmi3Warning
: things are not quite right, but the computation can continue - fmi3Discard
: if the slave computed successfully only a subinterval of the communication step - fmi3Error
: the communication step could not be carried out at all - fmi3Fatal
: if an error occurred which corrupted the FMU irreparably
Source
- FMISpec3.0 Link: https://fmi-standard.org/
- FMISpec3.0: 2.2.3 Platform Dependent Definitions
- FMISpec3.0: 2.2.4 Status Returned by Functions
- FMISpec3.0: 2.2.6.2. Getting and Setting Variable Values
See also fmi3GetInt64!
.
FMICore.fmi3GetInt64!
— Methodfmi3GetInt64!(c::FMU3Instance, vr::fmi3ValueReferenceFormat, values::AbstractArray{fmi3Int64})
Writes the integer values of an array of variables in the given field
fmi3GetInt64! is only possible for arrays of values, please use an array instead of a scalar.
Arguments
c::FMU3Instance
: Mutable struct represents an instantiated instance of an FMU in the FMI 3.0 Standard.vr::fmi3ValueReferenceFormat
: Wildcards for how a user can pass a fmi[X]ValueReference
More detailed: fmi3ValueReferenceFormat = Union{Nothing, String, Array{String,1}, fmi3ValueReference, Array{fmi3ValueReference,1}, Int64, Array{Int64,1}, Symbol}
values::AbstractArray{fmi3Int64}
: Argumentvalues
is an AbstractArray with the actual values of these variables.
Returns
status::fmi3Status
: Returnstatus
is an enumeration of typefmi3Status
and indicates the success of the function call.
More detailed:
fmi3OK
: all wellfmi3Warning
: things are not quite right, but the computation can continuefmi3Discard
: if the slave computed successfully only a subinterval of the communication stepfmi3Error
: the communication step could not be carried out at allfmi3Fatal
: if an error occurred which corrupted the FMU irreparably
Source
- FMISpec3.0 Link: https://fmi-standard.org/
- FMISpec3.0: 2.2.4 Status Returned by Functions
- FMISpec3.0: 2.2.6.2. Getting and Setting Variable Values
See also fmi3GetInt64!
.
FMICore.fmi3GetInt8!
— Methodfmi3GetInt8!(c::FMU3Instance, vr::AbstractArray{fmi3ValueReference}, nvr::Csize_t, value::AbstractArray{fmi3Int8}, nvalue::Csize_t)
Functions to get and set values of variables idetified by their valueReference.
Arguments
c::FMU3Instance
: Argumentc
is a Mutable struct represents an instantiated instance of an FMU in the FMI 3.0 Standard.vr::AbstractArray{fmi3ValueReference}
: Argumentvr
is an AbstractArray ofnvr
value handels called "ValueReference" that define the variable that shall be inquired.nvr::Csize_t
: Argumentnvr
defines the size ofvr
.values::AbstractArray{fmi3Int8}
: Argumentvalues
is an AbstractArray with the actual values of these variables.nvalue::Csize_t
: Argumentnvalue
defines the size ofvalues
.
Returns
status::fmi3Status
: Returnstatus
is an enumeration of typefmi3Status
and indicates the success of the function call.
More detailed: - fmi3OK
: all well - fmi3Warning
: things are not quite right, but the computation can continue - fmi3Discard
: if the slave computed successfully only a subinterval of the communication step - fmi3Error
: the communication step could not be carried out at all - fmi3Fatal
: if an error occurred which corrupted the FMU irreparably
Source
- FMISpec3.0 Link: https://fmi-standard.org/
- FMISpec3.0: 2.2.3 Platform Dependent Definitions
- FMISpec3.0: 2.2.4 Status Returned by Functions
- FMISpec3.0: 2.2.6.2. Getting and Setting Variable Values
See also fmi3GetInt8!
.
FMICore.fmi3GetInt8!
— Methodfmi3GetInt8!(c::FMU3Instance, vr::fmi3ValueReferenceFormat, values::AbstractArray{fmi3Int8})
Writes the integer values of an array of variables in the given field
fmi3GetInt8! is only possible for arrays of values, please use an array instead of a scalar.
Arguments
c::FMU3Instance
: Mutable struct represents an instantiated instance of an FMU in the FMI 3.0 Standard.vr::fmi3ValueReferenceFormat
: Wildcards for how a user can pass a fmi[X]ValueReference
More detailed: fmi3ValueReferenceFormat = Union{Nothing, String, Array{String,1}, fmi3ValueReference, Array{fmi3ValueReference,1}, Int64, Array{Int64,1}, Symbol}
values::AbstractArray{fmi3Int8}
: Argumentvalues
is an AbstractArray with the actual values of these variables.
Returns
status::fmi3Status
: Returnstatus
is an enumeration of typefmi3Status
and indicates the success of the function call.
More detailed:
fmi3OK
: all wellfmi3Warning
: things are not quite right, but the computation can continuefmi3Discard
: if the slave computed successfully only a subinterval of the communication stepfmi3Error
: the communication step could not be carried out at allfmi3Fatal
: if an error occurred which corrupted the FMU irreparably
Source
- FMISpec3.0 Link: https://fmi-standard.org/
- FMISpec3.0: 2.2.4 Status Returned by Functions
- FMISpec3.0: 2.2.6.2. Getting and Setting Variable Values
See also fmi3GetInt8!
.
FMICore.fmi3GetIntervalDecimal!
— Methodfmi3GetIntervalDecimal!(c::FMU3Instance, vr::AbstractArray{fmi3ValueReference}, nvr::Csize_t, intervals::AbstractArray{fmi3Float64}, qualifiers::fmi3IntervalQualifier)
fmi3GetIntervalDecimal retrieves the interval until the next clock tick.
For input Clocks it is allowed to call this function to query the next activation interval. For changing aperiodic Clock, this function must be called in every Event Mode where this clock was activated. For countdown aperiodic Clock, this function must be called in every Event Mode. Clock intervals are computed in fmi3UpdateDiscreteStates (at the latest), therefore, this function should be called after fmi3UpdateDiscreteStates. For information about fmi3IntervalQualifiers, call ?fmi3IntervalQualifier
TODO argmuents
Arguments
c::FMU3Instance
: Argumentc
is a Mutable struct represents an instantiated instance of an FMU in the FMI 3.0 Standard.vr::AbstractArray{fmi3ValueReference}
: Argumentvr
is an AbstractArray ofnvr
value handels called "ValueReference" that define the variable that shall be inquired.nvr::Csize_t
: Argumentnvr
defines the size ofvr
.intervals::AbstractArray{fmi3Float64}
:qualifiers::fmi3IntervalQualifier
:
Returns
status::fmi3Status
: Returnstatus
is an enumeration of typefmi3Status
and indicates the success of the function call.
More detailed:
fmi3OK
: all wellfmi3Warning
: things are not quite right, but the computation can continuefmi3Discard
: if the slave computed successfully only a subinterval of the communication stepfmi3Error
: the communication step could not be carried out at allfmi3Fatal
: if an error occurred which corrupted the FMU irreparably
Source
- FMISpec3.0 Link: https://fmi-standard.org/
- FMISpec3.0: 2.2.3 Platform Dependent Definitions
- FMISpec3.0: 2.2.4 Status Returned by Functions
- FMISpec3.0: 2.2.9. Clocks
See also fmi3GetIntervalDecimal!
.
FMICore.fmi3GetIntervalFraction!
— Methodfmi3GetIntervalFraction!(c::FMU3Instance, vr::AbstractArray{fmi3ValueReference}, nvr::Csize_t, intervalCounters::AbstractArray{fmi3UInt64}, resolutions::AbstractArray{fmi3UInt64}, qualifiers::fmi3IntervalQualifier)
fmi3GetIntervalFraction retrieves the interval until the next clock tick.
For input Clocks it is allowed to call this function to query the next activation interval. For changing aperiodic Clock, this function must be called in every Event Mode where this clock was activated. For countdown aperiodic Clock, this function must be called in every Event Mode. Clock intervals are computed in fmi3UpdateDiscreteStates (at the latest), therefore, this function should be called after fmi3UpdateDiscreteStates. For information about fmi3IntervalQualifiers, call ?fmi3IntervalQualifier
TODO argmuents
Arguments
c::FMU3Instance
: Argumentc
is a Mutable struct represents an instantiated instance of an FMU in the FMI 3.0 Standard.vr::AbstractArray{fmi3ValueReference}
: Argumentvr
is an AbstractArray ofnvr
value handels called "ValueReference" that define the variable that shall be inquired.nvr::Csize_t
: Argumentnvr
defines the size ofvr
.intervalCounters::AbstractArray{fmi3UInt64}
:resolutions::AbstractArray{fmi3UInt64}
:qualifiers::fmi3IntervalQualifier
:
Returns
status::fmi3Status
: Returnstatus
is an enumeration of typefmi3Status
and indicates the success of the function call.
More detailed:
fmi3OK
: all wellfmi3Warning
: things are not quite right, but the computation can continuefmi3Discard
: if the slave computed successfully only a subinterval of the communication stepfmi3Error
: the communication step could not be carried out at allfmi3Fatal
: if an error occurred which corrupted the FMU irreparably
Source
- FMISpec3.0 Link: https://fmi-standard.org/
- FMISpec3.0: 2.2.3 Platform Dependent Definitions
- FMISpec3.0: 2.2.4 Status Returned by Functions
- FMISpec3.0: 2.2.9. Clocks
See also fmi3GetIntervalFraction!
.
FMICore.fmi3GetNominalsOfContinuousStates!
— Methodfmi3GetNominalsOfContinuousStates!(c::FMU3Instance, x_nominal::AbstractArray{fmi3Float64}, nx::Csize_t)
Return the nominal values of the continuous states.
If fmi3UpdateDiscreteStates
returned with nominalsOfContinuousStatesChanged == fmi3True
, then at least one nominal value of the states has changed and can be inquired with fmi3GetNominalsOfContinuousStates
. Not allowed in Co-Simulation and Scheduled Execution.
Arguments
c::FMU3Instance
: Mutable struct represents an instantiated instance of an FMU in the FMI 2.0.2 Standard.x_nominal::AbstractArray{fmi3Float64}
: Argumentx_nominal
contains values of typefmi3Float64
which is a alias type forReal
data type.x_nominal
is theAbstractArray
which contains theReal
values of the vector that represent the nominal values of the continuous states.nx::Csize_t
: Argumentnx
defines the length of vectorx_nominal
and is provided for checking purposes
Returns
status::fmi3Status
: Returnstatus
is an enumeration of typefmi3Status
and indicates the success of the function call.
More detailed:
fmi3OK
: all wellfmi3Warning
: things are not quite right, but the computation can continuefmi3Discard
: if the slave computed successfully only a subinterval of the communication stepfmi3Error
: the communication step could not be carried out at allfmi3Fatal
: if an error occurred which corrupted the FMU irreparably
Source
- FMISpec3.0 Link: https://fmi-standard.org/
- FMISpec3.0: 2.2.3 Platform Dependent Definitions
- FMISpec3.0: 2.2.4 Status Returned by Functions
- FMISpec3.0: 2.3.3. State: Initialization Mode
See also fmi3GetNominalsOfContinuousStates!
.
FMICore.fmi3GetNumberOfContinuousStates!
— Methodfmi3GetNumberOfContinuousStates!(c::FMU3Instance, nContinuousStates::Ref{Csize_t})
This function returns the number of continuous states. This function can only be called in Model Exchange.
fmi3GetNumberOfContinuousStates
must be called after a structural parameter is changed. As long as no structural parameters changed, the number of states is given in the modelDescription.xml, alleviating the need to call this function.
Arguments
c::FMU3Instance
: Mutable struct represents an instantiated instance of an FMU in the FMI 3.0 Standard.nContinuousStates::Ref{Csize_t}
: Stores the number of continuous states returned by the function
Returns
status::fmi3Status
: Returnstatus
is an enumeration of typefmi3Status
and indicates the success of the function call.
More detailed:
fmi3OK
: all wellfmi3Warning
: things are not quite right, but the computation can continuefmi3Discard
: if the slave computed successfully only a subinterval of the communication stepfmi3Error
: the communication step could not be carried out at allfmi3Fatal
: if an error occurred which corrupted the FMU irreparably
Source
- FMISpec3.0 Link: https://fmi-standard.org/
- FMISpec3.0: 2.2.3 Platform Dependent Definitions
- FMISpec3.0: 2.2.4 Status Returned by Functions
- FMISpec3.0: 2.3.2. State: Instantiated
See also fmi3GetNumberOfContinuousStates!
.
FMICore.fmi3GetNumberOfEventIndicators!
— Methodfmi3GetNumberOfEventIndicators!(c::FMU3Instance, nEventIndicators::Ref{Csize_t})
This function returns the number of event indicators. This function can only be called in Model Exchange.
fmi3GetNumberOfEventIndicators
must be called after a structural parameter is changed. As long as no structural parameters changed, the number of states is given in the modelDescription.xml, alleviating the need to call this function.
Arguments
c::FMU3Instance
: Mutable struct represents an instantiated instance of an FMU in the FMI 3.0 Standard.nEventIndicators::Ref{Csize_t}
: Stores the number of continuous states returned by the function
Returns
status::fmi3Status
: Returnstatus
is an enumeration of typefmi3Status
and indicates the success of the function call.
More detailed:
fmi3OK
: all wellfmi3Warning
: things are not quite right, but the computation can continuefmi3Discard
: if the slave computed successfully only a subinterval of the communication stepfmi3Error
: the communication step could not be carried out at allfmi3Fatal
: if an error occurred which corrupted the FMU irreparably
Source
- FMISpec3.0 Link: https://fmi-standard.org/
- FMISpec3.0: 2.2.3 Platform Dependent Definitions
- FMISpec3.0: 2.2.4 Status Returned by Functions
- FMISpec3.0: 2.3.2. State: Instantiated
See also fmi3GetNumberOfEventIndicators!
.
FMICore.fmi3GetNumberOfVariableDependencies!
— Methodfmi3GetNumberOfVariableDependencies!(c::FMU3Instance, vr::fmi3ValueReference, nvr::Ref{Csize_t})
The number of dependencies of a given variable, which may change if structural parameters are changed, can be retrieved by calling fmi3GetNumberOfVariableDependencies.
This information can only be retrieved if the 'providesPerElementDependencies' tag in the ModelDescription is set.
Arguments
c::FMU3Instance
: Argumentc
is a Mutable struct represents an instantiated instance of an FMU in the FMI 3.0 Standard.vr::fmi3ValueReference
: Argumentvr
is the value handel called "ValueReference" that define the variable that shall be inquired.nvr::Csize_t
: Argumentnvr
defines the size ofvr
.
Returns
status::fmi3Status
: Returnstatus
is an enumeration of typefmi3Status
and indicates the success of the function call.
More detailed:
fmi3OK
: all wellfmi3Warning
: things are not quite right, but the computation can continuefmi3Discard
: if the slave computed successfully only a subinterval of the communication stepfmi3Error
: the communication step could not be carried out at allfmi3Fatal
: if an error occurred which corrupted the FMU irreparably
Source
- FMISpec3.0 Link: https://fmi-standard.org/
- FMISpec3.0: 2.2.3 Platform Dependent Definitions
- FMISpec3.0: 2.2.4 Status Returned by Functions
- FMISpec3.0: 2.2.10. Dependencies of Variables
See also fmi3GetNumberOfVariableDependencies!
.
FMICore.fmi3GetOutputDerivatives!
— Methodfmi3GetOutputDerivatives!(c::FMU3Instance, vr::AbstractArray{fmi3ValueReference}, nValueReferences::Csize_t, order::AbstractArray{fmi3Int32}, values::AbstractArray{fmi3Float64}, nValues::Csize_t)
Retrieves the n-th derivative of output values.
Arguments
c::FMU3Instance
: Mutable struct represents an instantiated instance of an FMU in the FMI 3.0 Standard.vr::Array{fmi3ValueReference}
: Argumentvr
is an array ofnValueReferences
value handels called "ValueReference" that t define the variables whose derivatives shall be set.nValueReferences::Csize_t
: ArgumentnValueReferences
defines the size ofvr
.order::Array{fmi3Int32}
: Argumentorder
is an array of fmi3Int32 values witch specifys the corresponding order of derivative of the real input variable.values::Array{fmi3Float64}
: Argumentvalues
is an array with the actual values of these variables.nValues::Csize_t
: ArgumentnValues
defines the size ofvalues
.
Returns
status::fmi3Status
: Returnstatus
is an enumeration of typefmi3Status
and indicates the success of the function call.
More detailed:
fmi3OK
: all wellfmi3Warning
: things are not quite right, but the computation can continuefmi3Discard
: if the slave computed successfully only a subinterval of the communication stepfmi3Error
: the communication step could not be carried out at allfmi3Fatal
: if an error occurred which corrupted the FMU irreparably
Source
- FMISpec3.0 Link: https://fmi-standard.org/
- FMISpec3.0: 2.2.3 Platform Dependent Definitions
- FMISpec3.0: 2.2.4 Status Returned by Functions
- FMISpec3.0: 2.2.12. Getting Derivatives of Continuous Outputs
See also fmi3GetOutputDerivatives!
.
FMICore.fmi3GetShiftDecimal!
— Methodfmi3GetShiftDecimal!(c::FMU3Instance, vr::AbstractArray{fmi3ValueReference}, nvr::Csize_t, shifts::AbstractArray{fmi3Float64})
fmi3GetShiftDecimal retrieves the delay to the first Clock tick from the FMU.
TODO argmuents
Arguments
c::FMU3Instance
: Argumentc
is a Mutable struct represents an instantiated instance of an FMU in the FMI 3.0 Standard.vr::AbstractArray{fmi3ValueReference}
: Argumentvr
is an AbstractArray ofnvr
value handels called "ValueReference" that define the variable that shall be inquired.nvr::Csize_t
: Argumentnvr
defines the size ofvr
.shifts::AbstractArray{fmi3Float64}
:
Returns
status::fmi3Status
: Returnstatus
is an enumeration of typefmi3Status
and indicates the success of the function call.
More detailed:
fmi3OK
: all wellfmi3Warning
: things are not quite right, but the computation can continuefmi3Discard
: if the slave computed successfully only a subinterval of the communication stepfmi3Error
: the communication step could not be carried out at allfmi3Fatal
: if an error occurred which corrupted the FMU irreparably
Source
- FMISpec3.0 Link: https://fmi-standard.org/
- FMISpec3.0: 2.2.3 Platform Dependent Definitions
- FMISpec3.0: 2.2.4 Status Returned by Functions
- FMISpec3.0: 2.2.9. Clocks
See also fmi3GetShiftDecimal!
.
FMICore.fmi3GetShiftFraction!
— Methodfmi3GetShiftFraction!(c::FMU3Instance, vr::AbstractArray{fmi3ValueReference}, nvr::Csize_t, shiftCounters::AbstractArray{fmi3UInt64}, resolutions::AbstractArray{fmi3UInt64})
fmi3GetShiftFraction retrieves the delay to the first Clock tick from the FMU.
TODO argmuents
Arguments
c::FMU3Instance
: Argumentc
is a Mutable struct represents an instantiated instance of an FMU in the FMI 3.0 Standard.vr::AbstractArray{fmi3ValueReference}
: Argumentvr
is an AbstractArray ofnvr
value handels called "ValueReference" that define the variable that shall be inquired.nvr::Csize_t
: Argumentnvr
defines the size ofvr
.shiftCounters::AbstractArray{fmi3UInt64}
:resolutions::AbstractArray{fmi3UInt64}
:
Returns
status::fmi3Status
: Returnstatus
is an enumeration of typefmi3Status
and indicates the success of the function call.
More detailed:
fmi3OK
: all wellfmi3Warning
: things are not quite right, but the computation can continuefmi3Discard
: if the slave computed successfully only a subinterval of the communication stepfmi3Error
: the communication step could not be carried out at allfmi3Fatal
: if an error occurred which corrupted the FMU irreparably
Source
- FMISpec3.0 Link: https://fmi-standard.org/
- FMISpec3.0: 2.2.3 Platform Dependent Definitions
- FMISpec3.0: 2.2.4 Status Returned by Functions
- FMISpec3.0: 2.2.9. Clocks
See also fmi3GetShiftFraction!
.
FMICore.fmi3GetString!
— Methodfmi3GetString!(c::FMU3Instance, vr::AbstractArray{fmi3ValueReference}, nvr::Csize_t, value::AbstractArray{fmi3String}, nvalue::Csize_t)
Functions to get and set values of variables idetified by their valueReference.
Arguments
c::FMU3Instance
: Argumentc
is a Mutable struct represents an instantiated instance of an FMU in the FMI 3.0 Standard.vr::AbstractArray{fmi3ValueReference}
: Argumentvr
is an AbstractArray ofnvr
value handels called "ValueReference" that define the variable that shall be inquired.nvr::Csize_t
: Argumentnvr
defines the size ofvr
.values::AbstractArray{fmi3String}
: Argumentvalues
is an AbstractArray with the actual values of these variables.nvalue::Csize_t
: Argumentnvalue
defines the size ofvalues
.
Returns
status::fmi3Status
: Returnstatus
is an enumeration of typefmi3Status
and indicates the success of the function call.
More detailed:
fmi3OK
: all wellfmi3Warning
: things are not quite right, but the computation can continuefmi3Discard
: if the slave computed successfully only a subinterval of the communication stepfmi3Error
: the communication step could not be carried out at allfmi3Fatal
: if an error occurred which corrupted the FMU irreparably
Source
- FMISpec3.0 Link: https://fmi-standard.org/
- FMISpec3.0: 2.2.3 Platform Dependent Definitions
- FMISpec3.0: 2.2.4 Status Returned by Functions
- FMISpec3.0: 2.2.6.2. Getting and Setting Variable Values
See also fmi3GetString!
.
FMICore.fmi3GetString!
— Methodfmi3GetString!(c::FMU3Instance, vr::fmi3ValueReferenceFormat, values::AbstractArray{fmi3String})
Writes the string values of an array of variables in the given field
fmi3GetString! is only possible for arrays of values, please use an array instead of a scalar.
Arguments
c::FMU3Instance
: Mutable struct represents an instantiated instance of an FMU in the FMI 3.0 Standard.vr::fmi3ValueReferenceFormat
: Wildcards for how a user can pass a fmi[X]ValueReference
More detailed: fmi3ValueReferenceFormat = Union{Nothing, String, Array{String,1}, fmi3ValueReference, Array{fmi3ValueReference,1}, Int64, Array{Int64,1}, Symbol}
values::AbstractArray{fmi3String}
: Argumentvalues
is an AbstractArray with the actual values of these variables.
Returns
status::fmi3Status
: Returnstatus
is an enumeration of typefmi3Status
and indicates the success of the function call.
More detailed:
fmi3OK
: all wellfmi3Warning
: things are not quite right, but the computation can continuefmi3Discard
: if the slave computed successfully only a subinterval of the communication stepfmi3Error
: the communication step could not be carried out at allfmi3Fatal
: if an error occurred which corrupted the FMU irreparably
Source
- FMISpec3.0 Link: https://fmi-standard.org/
- FMISpec3.0: 2.2.4 Status Returned by Functions
- FMISpec3.0: 2.2.6.2. Getting and Setting Variable Values
See also fmi3GetString!
.
FMICore.fmi3GetUInt16!
— Methodfmi3GetUInt16(c::FMU3Instance, vr::AbstractArray{fmi3ValueReference}, nvr::Csize_t, value::AbstractArray{fmi3UInt16}, nvalue::Csize_t)
Functions to get and set values of variables idetified by their valueReference.
Arguments
c::FMU3Instance
: Argumentc
is a Mutable struct represents an instantiated instance of an FMU in the FMI 3.0 Standard.vr::AbstractArray{fmi3ValueReference}
: Argumentvr
is an AbstractArray ofnvr
value handels called "ValueReference" that define the variable that shall be inquired.nvr::Csize_t
: Argumentnvr
defines the size ofvr
.values::AbstractArray{fmi3UInt16}
: Argumentvalues
is an AbstractArray with the actual values of these variables.nvalue::Csize_t
: Argumentnvalue
defines the size ofvalues
.
Returns
status::fmi3Status
: Returnstatus
is an enumeration of typefmi3Status
and indicates the success of the function call.
More detailed: - fmi3OK
: all well - fmi3Warning
: things are not quite right, but the computation can continue - fmi3Discard
: if the slave computed successfully only a subinterval of the communication step - fmi3Error
: the communication step could not be carried out at all - fmi3Fatal
: if an error occurred which corrupted the FMU irreparably
Source
- FMISpec3.0 Link: https://fmi-standard.org/
- FMISpec3.0: 2.2.3 Platform Dependent Definitions
- FMISpec3.0: 2.2.4 Status Returned by Functions
- FMISpec3.0: 2.2.6.2. Getting and Setting Variable Values
See also fmi3GetUInt16!
.
FMICore.fmi3GetUInt16!
— Methodfmi3GetUInt16!(c::FMU3Instance, vr::fmi3ValueReferenceFormat, values::AbstractArray{fmi3UInt16})
Writes the integer values of an array of variables in the given field
fmi3GetUInt16! is only possible for arrays of values, please use an array instead of a scalar.
Arguments
c::FMU3Instance
: Mutable struct represents an instantiated instance of an FMU in the FMI 3.0 Standard.vr::fmi3ValueReferenceFormat
: Wildcards for how a user can pass a fmi[X]ValueReference
More detailed: fmi3ValueReferenceFormat = Union{Nothing, String, Array{String,1}, fmi3ValueReference, Array{fmi3ValueReference,1}, Int64, Array{Int64,1}, Symbol}
values::AbstractArray{fmi3UInt16}
: Argumentvalues
is an AbstractArray with the actual values of these variables.
Returns
status::fmi3Status
: Returnstatus
is an enumeration of typefmi3Status
and indicates the success of the function call.
More detailed:
fmi3OK
: all wellfmi3Warning
: things are not quite right, but the computation can continuefmi3Discard
: if the slave computed successfully only a subinterval of the communication stepfmi3Error
: the communication step could not be carried out at allfmi3Fatal
: if an error occurred which corrupted the FMU irreparably
Source
- FMISpec3.0 Link: https://fmi-standard.org/
- FMISpec3.0: 2.2.4 Status Returned by Functions
- FMISpec3.0: 2.2.6.2. Getting and Setting Variable Values
See also fmi3GetUInt16!
.
FMICore.fmi3GetUInt32!
— Methodfmi3GetUInt32!(c::FMU3Instance, vr::AbstractArray{fmi3ValueReference}, nvr::Csize_t, value::AbstractArray{fmi3UInt32}, nvalue::Csize_t)
Functions to get and set values of variables idetified by their valueReference.
Arguments
c::FMU3Instance
: Argumentc
is a Mutable struct represents an instantiated instance of an FMU in the FMI 3.0 Standard.vr::AbstractArray{fmi3ValueReference}
: Argumentvr
is an AbstractArray ofnvr
value handels called "ValueReference" that define the variable that shall be inquired.nvr::Csize_t
: Argumentnvr
defines the size ofvr
.values::AbstractArray{fmi3UInt32}
: Argumentvalues
is an AbstractArray with the actual values of these variables.nvalue::Csize_t
: Argumentnvalue
defines the size ofvalues
.
Returns
status::fmi3Status
: Returnstatus
is an enumeration of typefmi3Status
and indicates the success of the function call.
More detailed: - fmi3OK
: all well - fmi3Warning
: things are not quite right, but the computation can continue - fmi3Discard
: if the slave computed successfully only a subinterval of the communication step - fmi3Error
: the communication step could not be carried out at all - fmi3Fatal
: if an error occurred which corrupted the FMU irreparably
Source
- FMISpec3.0 Link: https://fmi-standard.org/
- FMISpec3.0: 2.2.3 Platform Dependent Definitions
- FMISpec3.0: 2.2.4 Status Returned by Functions
- FMISpec3.0: 2.2.6.2. Getting and Setting Variable Values
See also fmi3GetUInt32!
.
FMICore.fmi3GetUInt32!
— Methodfmi3GetUInt32!(c::FMU3Instance, vr::fmi3ValueReferenceFormat, values::AbstractArray{fmi3UInt32})
Writes the integer values of an array of variables in the given field
fmi3GetUInt32! is only possible for arrays of values, please use an array instead of a scalar.
Arguments
c::FMU3Instance
: Mutable struct represents an instantiated instance of an FMU in the FMI 3.0 Standard.vr::fmi3ValueReferenceFormat
: Wildcards for how a user can pass a fmi[X]ValueReference
More detailed: fmi3ValueReferenceFormat = Union{Nothing, String, Array{String,1}, fmi3ValueReference, Array{fmi3ValueReference,1}, Int64, Array{Int64,1}, Symbol}
values::AbstractArray{fmi3UInt32}
: Argumentvalues
is an AbstractArray with the actual values of these variables.
Returns
status::fmi3Status
: Returnstatus
is an enumeration of typefmi3Status
and indicates the success of the function call.
More detailed:
fmi3OK
: all wellfmi3Warning
: things are not quite right, but the computation can continuefmi3Discard
: if the slave computed successfully only a subinterval of the communication stepfmi3Error
: the communication step could not be carried out at allfmi3Fatal
: if an error occurred which corrupted the FMU irreparably
Source
- FMISpec3.0 Link: https://fmi-standard.org/
- FMISpec3.0: 2.2.4 Status Returned by Functions
- FMISpec3.0: 2.2.6.2. Getting and Setting Variable Values
See also fmi3GetUInt32!
.
FMICore.fmi3GetUInt64!
— Methodfmi3GetUInt64!(c::FMU3Instance, vr::AbstractArray{fmi3ValueReference}, nvr::Csize_t, value::AbstractArray{fmi3UInt64}, nvalue::Csize_t)
Functions to get and set values of variables idetified by their valueReference.
Arguments
c::FMU3Instance
: Argumentc
is a Mutable struct represents an instantiated instance of an FMU in the FMI 3.0 Standard.vr::AbstractArray{fmi3ValueReference}
: Argumentvr
is an AbstractArray ofnvr
value handels called "ValueReference" that define the variable that shall be inquired.nvr::Csize_t
: Argumentnvr
defines the size ofvr
.values::AbstractArray{fmi3UInt64}
: Argumentvalues
is an AbstractArray with the actual values of these variables.nvalue::Csize_t
: Argumentnvalue
defines the size ofvalues
.
Returns
status::fmi3Status
: Returnstatus
is an enumeration of typefmi3Status
and indicates the success of the function call.
More detailed: - fmi3OK
: all well - fmi3Warning
: things are not quite right, but the computation can continue - fmi3Discard
: if the slave computed successfully only a subinterval of the communication step - fmi3Error
: the communication step could not be carried out at all - fmi3Fatal
: if an error occurred which corrupted the FMU irreparably
Source
- FMISpec3.0 Link: https://fmi-standard.org/
- FMISpec3.0: 2.2.3 Platform Dependent Definitions
- FMISpec3.0: 2.2.4 Status Returned by Functions
- FMISpec3.0: 2.2.6.2. Getting and Setting Variable Values
See also fmi3GetUInt64!
.
FMICore.fmi3GetUInt64!
— Methodfmi3GetUInt64!(c::FMU3Instance, vr::fmi3ValueReferenceFormat, values::AbstractArray{fmi3UInt64})
Writes the integer values of an array of variables in the given field
fmi3GetUInt64! is only possible for arrays of values, please use an array instead of a scalar.
Arguments
c::FMU3Instance
: Mutable struct represents an instantiated instance of an FMU in the FMI 3.0 Standard.vr::fmi3ValueReferenceFormat
: Wildcards for how a user can pass a fmi[X]ValueReference
More detailed: fmi3ValueReferenceFormat = Union{Nothing, String, Array{String,1}, fmi3ValueReference, Array{fmi3ValueReference,1}, Int64, Array{Int64,1}, Symbol}
values::AbstractArray{fmi3UInt64}
: Argumentvalues
is an AbstractArray with the actual values of these variables.
Returns
status::fmi3Status
: Returnstatus
is an enumeration of typefmi3Status
and indicates the success of the function call.
More detailed:
fmi3OK
: all wellfmi3Warning
: things are not quite right, but the computation can continuefmi3Discard
: if the slave computed successfully only a subinterval of the communication stepfmi3Error
: the communication step could not be carried out at allfmi3Fatal
: if an error occurred which corrupted the FMU irreparably
Source
- FMISpec3.0 Link: https://fmi-standard.org/
- FMISpec3.0: 2.2.4 Status Returned by Functions
- FMISpec3.0: 2.2.6.2. Getting and Setting Variable Values
See also fmi3GetUInt64!
.
FMICore.fmi3GetUInt8!
— Methodfmi3GetUInt8!(c::FMU3Instance, vr::AbstractArray{fmi3ValueReference}, nvr::Csize_t, value::AbstractArray{fmi3UInt8}, nvalue::Csize_t)
Functions to get and set values of variables idetified by their valueReference.
Arguments
c::FMU3Instance
: Argumentc
is a Mutable struct represents an instantiated instance of an FMU in the FMI 3.0 Standard.vr::AbstractArray{fmi3ValueReference}
: Argumentvr
is an AbstractArray ofnvr
value handels called "ValueReference" that define the variable that shall be inquired.nvr::Csize_t
: Argumentnvr
defines the size ofvr
.values::AbstractArray{fmi3UInt8}
: Argumentvalues
is an AbstractArray with the actual values of these variables.nvalue::Csize_t
: Argumentnvalue
defines the size ofvalues
.
Returns
status::fmi3Status
: Returnstatus
is an enumeration of typefmi3Status
and indicates the success of the function call.
More detailed: - fmi3OK
: all well - fmi3Warning
: things are not quite right, but the computation can continue - fmi3Discard
: if the slave computed successfully only a subinterval of the communication step - fmi3Error
: the communication step could not be carried out at all - fmi3Fatal
: if an error occurred which corrupted the FMU irreparably
Source
- FMISpec3.0 Link: https://fmi-standard.org/
- FMISpec3.0: 2.2.3 Platform Dependent Definitions
- FMISpec3.0: 2.2.4 Status Returned by Functions
- FMISpec3.0: 2.2.6.2. Getting and Setting Variable Values
See also fmi3GetUInt8!
.
FMICore.fmi3GetUInt8!
— Methodfmi3GetUInt8!(c::FMU3Instance, vr::fmi3ValueReferenceFormat, values::AbstractArray{fmi3UInt8})
Writes the integer values of an array of variables in the given field
fmi3GetUInt8! is only possible for arrays of values, please use an array instead of a scalar.
Arguments
c::FMU3Instance
: Mutable struct represents an instantiated instance of an FMU in the FMI 3.0 Standard.vr::fmi3ValueReferenceFormat
: Wildcards for how a user can pass a fmi[X]ValueReference
More detailed: fmi3ValueReferenceFormat = Union{Nothing, String, Array{String,1}, fmi3ValueReference, Array{fmi3ValueReference,1}, Int64, Array{Int64,1}, Symbol}
values::AbstractArray{fmi3UInt8}
: Argumentvalues
is an AbstractArray with the actual values of these variables.
Returns
status::fmi3Status
: Returnstatus
is an enumeration of typefmi3Status
and indicates the success of the function call.
More detailed:
fmi3OK
: all wellfmi3Warning
: things are not quite right, but the computation can continuefmi3Discard
: if the slave computed successfully only a subinterval of the communication stepfmi3Error
: the communication step could not be carried out at allfmi3Fatal
: if an error occurred which corrupted the FMU irreparably
Source
- FMISpec3.0 Link: https://fmi-standard.org/
- FMISpec3.0: 2.2.4 Status Returned by Functions
- FMISpec3.0: 2.2.6.2. Getting and Setting Variable Values
See also fmi3GetUInt8!
.
FMICore.fmi3GetVariableDependencies!
— Methodfmi3GetVariableDependencies!(c::FMU3Instance, vr::fmi3ValueReference, elementIndiceOfDependents::AbstractArray{Csize_t}, independents::AbstractArray{fmi3ValueReference},
elementIndiceOfInpendents::AbstractArray{Csize_t}, dependencyKind::AbstractArray{fmi3DependencyKind}, ndependencies::Csize_t)
The actual dependencies (of type dependenciesKind) can be retrieved by calling the function fmi3GetVariableDependencies:
Arguments
c::FMU3Instance
: Argumentc
is a Mutable struct represents an instantiated instance of an FMU in the FMI 3.0 Standard.vr::fmi3ValueReference
: Argumentvr
is the value handel called "ValueReference" that define the variable that shall be inquired.nvr::Csize_t
: Argumentnvr
defines the size ofvr
.elementIndiceOfDependents::AbstractArray{Csize_t}
: must point to a buffer of size_t values of sizenDependencies
allocated by the calling environment. It is filled in by this function with the element index of the dependent variable that dependency information is provided for. The element indices start with 1. Using the element index 0 means all elements of the variable. (Note: If an array has more than one dimension the indices are serialized in the same order as defined for values in Section 2.2.6.1.)independents::AbstractArray{fmi3ValueReference}
: must point to a buffer offmi3ValueReference
values of sizenDependencies
allocated by the calling environment. It is filled in by this function with the value reference of the independent variable that this dependency entry is dependent upon.elementIndiceOfInpendents::AbstractArray{Csize_t}
: must point to a buffer of size_tvalues
of sizenDependencies
allocated by the calling environment. It is filled in by this function with the element index of the independent variable that this dependency entry is dependent upon. The element indices start with 1. Using the element index 0 means all elements of the variable. (Note: If an array has more than one dimension the indices are serialized in the same order as defined for values in Section 2.2.6.1.)dependencyKind::AbstractArray{fmi3DependencyKind}
: must point to a buffer of dependenciesKind values of sizenDependencies
allocated by the calling environment. It is filled in by this function with the enumeration value describing the dependency of this dependency entry.ndependencies::Csize_t
: specifies the number of dependencies that the calling environment allocated space for in the result buffers, and should correspond to value obtained by callingfmi3GetNumberOfVariableDependencies
.
Returns
status::fmi3Status
: Returnstatus
is an enumeration of typefmi3Status
and indicates the success of the function call.
More detailed:
fmi3OK
: all wellfmi3Warning
: things are not quite right, but the computation can continuefmi3Discard
: if the slave computed successfully only a subinterval of the communication stepfmi3Error
: the communication step could not be carried out at allfmi3Fatal
: if an error occurred which corrupted the FMU irreparably
Source
- FMISpec3.0 Link: https://fmi-standard.org/
- FMISpec3.0: 2.2.3 Platform Dependent Definitions
- FMISpec3.0: 2.2.4 Status Returned by Functions
- FMISpec3.0: 2.2.10. Dependencies of Variables
See also fmi3GetVariableDependencies!
.
FMICore.fmi3GetVersion
— Methodfunction fmi3GetVersion(fmu::FMU3)
Arguments
c::FMU3Instance
: Mutable struct represents an instantiated instance of an FMU in the FMI 3.0 Standard.
Returns
- Returns a string from the address of a C-style (NUL-terminated) string. The string represents the version of the “fmi3Functions.h” header file which was used to compile the functions of the FMU. The function returns “fmiVersion” which is defined in this header file. The standard header file as documented in this specification has version “3.0”
Source
- FMISpec3.0 Link: https://fmi-standard.org/
- FMISpec3.0: 2.2.4. Inquire Version Number of Header Files
FMICore.fmi3GetVersion
— Methodfmi3GetVersion(fmu::FMU3)
Arguments
fmu::FMU3
: Mutable struct representing a FMU and all it instantiated instances in the FMI 3.0 Standard.
Returns
- Returns a string from the address of a C-style (NUL-terminated) string. The string represents the version of the “fmi3Functions.h” header file which was used to compile the functions of the FMU. The function returns “fmiVersion” which is defined in this header file. The standard header file as documented in this specification has version “3.0”
Source
- FMISpec3.0 Link: https://fmi-standard.org/
- FMISpec3.0: 2.2.4. Inquire Version Number of Header Files
FMICore.fmi3Reset
— Methodfmi3Reset(c::FMU3Instance; soft::Bool = false)
Is called by the environment to reset the FMU after a simulation run. The FMU goes into the same state as if fmi3InstantiateXXX
would have been called.
Arguments
c::FMU3Instance
: Argumentc
is a Mutable struct represents an instantiated instance of an FMU in the FMI 3.0 Standard.
Keywords
soft::Bool=false
: If the Keywordsoft = true
thefmi3Teminate
needs to be called in statefmi3InstanceStateContinuousTimeMode
orfmi3InstanceStateEventMode
.
Returns
status::fmi3Status
: Returnstatus
is an enumeration of typefmi3Status
and indicates the success of the function call.
More detailed: - fmi3OK
: all well - fmi3Warning
: things are not quite right, but the computation can continue - fmi3Discard
: if the slave computed successfully only a subinterval of the communication step - fmi3Error
: the communication step could not be carried out at all - fmi3Fatal
: if an error occurred which corrupted the FMU irreparably
Source
- FMISpec3.0 Link: https://fmi-standard.org/
- FMISpec3.0: 2.2.3 Platform Dependent Definitions
- FMISpec3.0: 2.2.4 Status Returned by Functions
- FMISpec3.0: 2.3.1. Super State: FMU State Setable
See also fmi3Reset
.
FMICore.fmi3SerializeFMUState!
— Methodfmi3SerializeFMUState!(c::FMU3Instance, FMUstate::fmi3FMUState, serialzedState::AbstractArray{fmi3Byte}, size::Csize_t)
Serializes the data which is referenced by pointer FMUState
and copies this data in to the byte vector serializedState
of length size
, that must be provided by the environment.
Arguments
c::FMU3Instance
: Argumentc
is a Mutable struct represents an instantiated instance of an FMU in the FMI 3.0 Standard.FMUstate::fmi3FMUstate
: ArgumentFMUstate
is a pointer to a data structure in the FMU that saves the internal FMU state of the actual or a previous time instant.serialzedState::AbstractArray{fmi3Byte}
: ArgumentserializedState
contains the copy of the serialized data referenced by the pointer FMUstate.size::Ref{Csize_t}
: Argumentsize
is an object that safely references a value of typeCsize_t
and defines the size of the byte vector in which the FMUstate can be stored.
Returns
status::fmi3Status
: Returnstatus
is an enumeration of typefmi3Status
and indicates the success of the function call.
More detailed:
fmi3OK
: all wellfmi3Warning
: things are not quite right, but the computation can continuefmi3Discard
: if the slave computed successfully only a subinterval of the communication stepfmi3Error
: the communication step could not be carried out at allfmi3Fatal
: if an error occurred which corrupted the FMU irreparably
Source
- FMISpec3.0 Link: https://fmi-standard.org/
- FMISpec3.0: 2.2.3 Platform Dependent Definitions
- FMISpec3.0: 2.2.4 Status Returned by Functions
- FMISpec3.0: 2.2.6.4. Getting and Setting the Complete FMU State
See also fmi3SerializeFMUState!
.
FMICore.fmi3SerializedFMUStateSize!
— Methodfmi3SerializedFMUStateSize!(c::FMU3Instance, FMUstate::fmi3FMUState, size::Ref{Csize_t})
Frees all memory and other resources allocated with the fmi3GetFMUstate
call for this FMUstate.
Arguments
c::FMU3Instance
: Argumentc
is a Mutable struct represents an instantiated instance of an FMU in the FMI 3.0 Standard.FMUstate::fmi3FMUstate
: ArgumentFMUstate
is a pointer to a data structure in the FMU that saves the internal FMU state of the actual or a previous time instant.size::Ref{Csize_t}
: Argumentsize
is an object that safely references a value of typeCsize_t
and defines the size of the byte vector in which the FMUstate can be stored.
Returns
status::fmi3Status
: Returnstatus
is an enumeration of typefmi3Status
and indicates the success of the function call.
More detailed:
fmi3OK
: all wellfmi3Warning
: things are not quite right, but the computation can continuefmi3Discard
: if the slave computed successfully only a subinterval of the communication stepfmi3Error
: the communication step could not be carried out at allfmi3Fatal
: if an error occurred which corrupted the FMU irreparably
Source
- FMISpec3.0 Link: https://fmi-standard.org/
- FMISpec3.0: 2.2.3 Platform Dependent Definitions
- FMISpec3.0: 2.2.4 Status Returned by Functions
- FMISpec3.0: 2.2.6.4. Getting and Setting the Complete FMU State
See also fmi3SerializedFMUStateSize!
.
FMICore.fmi3SetBinary
— Methodfmi3SetBinary(c::FMU3Instance, vr::AbstractArray{fmi3ValueReference}, nvr::Csize_t, valueSizes::AbstractArray{Csize_t}, value::AbstractArray{fmi3Binary}, nvalue::Csize_t)
Functions to get and set values of variables idetified by their valueReference.
Arguments
c::FMU3Instance
: Argumentc
is a Mutable struct represents an instantiated instance of an FMU in the FMI 3.0 Standard.vr::AbstractArray{fmi3ValueReference}
: Argumentvr
is an AbstractArray ofnvr
value handels called "ValueReference" that define the variable that shall be inquired.nvr::Csize_t
: Argumentnvr
defines the size ofvr
.valueSizes::AbstractArray{Csize_t}
: ArgumentvalueSizes
defines the size of a binary element of each variable.value::AbstractArray{fmi3Binary}
: Argumentvalues
is an AbstractArray with the actual values of these variables.nvalue::Csize_t
: Argumentnvalue
defines the size ofvalues
.
Returns
status::fmi3Status
: Returnstatus
is an enumeration of typefmi3Status
and indicates the success of the function call.
More detailed:
fmi3OK
: all wellfmi3Warning
: things are not quite right, but the computation can continuefmi3Discard
: if the slave computed successfully only a subinterval of the communication stepfmi3Error
: the communication step could not be carried out at allfmi3Fatal
: if an error occurred which corrupted the FMU irreparably
Source
- FMISpec3.0 Link: https://fmi-standard.org/
- FMISpec3.0: 2.2.3 Platform Dependent Definitions
- FMISpec3.0: 2.2.4 Status Returned by Functions
- FMISpec3.0: 2.2.6.2. Getting and Setting Variable Values
See also fmi3SetBinary
.
FMICore.fmi3SetBinary
— Methodfmi3SetBinary(c::FMU3Instance, vr::fmi3ValueReferenceFormat, valueSizes::Union{AbstractArray{Csize_t}, Csize_t}, values::Union{AbstractArray{fmi3Binary}, fmi3Binary})
Set the values of an array of binary variables
Arguments
c::FMU3Instance
: Mutable struct represents an instantiated instance of an FMU in the FMI 3.0 Standard.vr::fmi3ValueReferenceFormat
: Wildcards for how a user can pass a fmi[X]ValueReference
More detailed: fmi3ValueReferenceFormat = Union{Nothing, String, Array{String,1}, fmi3ValueReference, Array{fmi3ValueReference,1}, Int64, Array{Int64,1}, Symbol}
valueSizes::Union{AbstractArray{Csize_t}, Csize_t}
: ArgumentvalueSizes
defines the size of a binary element of each variable.values::Union{AbstractArray{fmi3Binary}, fmi3Binary}
: Argumentvalues
is an AbstractArray with the actual values of these variables.
Returns
status::fmi3Status
: Returnstatus
is an enumeration of typefmi3Status
and indicates the success of the function call.
More detailed:
fmi3OK
: all wellfmi3Warning
: things are not quite right, but the computation can continuefmi3Discard
: if the slave computed successfully only a subinterval of the communication stepfmi3Error
: the communication step could not be carried out at allfmi3Fatal
: if an error occurred which corrupted the FMU irreparably
Source
- FMISpec3.0 Link: https://fmi-standard.org/
- FMISpec3.0: 2.2.4 Status Returned by Functions
- FMISpec3.0: 2.2.6.2. Getting and Setting Variable Values
See also fmi3SetBinary
.
FMICore.fmi3SetBoolean
— Methodfmi3SetBoolean(c::FMU3Instance, vr::AbstractArray{fmi3ValueReference}, nvr::Csize_t, value::AbstractArray{fmi3Boolean}, nvalue::Csize_t)
Functions to get and set values of variables idetified by their valueReference.
Arguments
c::FMU3Instance
: Argumentc
is a Mutable struct represents an instantiated instance of an FMU in the FMI 3.0 Standard.vr::AbstractArray{fmi3ValueReference}
: Argumentvr
is an AbstractArray ofnvr
value handels called "ValueReference" that define the variable that shall be inquired.nvr::Csize_t
: Argumentnvr
defines the size ofvr
.values::AbstractArray{fmi3Boolean}
: Argumentvalues
is an AbstractArray with the actual values of these variables.nvalue::Csize_t
: Argumentnvalue
defines the size ofvalues
.
Returns
status::fmi3Status
: Returnstatus
is an enumeration of typefmi3Status
and indicates the success of the function call.
More detailed:
fmi3OK
: all wellfmi3Warning
: things are not quite right, but the computation can continuefmi3Discard
: if the slave computed successfully only a subinterval of the communication stepfmi3Error
: the communication step could not be carried out at allfmi3Fatal
: if an error occurred which corrupted the FMU irreparably
Source
- FMISpec3.0 Link: https://fmi-standard.org/
- FMISpec3.0: 2.2.3 Platform Dependent Definitions
- FMISpec3.0: 2.2.4 Status Returned by Functions
- FMISpec3.0: 2.2.6.2. Getting and Setting Variable Values
See also fmi3SetBoolean
.
FMICore.fmi3SetBoolean
— Methodfmi3SetBoolean(c::FMU3Instance, vr::fmi3ValueReferenceFormat, values::Union{AbstractArray{Bool}, Bool})
Set the values of an array of boolean variables
Arguments
c::FMU3Instance
: Mutable struct represents an instantiated instance of an FMU in the FMI 3.0 Standard.vr::fmi3ValueReferenceFormat
: Wildcards for how a user can pass a fmi[X]ValueReference
More detailed: fmi3ValueReferenceFormat = Union{Nothing, String, Array{String,1}, fmi3ValueReference, Array{fmi3ValueReference,1}, Int64, Array{Int64,1}, Symbol}
values::Union{AbstractArray{Bool}, Bool}
: Argumentvalues
is an AbstractArray with the actual values of these variables.
Returns
status::fmi3Status
: Returnstatus
is an enumeration of typefmi3Status
and indicates the success of the function call.
More detailed:
fmi3OK
: all wellfmi3Warning
: things are not quite right, but the computation can continuefmi3Discard
: if the slave computed successfully only a subinterval of the communication stepfmi3Error
: the communication step could not be carried out at allfmi3Fatal
: if an error occurred which corrupted the FMU irreparably
Source
- FMISpec3.0 Link: https://fmi-standard.org/
- FMISpec3.0: 2.2.4 Status Returned by Functions
- FMISpec3.0: 2.2.6.2. Getting and Setting Variable Values
See also fmi3SetBoolean
.
FMICore.fmi3SetClock
— Methodfmi3SetClock(c::FMU3Instance, vr::AbstractArray{fmi3ValueReference}, nvr::Csize_t, value::AbstractArray{fmi3Clock}, nvalue::Csize_t)
Functions to get and set values of variables idetified by their valueReference.
Arguments
c::FMU3Instance
: Argumentc
is a Mutable struct represents an instantiated instance of an FMU in the FMI 3.0 Standard.vr::AbstractArray{fmi3ValueReference}
: Argumentvr
is an AbstractArray ofnvr
value handels called "ValueReference" that define the variable that shall be inquired.nvr::Csize_t
: Argumentnvr
defines the size ofvr
.value::AbstractArray{fmi3Clock}
: Argumentvalues
is an AbstractArray with the actual values of these variables.nvalue::Csize_t
: Argumentnvalue
defines the size ofvalues
.
Returns
status::fmi3Status
: Returnstatus
is an enumeration of typefmi3Status
and indicates the success of the function call.
More detailed:
fmi3OK
: all wellfmi3Warning
: things are not quite right, but the computation can continuefmi3Discard
: if the slave computed successfully only a subinterval of the communication stepfmi3Error
: the communication step could not be carried out at allfmi3Fatal
: if an error occurred which corrupted the FMU irreparably
Source
- FMISpec3.0 Link: https://fmi-standard.org/
- FMISpec3.0: 2.2.3 Platform Dependent Definitions
- FMISpec3.0: 2.2.4 Status Returned by Functions
- FMISpec3.0: 2.2.6.2. Getting and Setting Variable Values
See also fmi3SetClock
.
FMICore.fmi3SetClock
— Methodfmi3SetClock(c::FMU3Instance, vr::fmi3ValueReferenceFormat, valueSizes::Union{AbstractArray{Csize_t}, Csize_t}, values::Union{AbstractArray{fmi3Clock}, fmi3Clock})
Set the values of an array of clock variables
Arguments
c::FMU3Instance
: Mutable struct represents an instantiated instance of an FMU in the FMI 3.0 Standard.vr::fmi3ValueReferenceFormat
: Wildcards for how a user can pass a fmi[X]ValueReference
More detailed: fmi3ValueReferenceFormat = Union{Nothing, String, Array{String,1}, fmi3ValueReference, Array{fmi3ValueReference,1}, Int64, Array{Int64,1}, Symbol}
values::Union{AbstractArray{fmi3Clock}, fmi3Clock}
: Argumentvalues
is an AbstractArray with the actual values of these variables.
Returns
status::fmi3Status
: Returnstatus
is an enumeration of typefmi3Status
and indicates the success of the function call.
More detailed:
fmi3OK
: all wellfmi3Warning
: things are not quite right, but the computation can continuefmi3Discard
: if the slave computed successfully only a subinterval of the communication stepfmi3Error
: the communication step could not be carried out at allfmi3Fatal
: if an error occurred which corrupted the FMU irreparably
Source
- FMISpec3.0 Link: https://fmi-standard.org/
- FMISpec3.0: 2.2.4 Status Returned by Functions
- FMISpec3.0: 2.2.6.2. Getting and Setting Variable Values
See also fmi3SetClock
.
FMICore.fmi3SetContinuousStates
— Methodfmi3SetContinuousStates(c::FMU3Instance,
x::AbstractArray{fmi3Float64},
nx::Csize_t)
Set a new (continuous) state vector and re-initialize caching of variables that depend on the states. Argument nx is the length of vector x and is provided for checking purposes
If fmi3UpdateDiscreteStates
returned with nominalsOfContinuousStatesChanged == fmi3True
, then at least one nominal value of the states has changed and can be inquired with fmi3GetNominalsOfContinuousStates
. Not allowed in Co-Simulation and Scheduled Execution.
Arguments
c::FMU3Instance
: Mutable struct represents an instantiated instance of an FMU in the FMI 2.0.2 Standard.x::AbstractArray{fmi3Float64}
: Argumentx
contains values of typefmi3Float64
which is a alias type forReal
data type.x
is theAbstractArray
which contains theReal
values of the vector that represent the nominal values of the continuous states.nx::Csize_t
: Argumentnx
defines the length of vectorx
and is provided for checking purposes
Returns
status::fmi3Status
: Returnstatus
is an enumeration of typefmi3Status
and indicates the success of the function call.
More detailed:
fmi3OK
: all wellfmi3Warning
: things are not quite right, but the computation can continuefmi3Discard
: if the slave computed successfully only a subinterval of the communication stepfmi3Error
: the communication step could not be carried out at allfmi3Fatal
: if an error occurred which corrupted the FMU irreparably
Source
- FMISpec3.0 Link: https://fmi-standard.org/
- FMISpec3.0: 2.2.3 Platform Dependent Definitions
- FMISpec3.0: 2.2.4 Status Returned by Functions
- FMISpec3.0: 3.2.1. State: Continuous-Time Mode
See also fmi3SetContinuousStates
.
FMICore.fmi3SetContinuousStates
— Methodfmi3SetContinuousStates(c::FMU3Instance, x::Union{AbstractArray{Float32}, AbstractArray{Float64}})
Set a new (continuous) state vector and re-initialize caching of variables that depend on the states. Argument nx is the length of vector x and is provided for checking purposes
Arguments
c::FMU3Instance
: Mutable struct represents an instantiated instance of an FMU in the FMI 2.0.2 Standard.x::Union{AbstractArray{Float32},AbstractArray{Float64}}
:Argumentx
is theAbstractArray
of the vector values ofFloat64
orFloat32
.
Returns
status::fmi3Status
: Returnstatus
is an enumeration of typefmi3Status
and indicates the success of the function call.
More detailed:
fmi3OK
: all wellfmi3Warning
: things are not quite right, but the computation can continuefmi3Discard
: if the slave computed successfully only a subinterval of the communication stepfmi3Error
: the communication step could not be carried out at allfmi3Fatal
: if an error occurred which corrupted the FMU irreparably
Source
- FMISpec3.0 Link: https://fmi-standard.org/
- FMISpec3.0: 2.2.3 Platform Dependent Definitions
- FMISpec3.0: 2.2.4 Status Returned by Functions
- FMISpec3.0: 3.2.1. State: Continuous-Time Mode
See also fmi3SetContinuousStates
.
FMICore.fmi3SetDebugLogging
— Methodfmi3SetDebugLogging(c::FMU3Instance, logginOn::fmi3Boolean, nCategories::UInt, categories::Ptr{Nothing})
Control the use of the logging callback function, version independent.
Arguments
c::FMU3Instance
: Argumentc
is a Mutable struct represents an instantiated instance of an FMU in the FMI 3.0 Standard.logginOn::fmi3Boolean
: IfloggingOn = fmi3True
, debug logging is enabled for the log categories specified in categories, otherwise it is disabled. Typefmi3Boolean
is defined as an alias Type for the C-Type Boolean and is to be used withfmi3True
andfmi3False
.nCategories::UInt
: ArgumentnCategories
defines the length of the argumentcategories
.categories::Ptr{Nothing}
:
Returns
status::fmi3Status
: Returnstatus
is an enumeration of typefmi3Status
and indicates the success of the function call.
More detailed:
fmi3OK
: all wellfmi3Warning
: things are not quite right, but the computation can continuefmi3Discard
: if the slave computed successfully only a subinterval of the communication stepfmi3Error
: the communication step could not be carried out at allfmi3Fatal
: if an error occurred which corrupted the FMU irreparably
Source
- FMISpec3.0 Link: https://fmi-standard.org/
- FMISpec3.0: 2.2.3 Platform Dependent Definitions
- FMISpec3.0: 2.2.4 Status Returned by Functions
- FMISpec3.0: 2.3.1. Super State: FMU State Setable
See also fmi3SetDebugLogging
.
FMICore.fmi3SetDebugLogging
— Methodfmi3SetDebugLogging(c::FMU3Instance)
Set the DebugLogger for the FMU.
Arguments
c::FMU3Instance
: Mutable struct represents an instantiated instance of an FMU in the FMI 3.0 Standard.
Returns
- Returns a warning if
str.state
is not called infmi3InstanceStateInstantiated
. status::fmi3Status
: Returnstatus
is an enumeration of typefmi3Status
and indicates the success of the function call.
More detailed:
fmi3OK
: all wellfmi3Warning
: things are not quite right, but the computation can continuefmi3Discard
: if the slave computed successfully only a subinterval of the communication stepfmi3Error
: the communication step could not be carried out at allfmi3Fatal
: if an error occurred which corrupted the FMU irreparably
Source
- FMISpec3.0 Link: https://fmi-standard.org/
- FMISpec3.0: 2.2.4 Status Returned by Functions
- FMISpec3.0: 2.3.1. Super State: FMU State Setable
See also fmi3SetDebugLogging
.
FMICore.fmi3SetFMUState
— Methodfmi3SetFMUState(c::FMU3Instance, FMUstate::fmi3FMUState)
Copies the content of the previously copied FMUstate back and uses it as actual new FMU state.
Arguments
c::FMU3Instance
: Argumentc
is a Mutable struct represents an instantiated instance of an FMU in the FMI 3.0 Standard.FMUstate::fmi3FMUstate
: ArgumentFMUstate
is a pointer to a data structure in the FMU that saves the internal FMU state of the actual or a previous time instant.
Returns
status::fmi3Status
: Returnstatus
is an enumeration of typefmi3Status
and indicates the success of the function call.
More detailed:
fmi3OK
: all wellfmi3Warning
: things are not quite right, but the computation can continuefmi3Discard
: if the slave computed successfully only a subinterval of the communication stepfmi3Error
: the communication step could not be carried out at allfmi3Fatal
: if an error occurred which corrupted the FMU irreparably
Source
- FMISpec3.0 Link: https://fmi-standard.org/
- FMISpec3.0: 2.2.3 Platform Dependent Definitions
- FMISpec3.0: 2.2.4 Status Returned by Functions
- FMISpec3.0: 2.2.6.4. Getting and Setting the Complete FMU State
See also fmi3SetFMUState
.
FMICore.fmi3SetFloat32
— Methodfmi3SetFloat32(c::FMU3Instance, vr::AbstractArray{fmi3ValueReference}, nvr::Csize_t, value::AbstractArray{fmi3Float32}, nvalue::Csize_t)
Functions to get and set values of variables idetified by their valueReference.
Arguments
c::FMU3Instance
: Argumentc
is a Mutable struct represents an instantiated instance of an FMU in the FMI 3.0 Standard.vr::AbstractArray{fmi3ValueReference}
: Argumentvr
is an AbstractArray ofnvr
value handels called "ValueReference" that define the variable that shall be inquired.nvr::Csize_t
: Argumentnvr
defines the size ofvr
.values::AbstractArray{fmi3Float32}
: Argumentvalues
is an AbstractArray with the actual values of these variables.nvalue::Csize_t
: Argumentnvalue
defines the size ofvalues
.
Returns
status::fmi3Status
: Returnstatus
is an enumeration of typefmi3Status
and indicates the success of the function call.
More detailed:
fmi3OK
: all wellfmi3Warning
: things are not quite right, but the computation can continuefmi3Discard
: if the slave computed successfully only a subinterval of the communication stepfmi3Error
: the communication step could not be carried out at allfmi3Fatal
: if an error occurred which corrupted the FMU irreparably
Source
- FMISpec3.0 Link: https://fmi-standard.org/
- FMISpec3.0: 2.2.3 Platform Dependent Definitions
- FMISpec3.0: 2.2.4 Status Returned by Functions
- FMISpec3.0: 2.2.6.2. Getting and Setting Variable Values
See also fmi3SetFloat32
.
FMICore.fmi3SetFloat32
— Methodfmi3SetFloat32(c::FMU3Instance, vr::fmi3ValueReferenceFormat, values::Union{AbstractArray{fmi3Float32}, fmi3Float32})
Set the values of an array of real variables
Arguments
c::FMU3Instance
: Mutable struct represents an instantiated instance of an FMU in the FMI 3.0 Standard.vr::fmi3ValueReferenceFormat
: Wildcards for how a user can pass a fmi[X]ValueReference
More detailed: fmi3ValueReferenceFormat = Union{Nothing, String, Array{String,1}, fmi3ValueReference, Array{fmi3ValueReference,1}, Int64, Array{Int64,1}, Symbol}
values::Union{AbstractArray{fmi3Float32}, fmi3Float32}
: Argumentvalues
is an AbstractArray with the actual values of these variables.
Returns
status::fmi3Status
: Returnstatus
is an enumeration of typefmi3Status
and indicates the success of the function call.
More detailed:
fmi3OK
: all wellfmi3Warning
: things are not quite right, but the computation can continuefmi3Discard
: if the slave computed successfully only a subinterval of the communication stepfmi3Error
: the communication step could not be carried out at allfmi3Fatal
: if an error occurred which corrupted the FMU irreparably
Source
- FMISpec3.0 Link: https://fmi-standard.org/
- FMISpec3.0: 2.2.4 Status Returned by Functions
- FMISpec3.0: 2.2.6.2. Getting and Setting Variable Values
See also fmi3SetFloat32
.
FMICore.fmi3SetFloat64
— Methodfmi3SetFloat64(c::FMU3Instance, vr::AbstractArray{fmi3ValueReference}, nvr::Csize_t, value::AbstractArray{fmi3Float64}, nvalue::Csize_t)
Functions to get and set values of variables idetified by their valueReference.
Arguments
c::FMU3Instance
: Argumentc
is a Mutable struct represents an instantiated instance of an FMU in the FMI 3.0 Standard.vr::AbstractArray{fmi3ValueReference}
: Argumentvr
is an AbstractArray ofnvr
value handels called "ValueReference" that define the variable that shall be inquired.nvr::Csize_t
: Argumentnvr
defines the size ofvr
.values::AbstractArray{fmi3Float64}
: Argumentvalues
is an AbstractArray with the actual values of these variables.nvalue::Csize_t
: Argumentnvalue
defines the size ofvalues
.
Returns
status::fmi3Status
: Returnstatus
is an enumeration of typefmi3Status
and indicates the success of the function call.
More detailed:
fmi3OK
: all wellfmi3Warning
: things are not quite right, but the computation can continuefmi3Discard
: if the slave computed successfully only a subinterval of the communication stepfmi3Error
: the communication step could not be carried out at allfmi3Fatal
: if an error occurred which corrupted the FMU irreparably
Source
- FMISpec3.0 Link: https://fmi-standard.org/
- FMISpec3.0: 2.2.3 Platform Dependent Definitions
- FMISpec3.0: 2.2.4 Status Returned by Functions
- FMISpec3.0: 2.2.6.2. Getting and Setting Variable Values
See also fmi3SetFloat64
.
FMICore.fmi3SetFloat64
— Methodfmi3SetFloat64(c::FMU3Instance, vr::fmi3ValueReferenceFormat, values::Union{AbstractArray{fmi3Float64}, fmi3Float64})
Set the values of an array of real variables
Arguments
c::FMU3Instance
: Mutable struct represents an instantiated instance of an FMU in the FMI 3.0 Standard.vr::fmi3ValueReferenceFormat
: Wildcards for how a user can pass a fmi[X]ValueReference
More detailed: fmi3ValueReferenceFormat = Union{Nothing, String, Array{String,1}, fmi3ValueReference, Array{fmi3ValueReference,1}, Int64, Array{Int64,1}, Symbol}
values::Union{AbstractArray{fmi3Float64}, fmi3Float64}
: Argumentvalues
is an AbstractArray with the actual values of these variables.
Returns
status::fmi3Status
: Returnstatus
is an enumeration of typefmi3Status
and indicates the success of the function call.
More detailed:
fmi3OK
: all wellfmi3Warning
: things are not quite right, but the computation can continuefmi3Discard
: if the slave computed successfully only a subinterval of the communication stepfmi3Error
: the communication step could not be carried out at allfmi3Fatal
: if an error occurred which corrupted the FMU irreparably
Source
- FMISpec3.0 Link: https://fmi-standard.org/
- FMISpec3.0: 2.2.4 Status Returned by Functions
- FMISpec3.0: 2.2.6.2. Getting and Setting Variable Values
See also fmi3SetFloat64
.
FMICore.fmi3SetInt16
— Methodfmi3SetInt16(c::FMU3Instance, vr::AbstractArray{fmi3ValueReference}, nvr::Csize_t, value::AbstractArray{fmi3Int16}, nvalue::Csize_t)
Functions to get and set values of variables idetified by their valueReference.
Arguments
c::FMU3Instance
: Argumentc
is a Mutable struct represents an instantiated instance of an FMU in the FMI 3.0 Standard.vr::AbstractArray{fmi3ValueReference}
: Argumentvr
is an AbstractArray ofnvr
value handels called "ValueReference" that define the variable that shall be inquired.nvr::Csize_t
: Argumentnvr
defines the size ofvr
.values::AbstractArray{fmi3Int16}
: Argumentvalues
is an AbstractArray with the actual values of these variables.nvalue::Csize_t
: Argumentnvalue
defines the size ofvalues
.
Returns
status::fmi3Status
: Returnstatus
is an enumeration of typefmi3Status
and indicates the success of the function call.
More detailed: - fmi3OK
: all well - fmi3Warning
: things are not quite right, but the computation can continue - fmi3Discard
: if the slave computed successfully only a subinterval of the communication step - fmi3Error
: the communication step could not be carried out at all - fmi3Fatal
: if an error occurred which corrupted the FMU irreparably
Source
- FMISpec3.0 Link: https://fmi-standard.org/
- FMISpec3.0: 2.2.3 Platform Dependent Definitions
- FMISpec3.0: 2.2.4 Status Returned by Functions
- FMISpec3.0: 2.2.6.2. Getting and Setting Variable Values
See also fmi3SetInt16
.
FMICore.fmi3SetInt16
— Methodfmi3SetInt16(c::FMU3Instance, vr::fmi3ValueReferenceFormat, values::Union{AbstractArray{fmi3Int16}, fmi3Int16})
Set the values of an array of integer variables
Arguments
c::FMU3Instance
: Mutable struct represents an instantiated instance of an FMU in the FMI 3.0 Standard.vr::fmi3ValueReferenceFormat
: Wildcards for how a user can pass a fmi[X]ValueReference
More detailed: fmi3ValueReferenceFormat = Union{Nothing, String, Array{String,1}, fmi3ValueReference, Array{fmi3ValueReference,1}, Int64, Array{Int64,1}, Symbol}
values::Union{AbstractArray{fmi3Int16}, fmi3Int16}
: Argumentvalues
is an AbstractArray with the actual values of these variables.
Returns
status::fmi3Status
: Returnstatus
is an enumeration of typefmi3Status
and indicates the success of the function call.
More detailed:
fmi3OK
: all wellfmi3Warning
: things are not quite right, but the computation can continuefmi3Discard
: if the slave computed successfully only a subinterval of the communication stepfmi3Error
: the communication step could not be carried out at allfmi3Fatal
: if an error occurred which corrupted the FMU irreparably
Source
- FMISpec3.0 Link: https://fmi-standard.org/
- FMISpec3.0: 2.2.4 Status Returned by Functions
- FMISpec3.0: 2.2.6.2. Getting and Setting Variable Values
See also fmi3SetInt16
.
FMICore.fmi3SetInt32
— Methodfmi3SetInt32(c::FMU3Instance, vr::AbstractArray{fmi3ValueReference}, nvr::Csize_t, value::AbstractArray{fmi3Int32}, nvalue::Csize_t)
Functions to get and set values of variables idetified by their valueReference.
Arguments
c::FMU3Instance
: Argumentc
is a Mutable struct represents an instantiated instance of an FMU in the FMI 3.0 Standard.vr::AbstractArray{fmi3ValueReference}
: Argumentvr
is an AbstractArray ofnvr
value handels called "ValueReference" that define the variable that shall be inquired.nvr::Csize_t
: Argumentnvr
defines the size ofvr
.values::AbstractArray{fmi3Int32}
: Argumentvalues
is an AbstractArray with the actual values of these variables.nvalue::Csize_t
: Argumentnvalue
defines the size ofvalues
.
Returns
status::fmi3Status
: Returnstatus
is an enumeration of typefmi3Status
and indicates the success of the function call.
More detailed: - fmi3OK
: all well - fmi3Warning
: things are not quite right, but the computation can continue - fmi3Discard
: if the slave computed successfully only a subinterval of the communication step - fmi3Error
: the communication step could not be carried out at all - fmi3Fatal
: if an error occurred which corrupted the FMU irreparably
Source
- FMISpec3.0 Link: https://fmi-standard.org/
- FMISpec3.0: 2.2.3 Platform Dependent Definitions
- FMISpec3.0: 2.2.4 Status Returned by Functions
- FMISpec3.0: 2.2.6.2. Getting and Setting Variable Values
See also fmi3SetInt32
.
FMICore.fmi3SetInt32
— Methodfmi3SetInt32(c::FMU3Instance, vr::fmi3ValueReferenceFormat, values::Union{AbstractArray{fmi3Int32}, fmi3Int32})
Set the values of an array of integer variables
Arguments
c::FMU3Instance
: Mutable struct represents an instantiated instance of an FMU in the FMI 3.0 Standard.vr::fmi3ValueReferenceFormat
: Wildcards for how a user can pass a fmi[X]ValueReference
More detailed: fmi3ValueReferenceFormat = Union{Nothing, String, Array{String,1}, fmi3ValueReference, Array{fmi3ValueReference,1}, Int64, Array{Int64,1}, Symbol}
values::Union{AbstractArray{fmi3Int32}, fmi3Int32}
: Argumentvalues
is an AbstractArray with the actual values of these variables.
Returns
status::fmi3Status
: Returnstatus
is an enumeration of typefmi3Status
and indicates the success of the function call.
More detailed:
fmi3OK
: all wellfmi3Warning
: things are not quite right, but the computation can continuefmi3Discard
: if the slave computed successfully only a subinterval of the communication stepfmi3Error
: the communication step could not be carried out at allfmi3Fatal
: if an error occurred which corrupted the FMU irreparably
Source
- FMISpec3.0 Link: https://fmi-standard.org/
- FMISpec3.0: 2.2.4 Status Returned by Functions
- FMISpec3.0: 2.2.6.2. Getting and Setting Variable Values
See also fmi3SetInt32
.
FMICore.fmi3SetInt64
— Methodfmi3SetInt64(c::FMU3Instance, vr::AbstractArray{fmi3ValueReference}, nvr::Csize_t, value::AbstractArray{fmi3Int64}, nvalue::Csize_t)
Functions to get and set values of variables idetified by their valueReference.
Arguments
c::FMU3Instance
: Argumentc
is a Mutable struct represents an instantiated instance of an FMU in the FMI 3.0 Standard.vr::AbstractArray{fmi3ValueReference}
: Argumentvr
is an AbstractArray ofnvr
value handels called "ValueReference" that define the variable that shall be inquired.nvr::Csize_t
: Argumentnvr
defines the size ofvr
.values::AbstractArray{fmi3Int64}
: Argumentvalues
is an AbstractArray with the actual values of these variables.nvalue::Csize_t
: Argumentnvalue
defines the size ofvalues
.
Returns
status::fmi3Status
: Returnstatus
is an enumeration of typefmi3Status
and indicates the success of the function call.
More detailed: - fmi3OK
: all well - fmi3Warning
: things are not quite right, but the computation can continue - fmi3Discard
: if the slave computed successfully only a subinterval of the communication step - fmi3Error
: the communication step could not be carried out at all - fmi3Fatal
: if an error occurred which corrupted the FMU irreparably
Source
- FMISpec3.0 Link: https://fmi-standard.org/
- FMISpec3.0: 2.2.3 Platform Dependent Definitions
- FMISpec3.0: 2.2.4 Status Returned by Functions
- FMISpec3.0: 2.2.6.2. Getting and Setting Variable Values
See also fmi3SetInt64
.
FMICore.fmi3SetInt64
— Methodfmi3SetInt64(c::FMU3Instance, vr::fmi3ValueReferenceFormat, values::Union{AbstractArray{fmi3Int64}, fmi3Int64})
Set the values of an array of integer variables
Arguments
c::FMU3Instance
: Mutable struct represents an instantiated instance of an FMU in the FMI 3.0 Standard.vr::fmi3ValueReferenceFormat
: Wildcards for how a user can pass a fmi[X]ValueReference
More detailed: fmi3ValueReferenceFormat = Union{Nothing, String, Array{String,1}, fmi3ValueReference, Array{fmi3ValueReference,1}, Int64, Array{Int64,1}, Symbol}
values::Union{AbstractArray{fmi3Int64}, fmi3Int64}
: Argumentvalues
is an AbstractArray with the actual values of these variables.
Returns
status::fmi3Status
: Returnstatus
is an enumeration of typefmi3Status
and indicates the success of the function call.
More detailed:
fmi3OK
: all wellfmi3Warning
: things are not quite right, but the computation can continuefmi3Discard
: if the slave computed successfully only a subinterval of the communication stepfmi3Error
: the communication step could not be carried out at allfmi3Fatal
: if an error occurred which corrupted the FMU irreparably
Source
- FMISpec3.0 Link: https://fmi-standard.org/
- FMISpec3.0: 2.2.4 Status Returned by Functions
- FMISpec3.0: 2.2.6.2. Getting and Setting Variable Values
See also fmi3SetInt64
.
FMICore.fmi3SetInt8
— Methodfmi3SetInt8(c::FMU3Instance, vr::AbstractArray{fmi3ValueReference}, nvr::Csize_t, value::AbstractArray{fmi3Int8}, nvalue::Csize_t)
Functions to get and set values of variables idetified by their valueReference.
Arguments
c::FMU3Instance
: Argumentc
is a Mutable struct represents an instantiated instance of an FMU in the FMI 3.0 Standard.vr::AbstractArray{fmi3ValueReference}
: Argumentvr
is an AbstractArray ofnvr
value handels called "ValueReference" that define the variable that shall be inquired.nvr::Csize_t
: Argumentnvr
defines the size ofvr
.values::AbstractArray{fmi3Int8}
: Argumentvalues
is an AbstractArray with the actual values of these variables.nvalue::Csize_t
: Argumentnvalue
defines the size ofvalues
.
Returns
status::fmi3Status
: Returnstatus
is an enumeration of typefmi3Status
and indicates the success of the function call.
More detailed: - fmi3OK
: all well - fmi3Warning
: things are not quite right, but the computation can continue - fmi3Discard
: if the slave computed successfully only a subinterval of the communication step - fmi3Error
: the communication step could not be carried out at all - fmi3Fatal
: if an error occurred which corrupted the FMU irreparably
Source
- FMISpec3.0 Link: https://fmi-standard.org/
- FMISpec3.0: 2.2.3 Platform Dependent Definitions
- FMISpec3.0: 2.2.4 Status Returned by Functions
- FMISpec3.0: 2.2.6.2. Getting and Setting Variable Values
FMICore.fmi3SetInt8
— Methodfmi3SetInt8(c::FMU3Instance, vr::fmi3ValueReferenceFormat, values::Union{AbstractArray{fmi3Int8}, fmi3Int8})
Set the values of an array of integer variables
Arguments
c::FMU3Instance
: Mutable struct represents an instantiated instance of an FMU in the FMI 3.0 Standard.vr::fmi3ValueReferenceFormat
: Wildcards for how a user can pass a fmi[X]ValueReference
More detailed: fmi3ValueReferenceFormat = Union{Nothing, String, Array{String,1}, fmi3ValueReference, Array{fmi3ValueReference,1}, Int64, Array{Int64,1}, Symbol}
values::Union{AbstractArray{fmi3Int8}, fmi3Int8}
: Argumentvalues
is an AbstractArray with the actual values of these variables.
Returns
status::fmi3Status
: Returnstatus
is an enumeration of typefmi3Status
and indicates the success of the function call.
More detailed:
fmi3OK
: all wellfmi3Warning
: things are not quite right, but the computation can continuefmi3Discard
: if the slave computed successfully only a subinterval of the communication stepfmi3Error
: the communication step could not be carried out at allfmi3Fatal
: if an error occurred which corrupted the FMU irreparably
Source
- FMISpec3.0 Link: https://fmi-standard.org/
- FMISpec3.0: 2.2.4 Status Returned by Functions
- FMISpec3.0: 2.2.6.2. Getting and Setting Variable Values
See also fmi3SetInt8
.
FMICore.fmi3SetIntervalDecimal
— Methodfmi3SetIntervalDecimal(c::FMU3Instance, vr::AbstractArray{fmi3ValueReference}, nvr::Csize_t, intervals::AbstractArray{fmi3Float64})
Sets the interval until the next clock tick
TODO argmuents
Arguments
c::FMU3Instance
: Argumentc
is a Mutable struct represents an instantiated instance of an FMU in the FMI 3.0 Standard.vr::AbstractArray{fmi3ValueReference}
: Argumentvr
is an AbstractArray ofnvr
value handels called "ValueReference" that define the variable that shall be inquired.nvr::Csize_t
: Argumentnvr
defines the size ofvr
.intervals::AbstractArray{fmi3Float64}
:
Returns
status::fmi3Status
: Returnstatus
is an enumeration of typefmi3Status
and indicates the success of the function call.
More detailed:
fmi3OK
: all wellfmi3Warning
: things are not quite right, but the computation can continuefmi3Discard
: if the slave computed successfully only a subinterval of the communication stepfmi3Error
: the communication step could not be carried out at allfmi3Fatal
: if an error occurred which corrupted the FMU irreparably
Source
- FMISpec3.0 Link: https://fmi-standard.org/
- FMISpec3.0: 2.2.3 Platform Dependent Definitions
- FMISpec3.0: 2.2.4 Status Returned by Functions
- FMISpec3.0: 2.2.9. Clocks
See also fmi3SetIntervalDecimal
.
FMICore.fmi3SetIntervalFraction
— Methodfmi3SetIntervalFraction(c::FMU3Instance, vr::AbstractArray{fmi3ValueReference}, nvr::Csize_t, intervalCounters::AbstractArray{fmi3UInt64}, resolutions::AbstractArray{fmi3UInt64})
Sets the interval until the next clock tick. Only allowed if the attribute 'supportsFraction' is set.
TODO argmuents
Arguments
c::FMU3Instance
: Argumentc
is a Mutable struct represents an instantiated instance of an FMU in the FMI 3.0 Standard.vr::AbstractArray{fmi3ValueReference}
: Argumentvr
is an AbstractArray ofnvr
value handels called "ValueReference" that define the variable that shall be inquired.nvr::Csize_t
: Argumentnvr
defines the size ofvr
.intervalCounters::AbstractArray{fmi3UInt64}
:resolutions::AbstractArray{fmi3UInt64}
:
Returns
status::fmi3Status
: Returnstatus
is an enumeration of typefmi3Status
and indicates the success of the function call.
More detailed:
fmi3OK
: all wellfmi3Warning
: things are not quite right, but the computation can continuefmi3Discard
: if the slave computed successfully only a subinterval of the communication stepfmi3Error
: the communication step could not be carried out at allfmi3Fatal
: if an error occurred which corrupted the FMU irreparably
Source
- FMISpec3.0 Link: https://fmi-standard.org/
- FMISpec3.0: 2.2.3 Platform Dependent Definitions
- FMISpec3.0: 2.2.4 Status Returned by Functions
- FMISpec3.0: 2.2.9. Clocks
See also fmi3SetIntervalFraction
.
FMICore.fmi3SetString
— Methodfmi3SetString(c::FMU3Instance, vr::AbstractArray{fmi3ValueReference}, nvr::Csize_t, value::AbstractArray{fmi3String}, nvalue::Csize_t)
Functions to get and set values of variables idetified by their valueReference.
Arguments
c::FMU3Instance
: Argumentc
is a Mutable struct represents an instantiated instance of an FMU in the FMI 3.0 Standard.vr::AbstractArray{fmi3ValueReference}
: Argumentvr
is an AbstractArray ofnvr
value handels called "ValueReference" that define the variable that shall be inquired.nvr::Csize_t
: Argumentnvr
defines the size ofvr
.values::AbstractArray{fmi3String}
: Argumentvalues
is an AbstractArray with the actual values of these variables.nvalue::Csize_t
: Argumentnvalue
defines the size ofvalues
.
Returns
status::fmi3Status
: Returnstatus
is an enumeration of typefmi3Status
and indicates the success of the function call.
More detailed:
fmi3OK
: all wellfmi3Warning
: things are not quite right, but the computation can continuefmi3Discard
: if the slave computed successfully only a subinterval of the communication stepfmi3Error
: the communication step could not be carried out at allfmi3Fatal
: if an error occurred which corrupted the FMU irreparably
Source
- FMISpec3.0 Link: https://fmi-standard.org/
- FMISpec3.0: 2.2.3 Platform Dependent Definitions
- FMISpec3.0: 2.2.4 Status Returned by Functions
- FMISpec3.0: 2.2.6.2. Getting and Setting Variable Values
See also fmi3SetString
.
FMICore.fmi3SetString
— Methodfmi3SetString(c::FMU3Instance, vr::fmi3ValueReferenceFormat, values::Union{AbstractArray{String}, String})
Set the values of an array of string variables
Arguments
c::FMU3Instance
: Mutable struct represents an instantiated instance of an FMU in the FMI 3.0 Standard.vr::fmi3ValueReferenceFormat
: Wildcards for how a user can pass a fmi[X]ValueReference
More detailed: fmi3ValueReferenceFormat = Union{Nothing, String, Array{String,1}, fmi3ValueReference, Array{fmi3ValueReference,1}, Int64, Array{Int64,1}, Symbol}
values::Union{AbstractArray{String}, String}
: Argumentvalues
is an AbstractArray with the actual values of these variables.
Returns
status::fmi3Status
: Returnstatus
is an enumeration of typefmi3Status
and indicates the success of the function call.
More detailed:
fmi3OK
: all wellfmi3Warning
: things are not quite right, but the computation can continuefmi3Discard
: if the slave computed successfully only a subinterval of the communication stepfmi3Error
: the communication step could not be carried out at allfmi3Fatal
: if an error occurred which corrupted the FMU irreparably
Source
- FMISpec3.0 Link: https://fmi-standard.org/
- FMISpec3.0: 2.2.4 Status Returned by Functions
- FMISpec3.0: 2.2.6.2. Getting and Setting Variable Values
See also fmi3SetString
.
FMICore.fmi3SetTime
— Methodfmi3SetTime(c::FMU3Instance, time::fmi3Float64)
Set a new time instant and re-initialize caching of variables that depend on time, provided the newly provided time value is different to the previously set time value (variables that depend solely on constants or parameters need not to be newly computed in the sequel, but the previously computed values can be reused).
Arguments
c::FMU3Instance
: Mutable struct represents an instantiated instance of an FMU in the FMI 3.0 Standard.time::fmi3Float64
: Argumenttime
contains a value of typefmi3Float64
which is a alias type forReal
data type.time
sets the independent variable time t.
Returns
status::fmi3Status
: Returnstatus
is an enumeration of typefmi3Status
and indicates the success of the function call.
More detailed:
fmi3OK
: all wellfmi3Warning
: things are not quite right, but the computation can continuefmi3Discard
: if the slave computed successfully only a subinterval of the communication stepfmi3Error
: the communication step could not be carried out at allfmi3Fatal
: if an error occurred which corrupted the FMU irreparably
Source
- FMISpec3.0 Link: https://fmi-standard.org/
- FMISpec3.0: 2.2.3 Platform Dependent Definitions
- FMISpec3.0: 2.2.4 Status Returned by Functions
- FMISpec3.0: 3.2.1. State: Continuous-Time Mode
See also fmi3SetTime
.
FMICore.fmi3SetTime
— Methodfmi3SetTime(c::FMU3Instance, time::Real)
Set a new time instant and re-initialize caching of variables that depend on time, provided the newly provided time value is different to the previously set time value (variables that depend solely on constants or parameters need not to be newly computed in the sequel, but the previously computed values can be reused).
Arguments
c::FMU3Instance
: Mutable struct represents an instantiated instance of an FMU in the FMI 3.0 Standard.t::Real
: Argumentt
contains a value of typeReal
which is a alias type forReal
data type.time
sets the independent variable time t.
Returns
status::fmi3Status
: Returnstatus
is an enumeration of typefmi3Status
and indicates the success of the function call.
More detailed:
fmi3OK
: all wellfmi3Warning
: things are not quite right, but the computation can continuefmi3Discard
: if the slave computed successfully only a subinterval of the communication stepfmi3Error
: the communication step could not be carried out at allfmi3Fatal
: if an error occurred which corrupted the FMU irreparably
Source
- FMISpec3.0 Link: https://fmi-standard.org/
- FMISpec3.0: 2.2.3 Platform Dependent Definitions
- FMISpec3.0: 2.2.4 Status Returned by Functions
- FMISpec3.0: 3.2.1. State: Continuous-Time Mode
See also fmi3SetTime
.
FMICore.fmi3SetUInt16
— Methodfmi3SetUInt16(c::FMU3Instance, vr::AbstractArray{fmi3ValueReference}, nvr::Csize_t, value::AbstractArray{fmi3UInt16}, nvalue::Csize_t)
Functions to get and set values of variables idetified by their valueReference.
Arguments
c::FMU3Instance
: Argumentc
is a Mutable struct represents an instantiated instance of an FMU in the FMI 3.0 Standard.vr::AbstractArray{fmi3ValueReference}
: Argumentvr
is an AbstractArray ofnvr
value handels called "ValueReference" that define the variable that shall be inquired.nvr::Csize_t
: Argumentnvr
defines the size ofvr
.values::AbstractArray{fmi3UInt16}
: Argumentvalues
is an AbstractArray with the actual values of these variables.nvalue::Csize_t
: Argumentnvalue
defines the size ofvalues
.
Returns
status::fmi3Status
: Returnstatus
is an enumeration of typefmi3Status
and indicates the success of the function call.
More detailed: - fmi3OK
: all well - fmi3Warning
: things are not quite right, but the computation can continue - fmi3Discard
: if the slave computed successfully only a subinterval of the communication step - fmi3Error
: the communication step could not be carried out at all - fmi3Fatal
: if an error occurred which corrupted the FMU irreparably
Source
- FMISpec3.0 Link: https://fmi-standard.org/
- FMISpec3.0: 2.2.3 Platform Dependent Definitions
- FMISpec3.0: 2.2.4 Status Returned by Functions
- FMISpec3.0: 2.2.6.2. Getting and Setting Variable Values
FMICore.fmi3SetUInt16
— Methodfmi3SetUInt16(c::FMU3Instance, vr::fmi3ValueReferenceFormat, values::Union{AbstractArray{fmi3UInt16}, fmi3UInt16})
Set the values of an array of integer variables
Arguments
c::FMU3Instance
: Mutable struct represents an instantiated instance of an FMU in the FMI 3.0 Standard.vr::fmi3ValueReferenceFormat
: Wildcards for how a user can pass a fmi[X]ValueReference
More detailed: fmi3ValueReferenceFormat = Union{Nothing, String, Array{String,1}, fmi3ValueReference, Array{fmi3ValueReference,1}, Int64, Array{Int64,1}, Symbol}
values::Union{AbstractArray{fmi3UInt16}, fmi3UInt16}
: Argumentvalues
is an AbstractArray with the actual values of these variables.
Returns
status::fmi3Status
: Returnstatus
is an enumeration of typefmi3Status
and indicates the success of the function call.
More detailed:
fmi3OK
: all wellfmi3Warning
: things are not quite right, but the computation can continuefmi3Discard
: if the slave computed successfully only a subinterval of the communication stepfmi3Error
: the communication step could not be carried out at allfmi3Fatal
: if an error occurred which corrupted the FMU irreparably
Source
- FMISpec3.0 Link: https://fmi-standard.org/
- FMISpec3.0: 2.2.4 Status Returned by Functions
- FMISpec3.0: 2.2.6.2. Getting and Setting Variable Values
See also fmi3SetUInt16
.
FMICore.fmi3SetUInt32
— Methodfmi3SetInt32(c::FMU3Instance, vr::AbstractArray{fmi3ValueReference}, nvr::Csize_t, value::AbstractArray{fmi3UInt32}, nvalue::Csize_t)
Functions to get and set values of variables idetified by their valueReference.
Arguments
c::FMU3Instance
: Argumentc
is a Mutable struct represents an instantiated instance of an FMU in the FMI 3.0 Standard.vr::AbstractArray{fmi3ValueReference}
: Argumentvr
is an AbstractArray ofnvr
value handels called "ValueReference" that define the variable that shall be inquired.nvr::Csize_t
: Argumentnvr
defines the size ofvr
.values::AbstractArray{fmi3UInt32}
: Argumentvalues
is an AbstractArray with the actual values of these variables.nvalue::Csize_t
: Argumentnvalue
defines the size ofvalues
.
Returns
status::fmi3Status
: Returnstatus
is an enumeration of typefmi3Status
and indicates the success of the function call.
More detailed: - fmi3OK
: all well - fmi3Warning
: things are not quite right, but the computation can continue - fmi3Discard
: if the slave computed successfully only a subinterval of the communication step - fmi3Error
: the communication step could not be carried out at all - fmi3Fatal
: if an error occurred which corrupted the FMU irreparably
Source
- FMISpec3.0 Link: https://fmi-standard.org/
- FMISpec3.0: 2.2.3 Platform Dependent Definitions
- FMISpec3.0: 2.2.4 Status Returned by Functions
- FMISpec3.0: 2.2.6.2. Getting and Setting Variable Values
See also fmi3SetUInt32
.
FMICore.fmi3SetUInt32
— Methodfmi3SetUInt32(c::FMU3Instance, vr::fmi3ValueReferenceFormat, values::Union{AbstractArray{fmi3UInt32}, fmi3UInt32})
Set the values of an array of integer variables
Arguments
c::FMU3Instance
: Mutable struct represents an instantiated instance of an FMU in the FMI 3.0 Standard.vr::fmi3ValueReferenceFormat
: Wildcards for how a user can pass a fmi[X]ValueReference
More detailed: fmi3ValueReferenceFormat = Union{Nothing, String, Array{String,1}, fmi3ValueReference, Array{fmi3ValueReference,1}, Int64, Array{Int64,1}, Symbol}
values::Union{AbstractArray{fmi3UInt32}, fmi3UInt32}
: Argumentvalues
is an AbstractArray with the actual values of these variables.
Returns
status::fmi3Status
: Returnstatus
is an enumeration of typefmi3Status
and indicates the success of the function call.
More detailed:
fmi3OK
: all wellfmi3Warning
: things are not quite right, but the computation can continuefmi3Discard
: if the slave computed successfully only a subinterval of the communication stepfmi3Error
: the communication step could not be carried out at allfmi3Fatal
: if an error occurred which corrupted the FMU irreparably
Source
- FMISpec3.0 Link: https://fmi-standard.org/
- FMISpec3.0: 2.2.4 Status Returned by Functions
- FMISpec3.0: 2.2.6.2. Getting and Setting Variable Values
See also fmi3SetUInt32
.
FMICore.fmi3SetUInt64
— Methodfmi3SetUInt64(c::FMU3Instance, vr::AbstractArray{fmi3ValueReference}, nvr::Csize_t, value::AbstractArray{fmi3UInt64}, nvalue::Csize_t)
Functions to get and set values of variables idetified by their valueReference.
Arguments
c::FMU3Instance
: Argumentc
is a Mutable struct represents an instantiated instance of an FMU in the FMI 3.0 Standard.vr::AbstractArray{fmi3ValueReference}
: Argumentvr
is an AbstractArray ofnvr
value handels called "ValueReference" that define the variable that shall be inquired.nvr::Csize_t
: Argumentnvr
defines the size ofvr
.values::AbstractArray{fmi3UInt64}
: Argumentvalues
is an AbstractArray with the actual values of these variables.nvalue::Csize_t
: Argumentnvalue
defines the size ofvalues
.
Returns
status::fmi3Status
: Returnstatus
is an enumeration of typefmi3Status
and indicates the success of the function call.
More detailed: - fmi3OK
: all well - fmi3Warning
: things are not quite right, but the computation can continue - fmi3Discard
: if the slave computed successfully only a subinterval of the communication step - fmi3Error
: the communication step could not be carried out at all - fmi3Fatal
: if an error occurred which corrupted the FMU irreparably
Source
- FMISpec3.0 Link: https://fmi-standard.org/
- FMISpec3.0: 2.2.3 Platform Dependent Definitions
- FMISpec3.0: 2.2.4 Status Returned by Functions
- FMISpec3.0: 2.2.6.2. Getting and Setting Variable Values
See also fmi3SetUInt64
.
FMICore.fmi3SetUInt64
— Methodfmi3SetUInt64(c::FMU3Instance, vr::fmi3ValueReferenceFormat, values::Union{AbstractArray{fmi3UInt64}, fmi3UInt64})
Set the values of an array of integer variables
Arguments
c::FMU3Instance
: Mutable struct represents an instantiated instance of an FMU in the FMI 3.0 Standard.vr::fmi3ValueReferenceFormat
: Wildcards for how a user can pass a fmi[X]ValueReference
More detailed: fmi3ValueReferenceFormat = Union{Nothing, String, Array{String,1}, fmi3ValueReference, Array{fmi3ValueReference,1}, Int64, Array{Int64,1}, Symbol}
values::Union{AbstractArray{fmi3UInt64}, fmi3UInt64}
: Argumentvalues
is an AbstractArray with the actual values of these variables.
Returns
status::fmi3Status
: Returnstatus
is an enumeration of typefmi3Status
and indicates the success of the function call.
More detailed:
fmi3OK
: all wellfmi3Warning
: things are not quite right, but the computation can continuefmi3Discard
: if the slave computed successfully only a subinterval of the communication stepfmi3Error
: the communication step could not be carried out at allfmi3Fatal
: if an error occurred which corrupted the FMU irreparably
Source
- FMISpec3.0 Link: https://fmi-standard.org/
- FMISpec3.0: 2.2.4 Status Returned by Functions
- FMISpec3.0: 2.2.6.2. Getting and Setting Variable Values
See also fmi3SetUInt64
.
FMICore.fmi3SetUInt8
— Methodfmi3SetUInt8(c::FMU3Instance, vr::AbstractArray{fmi3ValueReference}, nvr::Csize_t, value::AbstractArray{fmi3UInt8}, nvalue::Csize_t)
Functions to get and set values of variables idetified by their valueReference.
Arguments
c::FMU3Instance
: Argumentc
is a Mutable struct represents an instantiated instance of an FMU in the FMI 3.0 Standard.vr::AbstractArray{fmi3ValueReference}
: Argumentvr
is an AbstractArray ofnvr
value handels called "ValueReference" that define the variable that shall be inquired.nvr::Csize_t
: Argumentnvr
defines the size ofvr
.values::AbstractArray{fmi3UInt8}
: Argumentvalues
is an AbstractArray with the actual values of these variables.nvalue::Csize_t
: Argumentnvalue
defines the size ofvalues
.
Returns
status::fmi3Status
: Returnstatus
is an enumeration of typefmi3Status
and indicates the success of the function call.
More detailed: - fmi3OK
: all well - fmi3Warning
: things are not quite right, but the computation can continue - fmi3Discard
: if the slave computed successfully only a subinterval of the communication step - fmi3Error
: the communication step could not be carried out at all - fmi3Fatal
: if an error occurred which corrupted the FMU irreparably
Source
- FMISpec3.0 Link: https://fmi-standard.org/
- FMISpec3.0: 2.2.3 Platform Dependent Definitions
- FMISpec3.0: 2.2.4 Status Returned by Functions
- FMISpec3.0: 2.2.6.2. Getting and Setting Variable Values
See also fmi3SetUInt8
.
FMICore.fmi3SetUInt8
— Methodfmi3SetUInt8(c::FMU3Instance, vr::fmi3ValueReferenceFormat, values::Union{AbstractArray{fmi3UInt8}, fmi3UInt8})
Set the values of an array of integer variables
Arguments
c::FMU3Instance
: Mutable struct represents an instantiated instance of an FMU in the FMI 3.0 Standard.vr::fmi3ValueReferenceFormat
: Wildcards for how a user can pass a fmi[X]ValueReference
More detailed: fmi3ValueReferenceFormat = Union{Nothing, String, Array{String,1}, fmi3ValueReference, Array{fmi3ValueReference,1}, Int64, Array{Int64,1}, Symbol}
values::Union{AbstractArray{fmi3UInt8}, fmi3UInt8}
: Argumentvalues
is an AbstractArray with the actual values of these variables.
Returns
status::fmi3Status
: Returnstatus
is an enumeration of typefmi3Status
and indicates the success of the function call.
More detailed:
fmi3OK
: all wellfmi3Warning
: things are not quite right, but the computation can continuefmi3Discard
: if the slave computed successfully only a subinterval of the communication stepfmi3Error
: the communication step could not be carried out at allfmi3Fatal
: if an error occurred which corrupted the FMU irreparably
Source
- FMISpec3.0 Link: https://fmi-standard.org/
- FMISpec3.0: 2.2.4 Status Returned by Functions
- FMISpec3.0: 2.2.6.2. Getting and Setting Variable Values
See also fmi3SetUInt8
.
FMICore.fmi3Terminate
— Methodfmi3Terminate(c::FMU3Instance; soft::Bool=false)
Informs the FMU that the simulation run is terminated.
Arguments
c::FMU3Instance
: Argumentc
is a Mutable struct represents an instantiated instance of an FMU in the FMI 3.0 Standard.
Keywords
soft::Bool=false
: If the Keywordsoft = true
thefmi3Teminate
needs to be called in statefmi3InstanceStateContinuousTimeMode
orfmi3InstanceStateEventMode
.
Returns
status::fmi3Status
: Returnstatus
is an enumeration of typefmi3Status
and indicates the success of the function call.
More detailed: - fmi3OK
: all well - fmi3Warning
: things are not quite right, but the computation can continue - fmi3Discard
: if the slave computed successfully only a subinterval of the communication step - fmi3Error
: the communication step could not be carried out at all - fmi3Fatal
: if an error occurred which corrupted the FMU irreparably
Source
- FMISpec3.0 Link: https://fmi-standard.org/
- FMISpec3.0: 2.2.3 Platform Dependent Definitions
- FMISpec3.0: 2.2.4 Status Returned by Functions
- FMISpec3.0: 2.3.4. Super State: Initialized
See also fmi3Terminate
.
FMICore.fmi3UpdateDiscreteStates
— Methodfmi3UpdateDiscreteStates(c::FMU3Instance, discreteStatesNeedUpdate::Ref{fmi3Boolean}, terminateSimulation::Ref{fmi3Boolean},
nominalsOfContinuousStatesChanged::Ref{fmi3Boolean}, valuesOfContinuousStatesChanged::Ref{fmi3Boolean},
nextEventTimeDefined::Ref{fmi3Boolean}, nextEventTime::Ref{fmi3Float64})
This function is called to signal a converged solution at the current super-dense time instant. fmi3UpdateDiscreteStates must be called at least once per super-dense time instant.
Arguments
c::FMU3Instance
: Mutable struct represents an instantiated instance of an FMU in the FMI 3.0 Standard.discreteStatesNeedUpdate::Ref{fmi3Boolean}
:terminateSimulation::Ref{fmi3Boolean}
:nominalsOfContinuousStatesChanged::Ref{fmi3Boolean}
:valuesOfContinuousStatesChanged::Ref{fmi3Boolean}
:nextEventTimeDefined::Ref{fmi3Boolean}
:nextEventTime::Ref{fmi3Float64}
:
Returns
status::fmi3Status
: Returnstatus
is an enumeration of typefmi3Status
and indicates the success of the function call.
More detailed:
fmi3OK
: all wellfmi3Warning
: things are not quite right, but the computation can continuefmi3Discard
: if the slave computed successfully only a subinterval of the communication stepfmi3Error
: the communication step could not be carried out at allfmi3Fatal
: if an error occurred which corrupted the FMU irreparably
Source
- FMISpec3.0 Link: https://fmi-standard.org/
- FMISpec3.0: 2.2.3 Platform Dependent Definitions
- FMISpec3.0: 2.2.4 Status Returned by Functions
- FMISpec3.0: 2.3.5. State: Event Mode
FMICore.fmi3UpdateDiscreteStates
— Methodfmi3UpdateDiscreteStates(c::FMU3Instance)
This function is called to signal a converged solution at the current super-dense time instant. fmi3UpdateDiscreteStates must be called at least once per super-dense time instant. Results are returned, use fmi3UpdateDiscreteStates!
for the inplace variant.
Arguments
c::FMU3Instance
: Mutable struct represents an instantiated instance of an FMU in the FMI 3.0 Standard.
Returns
discreteStatesNeedUpdate
terminateSimulation
nominalsOfContinuousStatesChanged
valuesOfContinuousStatesChanged
nextEventTimeDefined
nextEventTime
Source
- FMISpec3.0 Link: https://fmi-standard.org/
- FMISpec3.0: 2.2.3 Platform Dependent Definitions
- FMISpec3.0: 2.3.5. State: Event Mode
FMIImport.createFMU2
— MethodcreateFMU2
Sets the properties of the fmu by reading the modelDescription.xml. Retrieves all the pointers of binary functions.
Arguments
pathToFMU::String
: The folder path to the .fmu file.
Keywords
unpackPath=nothing
: Via optional argumentunpackPath
, a path to unpack the FMU can be specified (default: system temporary directory).type=nothing
: Defines whether a Co-Simulation or Model Exchange is presentcleanup=true
: The cleanup option controls whether the temporary directory is automatically deleted when the process exits.
Returns
- Returns the instance of the FMU struct.
FMIImport.createFMU3
— MethodcreateFMU3
Sets the properties of the fmu by reading the modelDescription.xml. Retrieves all the pointers of binary functions.
Arguments
pathToFMU::String
: The folder path to the .fmu file.
Keywords
unpackPath=nothing
: Via optional argumentunpackPath
, a path to unpack the FMU can be specified (default: system temporary directory).type=nothing
: Defines whether a Co-Simulation or Model Exchange is presentcleanup=true
: The cleanup option controls whether the temporary directory is automatically deleted when the process exits.
Returns
- Returns the instance of the FMU struct.
Source
- FMISpec3.0 Link: https://fmi-standard.org/
- FMISpec2.0.2: 2.4.7 Model Variables
See also .
FMIImport.fmi2CallbackAllocateMemory
— MethodSource: FMISpec2.0.2[p.21-22]: 2.1.5 Creation, Destruction and Logging of FMU Instances
Function that is called in the FMU if memory needs to be allocated. If attribute “canNotUseMemoryManagementFunctions = true” in <fmiModelDescription><ModelExchange / CoSimulation>, then function allocateMemory is not used in the FMU and a void pointer can be provided. If this attribute has a value of “false” (which is the default), the FMU must not use malloc, calloc or other memory allocation functions. One reason is that these functions might not be available for embedded systems on the target machine. Another reason is that the environment may have optimized or specialized memory allocation functions. allocateMemory returns a pointer to space for a vector of nobj objects, each of size “size” or NULL, if the request cannot be satisfied. The space is initialized to zero bytes [(a simple implementation is to use calloc from the C standard library)].
FMIImport.fmi2CallbackFreeMemory
— MethodSource: FMISpec2.0.2[p.22]: 2.1.5 Creation, Destruction and Logging of FMU Instances
Function that must be called in the FMU if memory is freed that has been allocated with allocateMemory. If a null pointer is provided as input argument obj, the function shall perform no action [(a simple implementation is to use free from the C standard library; in ANSI C89 and C99, the null pointer handling is identical as defined here)]. If attribute “canNotUseMemoryManagementFunctions = true” in <fmiModelDescription><ModelExchange / CoSimulation>, then function freeMemory is not used in the FMU and a null pointer can be provided.
FMIImport.fmi2CallbackLogger
— MethodSource: FMISpec2.0.2[p.21]: 2.1.5 Creation, Destruction and Logging of FMU Instances
Function that is called in the FMU, usually if an fmi2XXX function, does not behave as desired. If “logger” is called with “status = fmi2OK”, then the message is a pure information message. “instanceName” is the instance name of the model that calls this function. “category” is the category of the message. The meaning of “category” is defined by the modeling environment that generated the FMU. Depending on this modeling environment, none, some or all allowed values of “category” for this FMU are defined in the modelDescription.xml file via element “<fmiModelDescription><LogCategories>”, see section 2.2.4. Only messages are provided by function logger that have a category according to a call to fmi2SetDebugLogging (see below). Argument “message” is provided in the same way and with the same format control as in function “printf” from the C standard library. [Typically, this function prints the message and stores it optionally in a log file.]
FMIImport.fmi2CallbackStepFinished
— MethodSource: FMISpec2.0.2[p.22]: 2.1.5 Creation, Destruction and Logging of FMU Instances
Optional call back function to signal if the computation of a communication step of a co-simulation slave is finished. A null pointer can be provided. In this case the master must use fmiGetStatus(..) to query the status of fmi2DoStep. If a pointer to a function is provided, it must be called by the FMU after a completed communication step.
FMIImport.fmi2CompletedIntegratorStep
— MethodfmiCompletedIntegratorStep(c::FMU2Component, noSetFMUStatePriorToCurrentPoint::fmi2Boolean)
This function must be called by the environment after every completed step
Arguments
C::FMU2Component
: Mutable struct represents an instantiated instance of an FMU in the FMI 2.0.2 Standard.noSetFMUStatePriorToCurrentPoint::fmi2Boolean
: ArgumentnoSetFMUStatePriorToCurrentPoint = fmi2True
iffmi2SetFMUState
will no longer be called for time instants prior to current time in this simulation run.
Returns
status::fmi2Status
: Returnstatus
is an enumeration of typefmi2Status
and indicates the success of the function call.
More detailed:
fmi2OK
: all wellfmi2Warning
: things are not quite right, but the computation can continuefmi2Discard
: if the slave computed successfully only a subinterval of the communication stepfmi2Error
: the communication step could not be carried out at allfmi2Fatal
: if an error occurred which corrupted the FMU irreparablyfmi2Pending
: this status is returned if the slave executes the function asynchronouslyenterEventMode::Array{fmi2Boolean, 1}
: ReturnsenterEventMode[1]
to signal to the environment if the FMU shall callfmi2EnterEventMode
terminateSimulation::Array{fmi2Boolean, 1}
: ReturnsterminateSimulation[1]
to signal if the simulation shall be terminated.
Source
- FMISpec2.0.2 Link: https://fmi-standard.org/
- FMISpec2.0.2[p.16]: 2.1.2 Platform Dependent Definitions (fmi2TypesPlatform.h)
- FMISpec2.0.2[p.16]: 2.1.3 Status Returned by Functions
- FMISpec2.0.2[p.83]: 3.2.2 Evaluation of Model Equations
See also fmi2CompletedIntegratorStep
.
FMIImport.fmi2DeSerializeFMUstate
— Methodfmi2DeSerializeFMUstate(c::FMU2Component, serializedState::AbstractArray{fmi2Byte})
Deserialize the data in the serializedState fmi2Byte field
Arguments
c::FMU2Component
: Mutable struct represents an instantiated instance of an FMU in the FMI 2.0.2 Standard.serializedState::Array{fmi2Byte}
: ArgumentserializedState
contains the fmi2Byte field to be deserialized.
Returns
- Return
state
is a pointer to a copy of the internal FMU state.
Source
- FMISpec2.0.2 Link: https://fmi-standard.org/
- FMISpec2.0.2[p.16]: 2.1.2 Platform Dependent Definitions (fmi2TypesPlatform.h)
- FMISpec2.0.2[p.16]: 2.1.3 Status Returned by Functions
- FMISpec2.0.2[p.25]: 2.1.8 Getting and Setting the Complete FMU State
See also fmi2DeSerializeFMUstate
.
FMIImport.fmi2GetBoolean
— Methodfmi2GetBoolean(c::FMU2Component, vr::fmi2ValueReferenceFormat)
Get the values of an array of fmi2Boolean variables.
Arguments
c::fmi2Struct
: Representative for an FMU in the FMI 2.0.2 Standard.
More detailed: fmi2Struct = Union{FMU2, FMU2Component}
c::FMU2
: Mutable struct representing a FMU and all it instantiated instances in the FMI 2.0.2 Standard.c::FMU2Component
: Mutable struct represents an instantiated instance of an FMU in the FMI 2.0.2 Standard.vr::fmi2ValueReferenceFormat
: Argumentvr
defines the value references of the variables.
More detailed: fmi2ValueReferenceFormat = Union{Nothing, String, Array{String,1}, fmi2ValueReference, Array{fmi2ValueReference,1}, Int64, Array{Int64,1}, Symbol}
Returns
values::Array{fmi2Boolean}
: Returnvalues
is an array with the actual values of these variables.
See also fmi2GetBoolean!
.
FMIImport.fmi2GetContinuousStates
— Methodfmi2GetContinuousStates(c::FMU2Component)
Return the new (continuous) state vector x
Arguments
c::FMU2Component
: Mutable struct represents an instantiated instance of an FMU in the FMI 2.0.2 Standard.
Returns
x::Array{fmi2Real}
: Returns an array offmi2Real
values representing the new continuous state vectorx
.
Source
- FMISpec2.0.2 Link: https://fmi-standard.org/
- FMISpec2.0.2[p.16]: 2.1.2 Platform Dependent Definitions (fmi2TypesPlatform.h)
- FMISpec2.0.2[p.16]: 2.1.3 Status Returned by Functions
- FMISpec2.0.2[p.83]: 3.2.2 Evaluation of Model Equations
See also fmi2GetEventIndicators!
.
FMIImport.fmi2GetDerivatives
— Methodfmi2GetDerivatives(c::FMU2Component)
Compute state derivatives at the current time instant and for the current states.
Arguments
c::FMU2Component
: Mutable struct represents an instantiated instance of an FMU in the FMI 2.0.2 Standard.
Returns
derivatives::Array{fmi2Real}
: Returns an array offmi2Real
values representing thederivatives
for the current states. The ordering of the elements of the derivatives vector is identical to the ordering of the state
vector.
Source
- FMISpec2.0.2 Link: https://fmi-standard.org/
- FMISpec2.0.2[p.16]: 2.1.2 Platform Dependent Definitions (fmi2TypesPlatform.h)
- FMISpec2.0.2[p.16]: 2.1.3 Status Returned by Functions
- FMISpec2.0.2[p.83]: 3.2.2 Evaluation of Model Equations
See also fmi2GetDerivatives!
.
FMIImport.fmi2GetDirectionalDerivative
— Methodfmi2GetDirectionalDerivative(c::FMU2Component,
vUnknown_ref::AbstractArray{fmi2ValueReference},
vKnown_ref::AbstractArray{fmi2ValueReference},
dvKnown::Union{AbstractArray{fmi2Real}, Nothing} = nothing)
Wrapper Function call to compute the partial derivative with respect to the variables vKnown_ref
.
Computes the directional derivatives of an FMU. An FMU has different Modes and in every Mode an FMU might be described by different equations and different unknowns.The precise definitions are given in the mathematical descriptions of Model Exchange (section 3.1) and Co-Simulation (section 4.1). In every Mode, the general form of the FMU equations are: 𝐯unknown = 𝐡(𝐯known, 𝐯_rest)
v_unknown
: vector of unknown Real variables computed in the actual Mode:- Initialization Mode: unkowns kisted under
<ModelStructure><InitialUnknowns>
that have type Real. - Continuous-Time Mode (ModelExchange): The continuous-time outputs and state derivatives. (= the variables listed under
<ModelStructure><Outputs>
with type Real and variability =continuous
and the variables listed as state derivatives under<ModelStructure><Derivatives>)
. - Event Mode (ModelExchange): The same variables as in the Continuous-Time Mode and additionally variables under
<ModelStructure><Outputs>
with type Real and variability =discrete
. - Step Mode (CoSimulation): The variables listed under
<ModelStructure><Outputs>
with type Real and variability =continuous
ordiscrete
. If<ModelStructure><Derivatives>
is present, also the variables listed here as state derivatives.
- Initialization Mode: unkowns kisted under
v_known
: Real input variables of function h that changes its value in the actual Mode.v_rest
:Set of input variables of function h that either changes its value in the actual Mode but are non-Real variables, or do not change their values in this Mode, but change their values in other Modes
Computes a linear combination of the partial derivatives of h with respect to the selected input variables 𝐯_known:
Δv_unknown = (δh / δv_known) Δv_known
Arguments
c::FMU2Component
: Mutable struct represents an instantiated instance of an FMU in the FMI 2.0.2 Standard.vUnknown_ref::AbstractArray{fmi2ValueReference}
: ArgumentvUnknown_ref
contains values of typefmi2ValueReference
which are identifiers of a variable value of the model.vUnknown_ref
can be equated withv_unknown
(variable described above).vKnown_ref::AbstractArray{fmi2ValueReference}
: ArgumentvKnown_ref
contains values of typefmi2ValueReference
which are identifiers of a variable value of the model.vKnown_ref
can be equated withv_known
(variable described above).dvKnown::Union{AbstractArray{fmi2Real}, Nothing} = nothing
: If no seed vector is passed the valuenothing
is used. The vector values Compute the partial derivative with respect to the given entries in vectorvKnown_ref
with the matching evaluate ofdvKnown
. # gehört das zu den v_rest values
Returns
dvUnknown::Array{fmi2Real}
: ReturndvUnknown
contains the directional derivative vector values.
Source
- FMISpec2.0.2 Link: https://fmi-standard.org/
- FMISpec2.0.2[p.16]: 2.1.2 Platform Dependent Definitions (fmi2TypesPlatform.h)
- FMISpec2.0.2[p.16]: 2.1.3 Status Returned by Functions
- FMISpec2.0.2[p.25]: 2.1.9 Getting Partial Derivatives
See also fmi2GetDirectionalDerivative!
.
FMIImport.fmi2GetEventIndicators
— Methodfmi2GetEventIndicators(c::FMU2Component)
Returns the event indicators of the FMU
Arguments
c::FMU2Component
: Mutable struct represents an instantiated instance of an FMU in the FMI 2.0.2 Standard.
Returns
eventIndicators::Array{fmi2Real}
:The event indicators are returned as a vector represented by an array of "fmi2Real" values.
Source
- FMISpec2.0.2 Link: https://fmi-standard.org/
- FMISpec2.0.2[p.16]: 2.1.2 Platform Dependent Definitions (fmi2TypesPlatform.h)
- FMISpec2.0.2[p.16]: 2.1.3 Status Returned by Functions
- FMISpec2.0.2[p.83]: 3.2.2 Evaluation of Model Equations
See also fmi2GetEventIndicators!
.
FMIImport.fmi2GetFMUstate
— Methodfmi2GetFMUstate(c::FMU2Component)
Makes a copy of the internal FMU state and returns a pointer to this copy.
Arguments
c::FMU2Component
: Mutable struct represents an instantiated instance of an FMU in the FMI 2.0.2 Standard.
Returns
- Return
state
is a pointer to a copy of the internal FMU state.
Source
- FMISpec2.0.2 Link: https://fmi-standard.org/
- FMISpec2.0.2[p.16]: 2.1.2 Platform Dependent Definitions (fmi2TypesPlatform.h)
- FMISpec2.0.2[p.25]: 2.1.8 Getting and Setting the Complete FMU State
See also fmi2GetFMUstate
.
FMIImport.fmi2GetInteger
— Methodfmi2GetInteger(c::FMU2Component, vr::fmi2ValueReferenceFormat)
Returns the integer values of an array of variables
Arguments
c::fmi2Struct
: Representative for an FMU in the FMI 2.0.2 Standard.
More detailed: fmi2Struct = Union{FMU2, FMU2Component}
c::FMU2
: Mutable struct representing a FMU and all it instantiated instances in the FMI 2.0.2 Standard.c::FMU2Component
: Mutable struct represents an instantiated instance of an FMU in the FMI 2.0.2 Standard.vr::fmi2ValueReferenceFormat
: Argumentvr
defines the value references of the variables
More detailed: fmi2ValueReferenceFormat = Union{Nothing, String, Array{String,1}, fmi2ValueReference, Array{fmi2ValueReference,1}, Int64, Array{Int64,1}, Symbol}
Returns
values::Array{fmi2Integer}
: Returnvalues
is an array with the actual values of these variables.
Source
- FMISpec2.0.2 Link: https://fmi-standard.org/
- FMISpec2.0.2[p.24]: 2.1.7 Getting and Setting Variable Values
- FMISpec2.0.2[p.16]: 2.1.2 Platform Dependent Definitions
- FMISpec2.0.2[p.18]: 2.1.3 Status Returned by Functions
See also fmi2GetInteger!
FMIImport.fmi2GetNominalsOfContinuousStates
— Methodfmi2GetNominalsOfContinuousStates(c::FMU2Component)
Return the new (continuous) state vector x
Arguments
c::FMU2Component
: Mutable struct represents an instantiated instance of an FMU in the FMI 2.0.2 Standard.
Returns
x::Array{fmi2Real}
: Returns an array offmi2Real
values representing the new continuous state vectorx
.
Source
- FMISpec2.0.2 Link: https://fmi-standard.org/
- FMISpec2.0.2[p.16]: 2.1.2 Platform Dependent Definitions (fmi2TypesPlatform.h)
- FMISpec2.0.2[p.16]: 2.1.3 Status Returned by Functions
- FMISpec2.0.2[p.83]: 3.2.2 Evaluation of Model Equations
See also fmi2GetNominalsOfContinuousStates
.
FMIImport.fmi2GetReal
— Methodfmi2GetReal(c::FMU2Component, vr::fmi2ValueReferenceFormat)
Get the values of an array of fmi2Real variables.
Arguments
c::fmi2Struct
: Representative for an FMU in the FMI 2.0.2 Standard.
More detailed: fmi2Struct = Union{FMU2, FMU2Component}
c::FMU2
: Mutable struct representing a FMU and all it instantiated instances in the FMI 2.0.2 Standard.c::FMU2Component
: Mutable struct represents an instantiated instance of an FMU in the FMI 2.0.2 Standard.vr::fmi2ValueReferenceFormat
: wildcards for how a user can pass a fmi[X]ValueReference
More detailed: fmi2ValueReferenceFormat = Union{Nothing, String, Array{String,1}, fmi2ValueReference, Array{fmi2ValueReference,1}, Int64, Array{Int64,1}, Symbol}
Returns
values::Array{fm2Real}
: Returns values of an array of fmi2Real variables with the dimension of fmi2ValueReferenceFormat length.
Source
- FMISpec2.0.2 Link: https://fmi-standard.org/
- FMISpec2.0.2[p.24]: 2.1.7 Getting and Setting Variable Values
- FMISpec2.0.2[p.18]: 2.1.3 Status Returned by Functions
See also fmi2GetReal
.
FMIImport.fmi2GetRealOutputDerivatives
— Methodfmi2GetRealOutputDerivatives(c::FMU2Component, vr::fmi2ValueReferenceFormat, order::AbstractArray{fmi2Integer})
Sets the n-th time derivative of real input variables.
Arguments
c::FMU2Component
: Mutable struct represents an instantiated instance of an FMU in the FMI 2.0.2 Standard.vr::Array{fmi2ValueReference}
: Argumentvr
is an array ofnvr
value handels called "ValueReference" that t define the variables whose derivatives shall be set.order::Array{fmi2Integer}
: Argumentorder
is an array of fmi2Integer values witch specifys the corresponding order of derivative of the real input variable.
Returns
value::AbstactArray{fmi2Integer}
: Returnvalue
is an array which represents a vector with the values of the derivatives.
Source
- FMISpec2.0.2 Link: https://fmi-standard.org/
- FMISpec2.0.2[p.16]: 2.1.2 Platform Dependent Definitions
- FMISpec2.0.2[p.18]: 2.1.3 Status Returned by Functions
- FMISpec2.0.2[p.104]: 4.2.1 Transfer of Input / Output Values and Parameters
FMIImport.fmi2GetStatus
— MethodToDo
FMIImport.fmi2GetString
— Methodfmi2GetString(c::FMU2Component, vr::fmi2ValueReferenceFormat)
Get the values of an array of fmi2String variables.
Arguments
c::FMU2Component
: Mutable struct represents an instantiated instance of an FMU in the FMI 2.0.2 Standard.vr::fmi2ValueReferenceFormat
: Argumentvr
defines the value references of the variables.
More detailed: fmi2ValueReferenceFormat = Union{Nothing, String, Array{String,1}, fmi2ValueReference, Array{fmi2ValueReference,1}, Int64, Array{Int64,1}, Symbol}
Returns
values::Array{fmi2String}
: Returnvalues
is an array with the actual values of these variables.
Source
- FMISpec2.0.2 Link: https://fmi-standard.org/
- FMISpec2.0.2[p.24]: 2.1.7 Getting and Setting Variable Values
- FMISpec2.0.2[p.16]: 2.1.2 Platform Dependent Definitions
- FMISpec2.0.2[p.18]: 2.1.3 Status Returned by Functions
See also fmi2GetString!
.
FMIImport.fmi2Instantiate!
— Methodfmi2Instantiate!(fmu::FMU2;
instanceName::String=fmu.modelName,
type::fmi2Type=fmu.type,
pushComponents::Bool = true,
visible::Bool = false,
loggingOn::Bool = fmu.executionConfig.loggingOn,
externalCallbacks::Bool = fmu.executionConfig.externalCallbacks,
logStatusOK::Bool=true,
logStatusWarning::Bool=true,
logStatusDiscard::Bool=true,
logStatusError::Bool=true,
logStatusFatal::Bool=true,
logStatusPending::Bool=true)
Create a new instance of the given fmu, adds a logger if logginOn == true.
Arguments
fmu::FMU2
: Mutable struct representing a FMU and all it instantiated instances in the FMI 2.0.2 Standard.
Keywords
instanceName::String=fmu.modelName
: Name of the instancetype::fmi2Type=fmu.type
: Defines whether a Co-Simulation or Model Exchange is presentpushComponents::Bool = true
: Defines if the fmu components should be pushed in the application.visible::Bool = false
if the FMU should be started with graphic interface, if supported (default=false
)loggingOn::Bool = fmu.executionConfig.loggingOn
if the FMU should log and display function calls (default=false
)externalCallbacks::Bool = fmu.executionConfig.externalCallbacks
if an external shared library should be used for the fmi2CallbackFunctions, this may improve readability of logging messages (default=false
)logStatusOK::Bool=true
whether to log status of kindfmi2OK
(default=true
)logStatusWarning::Bool=true
whether to log status of kindfmi2Warning
(default=true
)logStatusDiscard::Bool=true
whether to log status of kindfmi2Discard
(default=true
)logStatusError::Bool=true
whether to log status of kindfmi2Error
(default=true
)logStatusFatal::Bool=true
whether to log status of kindfmi2Fatal
(default=true
)logStatusPending::Bool=true
whether to log status of kindfmi2Pending
(default=true
)
Returns
- Returns the instance of a new FMU component.
Source
- FMISpec2.0.2 Link: https://fmi-standard.org/
- FMISpec2.0.2: 2.2.7 Definition of Model Variables (ModelVariables)
See also fmi2Instantiate
.
FMIImport.fmi2LoadModelDescription
— Methodfmi2LoadModelDescription(pathToModelDescription::String)
Extract the FMU variables and meta data from the ModelDescription
Arguments
pathToModelDescription::String
: Contains the path to a file name that is selected to be read and converted to an XML document. In order to better extract the variables and meta data in the further process.
Returns
md::fmi2ModelDescription
: Retuns a struct which provides the static information of ModelVariables.
FMIImport.fmi2NewDiscreteStates
— Methodfmi2NewDiscreteStates(c::FMU2Component)
Returns the next discrete states
Arguments
c::FMU2Component
: Mutable struct represents an instantiated instance of an FMU in the FMI 2.0.2 Standard.
Returns
eventInfo::fmi2EventInfo*
: Strut withfmi2Boolean
Variables
More detailed:
newDiscreteStatesNeeded::fmi2Boolean
: IfnewDiscreteStatesNeeded = fmi2True
the FMU should stay in Event Mode, and the FMU requires to set new inputs to the FMU to compute and get the outputs and to call
fmi2NewDiscreteStates again. If all FMUs return newDiscreteStatesNeeded = fmi2False
call fmi2EnterContinuousTimeMode.
terminateSimulation::fmi2Boolean
: IfterminateSimulation = fmi2True
callfmi2Terminate
nominalsOfContinuousStatesChanged::fmi2Boolean
: IfnominalsOfContinuousStatesChanged = fmi2True
then the nominal values of the states have changed due to the function call and can be inquired withfmi2GetNominalsOfContinuousStates
.valuesOfContinuousStatesChanged::fmi2Boolean
: IfvaluesOfContinuousStatesChanged = fmi2True
, then at least one element of the continuous state vector has changed its value due to the function call. The new values of the states can be retrieved withfmi2GetContinuousStates
. If no element of the continuous state vector has changed its value,valuesOfContinuousStatesChanged
must return fmi2False.nextEventTimeDefined::fmi2Boolean
: IfnextEventTimeDefined = fmi2True
, then the simulation shall integrate at most untiltime = nextEventTime
, and shall callfmi2EnterEventMode
at this time instant. If integration is stopped before nextEventTime, the definition ofnextEventTime
becomes obsolete.nextEventTime::fmi2Real
: next event ifnextEventTimeDefined=fmi2True
Source
- FMISpec2.0.2 Link: https://fmi-standard.org/
- FMISpec2.0.2[p.16]: 2.1.2 Platform Dependent Definitions (fmi2TypesPlatform.h)
- FMISpec2.0.2[p.16]: 2.1.3 Status Returned by Functions
- FMISpec2.0.2[p.83]: 3.2.2 Evaluation of Model Equations
See also fmi2NewDiscreteStates
.
FMIImport.fmi2SerializeFMUstate
— Methodfmi2SerializeFMUstate(c::FMU2Component, state::fmi2FMUstate)
Serializes the data referenced by the pointer FMUstate and copies this data into the byte vector serializedState of length size to be provided by the environment.
Arguments
str::fmi2Struct
: Representative for an FMU in the FMI 2.0.2 Standard.
More detailed: fmi2Struct = Union{FMU2, FMU2Component}
str::FMU2
: Mutable struct representing a FMU and all it instantiated instances in the FMI 2.0.2 Standard.str::FMU2Component
: Mutable struct represents an instantiated instance of an FMU in the FMI 2.0.2 Standard.state::fmi2FMUstate
: Argumentstate
is a pointer to a data structure in the FMU that saves the internal FMU state of the actual or a previous time instant.
Returns
serializedState:: Array{fmi2Byte}
: ReturnserializedState
contains the copy of the serialized data referenced by the pointer FMUstate
Source
- FMISpec2.0.2 Link: https://fmi-standard.org/
- FMISpec2.0.2[p.16]: 2.1.2 Platform Dependent Definitions (fmi2TypesPlatform.h)
- FMISpec2.0.2[p.16]: 2.1.3 Status Returned by Functions
- FMISpec2.0.2[p.25]: 2.1.8 Getting and Setting the Complete FMU State
See also fmi2SerializeFMUstate
.
FMIImport.fmi2SerializedFMUstateSize
— Methodfmi2SerializedFMUstateSize(c::FMU2Component, state::fmi2FMUstate)
Returns the size of the byte vector in which the FMUstate can be stored.
Arguments
c::FMU2Component
: Mutable struct represents an instantiated instance of an FMU in the FMI 2.0.2 Standard.state::fmi2FMUstate
: Argumentstate
is a pointer to a data structure in the FMU that saves the internal FMU state of the actual or a previous time instant.
Returns
- Return
size
is an object that safely references a value of typeCsize_t
.
Source
- FMISpec2.0.2 Link: https://fmi-standard.org/
- FMISpec2.0.2[p.16]: 2.1.2 Platform Dependent Definitions (fmi2TypesPlatform.h)
- FMISpec2.0.2[p.16]: 2.1.3 Status Returned by Functions
- FMISpec2.0.2[p.25]: 2.1.8 Getting and Setting the Complete FMU State
See also fmi2SerializedFMUstateSize
.
FMIImport.fmi3CallbackClockUpdate
— Methodfmi3CallbackLogger(_instanceEnvironment::Ptr{FMU3InstanceEnvironment},
_status::Cuint,
_category::Ptr{Cchar},
_message::Ptr{Cchar})
A model partition of a Scheduled Execution FMU calls fmi3CallbackClockUpdate
to signal that a triggered output Clock ticked or a new interval for a countdown Clock is available. fmi3CallbackClockUpdate
switches the FMU itself then into the Clock Update Mode (see 5.2.3.). The callback may be called from several model partitions.
Arguments
_instanceEnvironment::Ptr{FMU3InstanceEnvironment}
: is the instance name of the model that calls this function.
Returns
- nothing
Source
- FMISpec3.0 Link: https://fmi-standard.org/
- FMISpec3.0, Version D5ef1c1: 5.2.2. State: Clock Activation Mode
FMIImport.fmi3CallbackIntermediateUpdate
— Methodfmi3CallbackIntermediateUpdate(instanceEnvironment::Ptr{Cvoid},
intermediateUpdateTime::fmi3Float64,
intermediateVariableSetRequested::fmi3Boolean,
intermediateVariableGetAllowed::fmi3Boolean,
intermediateStepFinished::fmi3Boolean,
canReturnEarly::fmi3Boolean,
earlyReturnRequested::Ptr{fmi3Boolean},
earlyReturnTime::Ptr{fmi3Float64})
When a Co-Simulation FMU provides values for its output variables at intermediate points between two consecutive communication points, and is able to receive new values for input variables at these intermediate points, the Intermediate Update Callback function is called. This is typically required when the FMU uses a numerical solver to integrate the FMU's internal state between communication points in fmi3DoStep
. The callback function switches the FMU from Step Mode (see 4.2.1.) in the Intermediate Update Mode (see 4.2.2.) and returns to Step Mode afterwards. If the ModelDescription has the "providesIntermediateUpdate" flag, the Intermediate update callback function is called. That flag is ignored in ModelExchange and ScheduledExecution.
Arguments
instanceEnvironment::Ptr{FMU3InstanceEnvironment}
: is the instance name of the model that calls this function.intermediateUpdateTime::fmi3Float64
: is the internal value of the independent variable [typically simulation time] of the FMU at which the callback has been called for intermediate and final steps. If an event happens or an output Clock ticks, intermediateUpdateTime is the time of event or output Clock tick. In Co-Simulation, intermediateUpdateTime is restricted by the arguments to fmi3DoStep as follows: currentCommunicationPoint ≤ intermediateUpdateTime ≤ (currentCommunicationPoint + communicationStepSize). The FMU must not call the callback function fmi3CallbackIntermediateUpdate with an intermediateUpdateTime that is smaller than the intermediateUpdateTime given in a previous call of fmi3CallbackIntermediateUpdate with intermediateStepFinished == fmi3True.intermediateVariableSetRequested::fmi3Boolean
: IfintermediateVariableSetRequested == fmi3True
, the co-simulation algorithm may provide intermediate values for continuous input variables withintermediateUpdate = true
by calling fmi3Set{VariableType}. The set of variables for which the co-simulation algorithm will provide intermediate values is declared through the requiredIntermediateVariables argument tofmi3InstantiateXXX
. If a co-simulation algorithm does not provide a new value for any of the variables contained in the set it registered, the last value set remains.intermediateVariableGetAllowed::fmi3Boolean
: IfintermediateVariableGetAllowed == fmi3True
, the co-simulation algorithm may collect intermediate output variables by calling fmi3Get{VariableType} for variables withintermediateUpdate = true
. The set of variables for which the co-simulation algorithm can get values is supplied through the requiredIntermediateVariables argument tofmi3InstantiateXXX
.intermediateStepFinished::fmi3Boolean
: IfintermediateStepFinished == fmi3False
, the intermediate outputs of the FMU that the co-simulation algorithm inquires with fmi3Get{VariableType} resulting from tentative internal solver states and may still change for the same intermediateUpdateTime [e.g., if the solver deems the tentative state to cause a too high approximation error, it may go back in time and try to re-estimate the state using smaller internal time steps]. IfintermediateStepFinished == fmi3True
, intermediate outputs inquired by the co-simulation algorithm with fmi3Get{VariableType} correspond to accepted internal solver step.canReturnEarly::fmi3Boolean
: WhencanReturnEarly == fmi3True
the FMU signals to the co-simulation algorithm its ability to return early from the currentfmi3DoStep
.earlyReturnRequested::Ptr{fmi3Boolean}
: If and only ifcanReturnEarly == fmi3True
, the co-simulation algorithm may request the FMU to return early fromfmi3DoStep
by settingearlyReturnRequested == fmi3True
.earlyReturnTime::Ptr{fmi3Float64}
: is used to signal the FMU at which time to return early from the currentfmi3DoStep
, if the return value ofearlyReturnRequested == fmi3True
. If the earlyReturnTime is greater than the last signaled intermediateUpdateTime, the FMU may integrate up to the time instant earlyReturnTime.
Returns
- nothing
Source
- FMISpec3.0 Link: https://fmi-standard.org/
- FMISpec3.0: 4.2.2. State: Intermediate Update Mode
FMIImport.fmi3CallbackLogger
— Methodfmi3CallbackLogger(_instanceEnvironment::Ptr{FMU3InstanceEnvironment},
_status::Cuint,
_category::Ptr{Cchar},
_message::Ptr{Cchar})
Function that is called in the FMU, usually if an fmi3XXX function, does not behave as desired. If “logger” is called with “status = fmi3OK”, then the message is a pure information message.
Arguments
_instanceEnvironment::Ptr{FMU3InstanceEnvironment}
: is the instance name of the model that calls this function._status::Cuint
: status of the message_category::Ptr{Cchar}
: is the category of the message. The meaning of “category” is defined by the modeling environment that generated the FMU. Depending on this modeling environment, none, some or all allowed values of “category” for this FMU are defined in the modelDescription.xml file via element “<fmiModelDescription><LogCategories>”, see section 2.4.5. Only messages are provided by function logger that have a category according to a call tofmi3SetDebugLogging
(see below)._message::Ptr{Cchar}
: is provided in the same way and with the same format control as in function “printf” from the C standard library. [Typically, this function prints the message and stores it optionally in a log file.]
Returns
- nothing
Source
- FMISpec3.0 Link: https://fmi-standard.org/
- FMISpec3.0: 2.3.1. Super State: FMU State Setable
FMIImport.fmi3CompletedIntegratorStep
— Methodfmi3CompletedIntegratorStep!(c::FMU3Instance, noSetFMUStatePriorToCurrentPoint::fmi3Boolean)
This function must be called by the environment after every completed step
Arguments
c::FMU3Instance
: Mutable struct represents an instantiated instance of an FMU in the FMI 3.0 Standard.noSetFMUStatePriorToCurrentPoint::fmi3Boolean
: ArgumentnoSetFMUStatePriorToCurrentPoint = fmi3True
iffmi3SetFMUState
will no longer be called for time instants prior to current time in this simulation run.
Returns
status::fmi3Status
: Returnstatus
is an enumeration of typefmi3Status
and indicates the success of the function call.
More detailed:
fmi3OK
: all wellfmi3Warning
: things are not quite right, but the computation can continuefmi3Discard
: if the slave computed successfully only a subinterval of the communication stepfmi3Error
: the communication step could not be carried out at allfmi3Fatal
: if an error occurred which corrupted the FMU irreparablyenterEventMode::Array{fmi3Boolean, 1}
: ReturnsenterEventMode[1]
to signal to the environment if the FMU shall callfmi2EnterEventMode
terminateSimulation::Array{fmi3Boolean, 1}
: ReturnsterminateSimulation[1]
to signal if the simulation shall be terminated.
Source
- FMISpec3.0 Link: https://fmi-standard.org/
- FMISpec3.0: 2.2.3 Platform Dependent Definitions
- FMISpec3.0: 2.2.4 Status Returned by Functions
- FMISpec3.0: 3.2.1. State: Continuous-Time Mode
See also fmi3CompletedIntegratorStep
.
FMIImport.fmi3DeSerializeFMUState
— Methodfmi3SerializeFMUState(c::FMU3Instance, state::fmi3FMUState)
Serializes the data referenced by the pointer FMUstate and copies this data into the byte vector serializedState of length size to be provided by the environment.
Arguments
c::FMU3Instance
: Mutable struct represents an instantiated instance of an FMU in the FMI 3.0 Standard.serializedState::Array{fmi3Byte}
: ArgumentserializedState
contains the fmi3Byte field to be deserialized.
Returns
- Return
state
is a pointer to a copy of the internal FMU state.
Source
- FMISpec3.0 Link: https://fmi-standard.org/
- FMISpec3.0: 2.2.3 Platform Dependent Definitions
- FMISpec3.0: 2.2.6.4. Getting and Setting the Complete FMU State
See also fmi3DeSerializeFMUState
.
FMIImport.fmi3FreeInstance!
— Methodfmi3FreeInstance!(c::FMU3Instance; popInstance::Bool = true)
Disposes the given instance, unloads the loaded model, and frees all the allocated memory and other resources that have been allocated by the functions of the FMU interface. If a null pointer is provided for “c”, the function call is ignored (does not have an effect).
Removes the component from the FMUs component list.
Arguments
c::FMU3Instance
: Argumentc
is a Mutable struct represents an instantiated instance of an FMU in the FMI 3.0 Standard.
Keywords
popInstance::Bool=true
: If the KeywordpopInstance = true
the freed instance is deleted
Returns
- nothing
Source
- FMISpec3.0 Link: https://fmi-standard.org/
- FMISpec3.0, Version D5ef1c1: 2.3.1. Super State: FMU State Setable
FMIImport.fmi3GetAdjointDerivative
— Methodfmi3GetAdjointDerivative(c::FMU3Instance,
unknowns::AbstractArray{fmi3ValueReference},
knowns::AbstractArray{fmi3ValueReference},
seed::AbstractArray{fmi3Float64})
Wrapper Function call to compute the partial derivative with respect to the variables unknowns
.
Computes the adjoint derivatives of an FMU. An FMU has different Modes and in every Mode an FMU might be described by different equations and different unknowns. The precise definitions are given in the mathematical descriptions of Model Exchange (section 3) and Co-Simulation (section 4). In every Mode, the general form of the FMU equations are: unknowns = 𝐡(knowns, rest)
unknowns
: vector of unknown Real variables computed in the actual Mode:- Initialization Mode: unkowns kisted under
<ModelStructure><InitialUnknown>
that have type Real. - Continuous-Time Mode (ModelExchange): The continuous-time outputs and state derivatives. (= the variables listed under
<ModelStructure><Output>
with type Real and variability =continuous
and the variables listed as state derivatives under<ModelStructure><ContinuousStateDerivative>)
. - Event Mode (ModelExchange/CoSimulation): The same variables as in the Continuous-Time Mode and additionally variables under
<ModelStructure><Output>
with type Real and variability =discrete
. - Step Mode (CoSimulation): The variables listed under
<ModelStructure><Output>
with type Real and variability =continuous
ordiscrete
. If<ModelStructure><ContinuousStateDerivative>
is present, also the variables listed here as state derivatives.
- Initialization Mode: unkowns kisted under
knowns
: Real input variables of function h that changes its value in the actual Mode.rest
: Set of input variables of function h that either changes its value in the actual Mode but are non-Real variables, or do not change their values in this Mode, but change their values in other Modes
Computes a linear combination of the partial derivatives of h with respect to the selected input variables 𝐯_known:
Δunknowns = (δh / δknowns) Δknowns
Arguments
c::FMU3Instance
Mutable struct represents an instantiated instance of an FMU in the FMI 3.0 Standard.unknowns::AbstracArray{fmi3ValueReference}
: Argumentunknowns
contains values of typefmi3ValueReference
which are identifiers of a variable value of the model.unknowns
can be equated withunknowns
(variable described above).knowns::AbstractArray{fmi3ValueReference}
: Argumentknowns
contains values of typefmi3ValueReference
which are identifiers of a variable value of the model.knowns
can be equated withknowns
(variable described above).seed::AbstractArray{fmi3Float64}
:The vector values Compute the partial derivative with respect to the given entries in vectorknowns
with the matching evaluate ofsensitivity
.
Returns
sensitivity::Array{fmi3Float64}
: Returnsensitivity
contains the directional derivative vector values.
Source
- FMISpec3.0 Link: https://fmi-standard.org/
- FMISpec3.0: 2.2.3 Platform Dependent Definitions
- FMISpec3.0: 2.2.11. Getting Partial Derivatives
See also fmi3GetAdjointDerivative
.
FMIImport.fmi3GetBinary
— Methodfmi3GetBinary(c::FMU3Instance, vr::fmi3ValueReferenceFormat)
Get the values of an array of fmi3Binary variables.
Arguments
c::FMU3Instance
: Mutable struct represents an instantiated instance of an FMU in the FMI 3.0 Standard.vr::fmi3ValueReferenceFormat
: wildcards for how a user can pass a fmi[X]ValueReference
More detailed: fmi3ValueReferenceFormat = Union{Nothing, String, Array{String,1}, fmi3ValueReference, Array{fmi3ValueReference,1}, Int64, Array{Int64,1}, Symbol}
Returns
values::Array{fmi3Binary}
: returns values of an array of fmi3Binary variables with the dimension of fmi3ValueReferenceFormat length.
Source
- FMISpec3.0 Link: https://fmi-standard.org/
- FMISpec3.0: 2.2.4 Status Returned by Functions
- FMISpec3.0: 2.2.6.2. Getting and Setting Variable Values
See also fmi3GetBinary
.
FMIImport.fmi3GetBoolean
— Methodfmi3GetBoolean(c::FMU3Instance, vr::fmi3ValueReferenceFormat)
Get the values of an array of fmi3Boolean variables.
Arguments
c::FMU3Instance
: Mutable struct represents an instantiated instance of an FMU in the FMI 3.0 Standard.vr::fmi3ValueReferenceFormat
: wildcards for how a user can pass a fmi[X]ValueReference
More detailed: fmi3ValueReferenceFormat = Union{Nothing, String, Array{String,1}, fmi3ValueReference, Array{fmi3ValueReference,1}, Int64, Array{Int64,1}, Symbol}
Returns
values::Array{fmi3Boolean}
: returns values of an array of fmi3Boolean variables with the dimension of fmi3ValueReferenceFormat length.
Source
- FMISpec3.0 Link: https://fmi-standard.org/
- FMISpec3.0: 2.2.4 Status Returned by Functions
- FMISpec3.0: 2.2.6.2. Getting and Setting Variable Values
See also fmi3GetBoolean
.
FMIImport.fmi3GetClock
— Methodfmi3GetClock(c::FMU3Instance, vr::fmi3ValueReferenceFormat)
Get the values of an array of fmi3Clock variables.
Arguments
c::FMU3Instance
: Mutable struct represents an instantiated instance of an FMU in the FMI 3.0 Standard.vr::fmi3ValueReferenceFormat
: wildcards for how a user can pass a fmi[X]ValueReference
More detailed: fmi3ValueReferenceFormat = Union{Nothing, String, Array{String,1}, fmi3ValueReference, Array{fmi3ValueReference,1}, Int64, Array{Int64,1}, Symbol}
Returns
values::Array{fmi3Clock}
: returns values of an array of fmi3Clock variables with the dimension of fmi3ValueReferenceFormat length.
Source
- FMISpec3.0 Link: https://fmi-standard.org/
- FMISpec3.0: 2.2.4 Status Returned by Functions
- FMISpec3.0: 2.2.6.2. Getting and Setting Variable Values
See also fmi3GetClock
.
FMIImport.fmi3GetContinuousStateDerivatives
— Methodfmi3GetContinuousStateDerivatives(c::FMU3Instance)
Compute state derivatives at the current time instant and for the current states.
Arguments
c::FMU3Instance
: Mutable struct represents an instantiated instance of an FMU in the FMI 3.0 Standard.
Returns
derivatives::Array{fmi3Float64}
: Returns an array offmi3Float64
values representing thederivatives
for the current states. The ordering of the elements of the derivatives vector is identical to the ordering of the state
vector.
Source
- FMISpec3.0 Link: https://fmi-standard.org/
- FMISpec3.0: 2.2.3 Platform Dependent Definitions
- FMISpec3.0: 3.2.1. State: Continuous-Time Mode
See also fmi3GetContinuousStateDerivatives
.
FMIImport.fmi3GetContinuousStates
— Methodfmi3GetContinuousStates(c::FMU3Instance)
Return the new (continuous) state vector x
Arguments
c::FMU3Instance
: Mutable struct represents an instantiated instance of an FMU in the FMI 2.0.2 Standard.
Returns
x::Array{fmi3Float64}
: Returns an array offmi3Float64
values representing the new continuous state vectorx
.
Source
- FMISpec3.0 Link: https://fmi-standard.org/
- FMISpec3.0: 2.2.3 Platform Dependent Definitions
- FMISpec3.0: 2.3.3. State: Initialization Mode
See also fmi3GetContinuousStates
.
FMIImport.fmi3GetDirectionalDerivative
— Methodfmi3GetDirectionalDerivative(c::FMU3Instance,
unknowns::AbstractArray{fmi3ValueReference},
knowns::AbstractArray{fmi3ValueReference},
seed::AbstractArray{fmi3Float64})
Wrapper Function call to compute the partial derivative with respect to the variables unknowns
.
Computes the directional derivatives of an FMU. An FMU has different Modes and in every Mode an FMU might be described by different equations and different unknowns. The precise definitions are given in the mathematical descriptions of Model Exchange (section 3) and Co-Simulation (section 4). In every Mode, the general form of the FMU equations are: unknowns = 𝐡(knowns, rest)
unknowns
: vector of unknown Real variables computed in the actual Mode:- Initialization Mode: unkowns kisted under
<ModelStructure><InitialUnknown>
that have type Real. - Continuous-Time Mode (ModelExchange): The continuous-time outputs and state derivatives. (= the variables listed under
<ModelStructure><Output>
with type Real and variability =continuous
and the variables listed as state derivatives under<ModelStructure><ContinuousStateDerivative>)
. - Event Mode (ModelExchange/CoSimulation): The same variables as in the Continuous-Time Mode and additionally variables under
<ModelStructure><Output>
with type Real and variability =discrete
. - Step Mode (CoSimulation): The variables listed under
<ModelStructure><Output>
with type Real and variability =continuous
ordiscrete
. If<ModelStructure><ContinuousStateDerivative>
is present, also the variables listed here as state derivatives.
- Initialization Mode: unkowns kisted under
knowns
: Real input variables of function h that changes its value in the actual Mode.rest
: Set of input variables of function h that either changes its value in the actual Mode but are non-Real variables, or do not change their values in this Mode, but change their values in other Modes
Computes a linear combination of the partial derivatives of h with respect to the selected input variables 𝐯_known:
Δunknowns = (δh / δknowns) Δknowns
Arguments
c::FMU3Instance
Mutable struct represents an instantiated instance of an FMU in the FMI 3.0 Standard.unknowns::AbstracArray{fmi3ValueReference}
: Argumentunknowns
contains values of typefmi3ValueReference
which are identifiers of a variable value of the model.unknowns
can be equated withunknowns
(variable described above).knowns::AbstractArray{fmi3ValueReference}
: Argumentknowns
contains values of typefmi3ValueReference
which are identifiers of a variable value of the model.knowns
can be equated withknowns
(variable described above).seed::AbstractArray{fmi3Float64}
:The vector values Compute the partial derivative with respect to the given entries in vectorknowns
with the matching evaluate ofsensitivity
.
Returns
sensitivity::Array{fmi3Float64}
: Returnsensitivity
contains the directional derivative vector values.
Source
- FMISpec3.0 Link: https://fmi-standard.org/
- FMISpec3.0: 2.2.3 Platform Dependent Definitions
- FMISpec3.0: 2.2.11. Getting Partial Derivatives
See also fmi3GetDirectionalDerivative
.
FMIImport.fmi3GetEventIndicators
— Methodfmi3GetEventIndicators(c::FMU3Instance)
Returns the event indicators of the FMU
Arguments
c::FMU3Instance
: Mutable struct represents an instantiated instance of an FMU in the FMI 3.0 Standard.
Returns
eventIndicators::Array{fmi3Float64}
:The event indicators are returned as a vector represented by an array of "fmi3Float64" values.
Source
- FMISpec3.0 Link: https://fmi-standard.org/
- FMISpec3.0: 2.2.3 Platform Dependent Definitions
- FMISpec3.0: 3.2.1. State: Continuous-Time Mode
See also fmi3GetEventIndicators
.
FMIImport.fmi3GetFMUState
— Methodfmi3GetFMUState(c::FMU3Instance)
Makes a copy of the internal FMU state and returns a pointer to this copy.
Arguments
c::FMU3Instance
: Mutable struct represents an instantiated instance of an FMU in the FMI 3.0 Standard.
Returns
- Return
state
is a pointer to a copy of the internal FMU state.
Source
- FMISpec3.0 Link: https://fmi-standard.org/
- FMISpec3.0: 2.2.3 Platform Dependent Definitions
- FMISpec3.0: 2.2.6.4. Getting and Setting the Complete FMU State
See also fmi3GetFMUState
.
FMIImport.fmi3GetFloat32
— Methodfmi3GetFloat32(c::FMU3Instance, vr::fmi3ValueReferenceFormat)
Get the values of an array of fmi3Float32 variables.
Arguments
c::FMU3Instance
: Mutable struct represents an instantiated instance of an FMU in the FMI 3.0 Standard.vr::fmi3ValueReferenceFormat
: wildcards for how a user can pass a fmi[X]ValueReference
More detailed: fmi3ValueReferenceFormat = Union{Nothing, String, Array{String,1}, fmi3ValueReference, Array{fmi3ValueReference,1}, Int64, Array{Int64,1}, Symbol}
Returns
values::Array{fmi3Float32}
: returns values of an array of fmi3Float32 variables with the dimension of fmi3ValueReferenceFormat length.
Source
- FMISpec3.0 Link: https://fmi-standard.org/
- FMISpec3.0: 2.2.4 Status Returned by Functions
- FMISpec3.0: 2.2.6.2. Getting and Setting Variable Values
See also fmi3GetFloat32
.
FMIImport.fmi3GetFloat64
— Methodfmi3GetFloat64(c::FMU3Instance, vr::fmi3ValueReferenceFormat)
Get the values of an array of fmi3Float64 variables.
Arguments
c::FMU3Instance
: Mutable struct represents an instantiated instance of an FMU in the FMI 3.0 Standard.vr::fmi3ValueReferenceFormat
: wildcards for how a user can pass a fmi[X]ValueReference
More detailed: fmi3ValueReferenceFormat = Union{Nothing, String, Array{String,1}, fmi3ValueReference, Array{fmi3ValueReference,1}, Int64, Array{Int64,1}, Symbol}
Returns
values::Array{fmi3Float64}
: returns values of an array of fmi3Float64 variables with the dimension of fmi3ValueReferenceFormat length.
Source
- FMISpec3.0 Link: https://fmi-standard.org/
- FMISpec3.0: 2.2.4 Status Returned by Functions
- FMISpec3.0: 2.2.6.2. Getting and Setting Variable Values
See also fmi3GetFloat64
.
FMIImport.fmi3GetInt16
— Methodfmi3GetInt16(c::FMU3Instance, vr::fmi3ValueReferenceFormat)
Get the values of an array of fmi3Int16 variables.
Arguments
c::FMU3Instance
: Mutable struct represents an instantiated instance of an FMU in the FMI 3.0 Standard.vr::fmi3ValueReferenceFormat
: wildcards for how a user can pass a fmi[X]ValueReference
More detailed: fmi3ValueReferenceFormat = Union{Nothing, String, Array{String,1}, fmi3ValueReference, Array{fmi3ValueReference,1}, Int64, Array{Int64,1}, Symbol}
Returns
values::Array{fmi3Int16}
: returns values of an array of fmi3Int16 variables with the dimension of fmi3ValueReferenceFormat length.
Source
- FMISpec3.0 Link: https://fmi-standard.org/
- FMISpec3.0: 2.2.4 Status Returned by Functions
- FMISpec3.0: 2.2.6.2. Getting and Setting Variable Values
See also fmi3GetInt16
.
FMIImport.fmi3GetInt32
— Methodfmi3GetInt32(c::FMU3Instance, vr::fmi3ValueReferenceFormat)
Get the values of an array of fmi3Int32 variables.
Arguments
c::FMU3Instance
: Mutable struct represents an instantiated instance of an FMU in the FMI 3.0 Standard.vr::fmi3ValueReferenceFormat
: wildcards for how a user can pass a fmi[X]ValueReference
More detailed: fmi3ValueReferenceFormat = Union{Nothing, String, Array{String,1}, fmi3ValueReference, Array{fmi3ValueReference,1}, Int64, Array{Int64,1}, Symbol}
Returns
values::Array{fmi3Int32}
: returns values of an array of fmi3Int32 variables with the dimension of fmi3ValueReferenceFormat length.
Source
- FMISpec3.0 Link: https://fmi-standard.org/
- FMISpec3.0: 2.2.4 Status Returned by Functions
- FMISpec3.0: 2.2.6.2. Getting and Setting Variable Values
See also fmi3GetInt32
.
FMIImport.fmi3GetInt64
— Methodfmi3GetInt64(c::FMU3Instance, vr::fmi3ValueReferenceFormat)
Get the values of an array of fmi3Int64 variables.
Arguments
c::FMU3Instance
: Mutable struct represents an instantiated instance of an FMU in the FMI 3.0 Standard.vr::fmi3ValueReferenceFormat
: wildcards for how a user can pass a fmi[X]ValueReference
More detailed: fmi3ValueReferenceFormat = Union{Nothing, String, Array{String,1}, fmi3ValueReference, Array{fmi3ValueReference,1}, Int64, Array{Int64,1}, Symbol}
Returns
values::Array{fmi3Int64}
: returns values of an array of fmi3Int64 variables with the dimension of fmi3ValueReferenceFormat length.
Source
- FMISpec3.0 Link: https://fmi-standard.org/
- FMISpec3.0: 2.2.4 Status Returned by Functions
- FMISpec3.0: 2.2.6.2. Getting and Setting Variable Values
See also fmi3GetInt64
.
FMIImport.fmi3GetInt8
— Methodfmi3GetInt8(c::FMU3Instance, vr::fmi3ValueReferenceFormat)
Get the values of an array of fmi3Int8 variables.
Arguments
c::FMU3Instance
: Mutable struct represents an instantiated instance of an FMU in the FMI 3.0 Standard.vr::fmi3ValueReferenceFormat
: wildcards for how a user can pass a fmi[X]ValueReference
More detailed: fmi3ValueReferenceFormat = Union{Nothing, String, Array{String,1}, fmi3ValueReference, Array{fmi3ValueReference,1}, Int64, Array{Int64,1}, Symbol}
Returns
values::Array{fmi3Int8}
: returns values of an array of fmi3Int8 variables with the dimension of fmi3ValueReferenceFormat length.
Source
- FMISpec3.0 Link: https://fmi-standard.org/
- FMISpec3.0: 2.2.4 Status Returned by Functions
- FMISpec3.0: 2.2.6.2. Getting and Setting Variable Values
See also fmi3GetInt8
.
FMIImport.fmi3GetNominalsOfContinuousStates
— Methodfmi3GetNominalsOfContinuousStates(c::FMU3Instance)
Return the nominal values of the continuous states.
Arguments
c::FMU3Instance
: Mutable struct represents an instantiated instance of an FMU in the FMI 2.0.2 Standard.
Returns
x::Array{fmi3Float64}
: Returns an array offmi3Float64
values representing the new nominals of continuous state vectorx
.
Source
- FMISpec3.0 Link: https://fmi-standard.org/
- FMISpec3.0: 2.2.3 Platform Dependent Definitions
- FMISpec3.0: 2.3.3. State: Initialization Mode
See also fmi3GetNominalsOfContinuousStates
.
FMIImport.fmi3GetNumberOfContinuousStates
— Methodfmi3GetNumberOfContinuousStates(c::FMU3Instance)
This function returns the number of continuous states. This function can only be called in Model Exchange.
fmi3GetNumberOfContinuousStates
must be called after a structural parameter is changed. As long as no structural parameters changed, the number of states is given in the modelDescription.xml, alleviating the need to call this function.
Arguments
c::FMU3Instance
: Mutable struct represents an instantiated instance of an FMU in the FMI 3.0 Standard.
Returns
size::Integer
: Returnsize
is the number of continuous states of this instance
Source
- FMISpec3.0 Link: https://fmi-standard.org/
- FMISpec3.0: 2.2.3 Platform Dependent Definitions
- FMISpec3.0: 2.3.2. State: Instantiated
See also fmi3GetNumberOfContinuousStates
.
FMIImport.fmi3GetNumberOfEventIndicators
— Methodfmi3GetNumberOfEventIndicators(c::FMU3Instance)
This function returns the number of event indicators. This function can only be called in Model Exchange.
fmi3GetNumberOfEventIndicators
must be called after a structural parameter is changed. As long as no structural parameters changed, the number of states is given in the modelDescription.xml, alleviating the need to call this function.
Arguments
c::FMU3Instance
: Mutable struct represents an instantiated instance of an FMU in the FMI 3.0 Standard.
Returns
size::Integer
: Returnsize
is the number of event indicators of this instance
Source
- FMISpec3.0 Link: https://fmi-standard.org/
- FMISpec3.0: 2.2.3 Platform Dependent Definitions
- FMISpec3.0: 2.3.2. State: Instantiated
See also fmi3GetNumberOfEventIndicators
.
FMIImport.fmi3GetNumberOfVariableDependencies
— Methodfmi3GetNumberOfVariableDependencies(c::FMU3Instance, vr::fmi3ValueReference, nvr::Ref{Csize_t})
The number of dependencies of a given variable, which may change if structural parameters are changed, can be retrieved by calling fmi3GetNumberOfVariableDependencies.
This information can only be retrieved if the 'providesPerElementDependencies' tag in the ModelDescription is set.
Arguments
c::FMU3Instance
: Argumentc
is a Mutable struct represents an instantiated instance of an FMU in the FMI 3.0 Standard.vr::Union{fmi3ValueReference, String}
: Argumentvr
is the value handel called "ValueReference" that define the variable that shall be inquired.
Returns
size::Integer
: Returnsize
is the number of variable dependencies for the given variable
Source
- FMISpec3.0 Link: https://fmi-standard.org/
- FMISpec3.0: 2.2.3 Platform Dependent Definitions
- FMISpec3.0: 2.2.10. Dependencies of Variables
See also fmi3GetNumberOfVariableDependencies
.
FMIImport.fmi3GetOutputDerivatives
— Methodfmi3GetOutputDerivatives!(c::FMU3Instance, vr::AbstractArray{fmi3ValueReference}, nValueReferences::Csizet, order::AbstractArray{fmi3Int32}, values::AbstractArray{fmi3Float64}, nValues::Csizet)
Retrieves the n-th derivative of output values.
Arguments
c::FMU3Instance
: Mutable struct represents an instantiated instance of an FMU in the FMI 3.0 Standard.vr::Array{fmi3ValueReference}
: Argumentvr
is an array ofnValueReferences
value handels called "ValueReference" that t define the variables whose derivatives shall be set.order::Array{fmi3Int32}
: Argumentorder
is an array of fmi3Int32 values witch specifys the corresponding order of derivative of the real input variable.
Returns
value::AbstactArray{fmi3Float64}
: Returnvalue
is an array which represents a vector with the values of the derivatives.
Source
- FMISpec3.0 Link: https://fmi-standard.org/
- FMISpec3.0: 2.2.3 Platform Dependent Definitions
- FMISpec3.0: 2.2.12. Getting Derivatives of Continuous Outputs
See also fmi3GetOutputDerivatives
.
FMIImport.fmi3GetString
— Methodfmi3GetString(c::FMU3Instance, vr::fmi3ValueReferenceFormat)
Get the values of an array of fmi3String variables.
Arguments
c::FMU3Instance
: Mutable struct represents an instantiated instance of an FMU in the FMI 3.0 Standard.vr::fmi3ValueReferenceFormat
: wildcards for how a user can pass a fmi[X]ValueReference
More detailed: fmi3ValueReferenceFormat = Union{Nothing, String, Array{String,1}, fmi3ValueReference, Array{fmi3ValueReference,1}, Int64, Array{Int64,1}, Symbol}
Returns
values::Array{fmi3String}
: returns values of an array of fmi3String variables with the dimension of fmi3ValueReferenceFormat length.
Source
- FMISpec3.0 Link: https://fmi-standard.org/
- FMISpec3.0: 2.2.4 Status Returned by Functions
- FMISpec3.0: 2.2.6.2. Getting and Setting Variable Values
See also fmi3GetString
.
FMIImport.fmi3GetUInt16
— Methodfmi3GetUInt16(c::FMU3Instance, vr::fmi3ValueReferenceFormat)
Get the values of an array of fmi3UInt16 variables.
Arguments
c::FMU3Instance
: Mutable struct represents an instantiated instance of an FMU in the FMI 3.0 Standard.vr::fmi3ValueReferenceFormat
: wildcards for how a user can pass a fmi[X]ValueReference
More detailed: fmi3ValueReferenceFormat = Union{Nothing, String, Array{String,1}, fmi3ValueReference, Array{fmi3ValueReference,1}, Int64, Array{Int64,1}, Symbol}
Returns
values::Array{fmi3UInt16}
: returns values of an array of fmi3UInt16 variables with the dimension of fmi3ValueReferenceFormat length.
Source
- FMISpec3.0 Link: https://fmi-standard.org/
- FMISpec3.0: 2.2.4 Status Returned by Functions
- FMISpec3.0: 2.2.6.2. Getting and Setting Variable Values
See also fmi3GetUInt16
.
FMIImport.fmi3GetUInt32
— Methodfmi3GetUInt32(c::FMU3Instance, vr::fmi3ValueReferenceFormat)
Get the values of an array of fmi3UInt32 variables.
Arguments
c::FMU3Instance
: Mutable struct represents an instantiated instance of an FMU in the FMI 3.0 Standard.vr::fmi3ValueReferenceFormat
: wildcards for how a user can pass a fmi[X]ValueReference
More detailed: fmi3ValueReferenceFormat = Union{Nothing, String, Array{String,1}, fmi3ValueReference, Array{fmi3ValueReference,1}, Int64, Array{Int64,1}, Symbol}
Returns
values::Array{fmi3UInt32}
: returns values of an array of fmi3UInt32 variables with the dimension of fmi3ValueReferenceFormat length.
Source
- FMISpec3.0 Link: https://fmi-standard.org/
- FMISpec3.0: 2.2.4 Status Returned by Functions
- FMISpec3.0: 2.2.6.2. Getting and Setting Variable Values
See also fmi3GetUInt32
.
FMIImport.fmi3GetUInt64
— Methodfmi3GetUInt64(c::FMU3Instance, vr::fmi3ValueReferenceFormat)
Get the values of an array of fmi3UInt64 variables.
Arguments
c::FMU3Instance
: Mutable struct represents an instantiated instance of an FMU in the FMI 3.0 Standard.vr::fmi3ValueReferenceFormat
: wildcards for how a user can pass a fmi[X]ValueReference
More detailed: fmi3ValueReferenceFormat = Union{Nothing, String, Array{String,1}, fmi3ValueReference, Array{fmi3ValueReference,1}, Int64, Array{Int64,1}, Symbol}
Returns
values::Array{fmi3UInt64}
: returns values of an array of fmi3UInt64 variables with the dimension of fmi3ValueReferenceFormat length.
Source
- FMISpec3.0 Link: https://fmi-standard.org/
- FMISpec3.0: 2.2.4 Status Returned by Functions
- FMISpec3.0: 2.2.6.2. Getting and Setting Variable Values
See also fmi3GetUInt64
.
FMIImport.fmi3GetUInt8
— Methodfmi3GetUInt8(c::FMU3Instance, vr::fmi3ValueReferenceFormat)
Get the values of an array of fmi3UInt8 variables.
Arguments
c::FMU3Instance
: Mutable struct represents an instantiated instance of an FMU in the FMI 3.0 Standard.vr::fmi3ValueReferenceFormat
: wildcards for how a user can pass a fmi[X]ValueReference
More detailed: fmi3ValueReferenceFormat = Union{Nothing, String, Array{String,1}, fmi3ValueReference, Array{fmi3ValueReference,1}, Int64, Array{Int64,1}, Symbol}
Returns
values::Array{fmi3UInt8}
: returns values of an array of fmi3UInt8 variables with the dimension of fmi3ValueReferenceFormat length.
Source
- FMISpec3.0 Link: https://fmi-standard.org/
- FMISpec3.0: 2.2.4 Status Returned by Functions
- FMISpec3.0: 2.2.6.2. Getting and Setting Variable Values
See also fmi3GetUInt8
.
FMIImport.fmi3GetVariableDependencies
— Methodfmi3GetVariableDependencies(c::FMU3Instance, vr::Union{fmi3ValueReference, String})
The actual dependencies (of type dependenciesKind) can be retrieved by calling the function fmi3GetVariableDependencies:
Arguments
c::FMU3Instance
: Argumentc
is a Mutable struct represents an instantiated instance of an FMU in the FMI 3.0 Standard.vr::Union{fmi3ValueReference, String}
: Argumentvr
is the value handel called "ValueReference" that define the variable that shall be inquired.
Returns
elementIndicesOfDependent::AbstractArray{Csize_t}
: must point to a buffer of size_t values of sizenDependencies
allocated by the calling environment. It is filled in by this function with the element index of the dependent variable that dependency information is provided for. The element indices start with 1. Using the element index 0 means all elements of the variable. (Note: If an array has more than one dimension the indices are serialized in the same order as defined for values in Section 2.2.6.1.)independents::AbstractArray{fmi3ValueReference}
: must point to a buffer offmi3ValueReference
values of sizenDependencies
allocated by the calling environment. It is filled in by this function with the value reference of the independent variable that this dependency entry is dependent upon.elementIndicesIndependents::AbstractArray{Csize_t}
: must point to a buffer of size_tvalues
of sizenDependencies
allocated by the calling environment. It is filled in by this function with the element index of the independent variable that this dependency entry is dependent upon. The element indices start with 1. Using the element index 0 means all elements of the variable. (Note: If an array has more than one dimension the indices are serialized in the same order as defined for values in Section 2.2.6.1.)dependencyKinds::AbstractArray{fmi3DependencyKind}
: must point to a buffer of dependenciesKind values of sizenDependencies
allocated by the calling environment. It is filled in by this function with the enumeration value describing the dependency of this dependency entry.
Source
- FMISpec3.0 Link: https://fmi-standard.org/
- FMISpec3.0: 2.2.3 Platform Dependent Definitions
- FMISpec3.0: 2.2.4 Status Returned by Functions
- FMISpec3.0: 2.2.10. Dependencies of Variables
See also fmi3GetVariableDependencies!
.
FMIImport.fmi3InstantiateCoSimulation!
— Methodfmi3InstantiateCoSimulation!(fmu::FMU3; instanceName::String=fmu.modelName, type::fmi3Type=fmu.type, pushInstances::Bool = true, visible::Bool = false, loggingOn::Bool = fmu.executionConfig.loggingOn, externalCallbacks::Bool = fmu.executionConfig.externalCallbacks,
eventModeUsed::Bool = false, ptrIntermediateUpdate=nothing, logStatusOK::Bool=true, logStatusWarning::Bool=true, logStatusDiscard::Bool=true, logStatusError::Bool=true, logStatusFatal::Bool=true)
Create a new coSimulation instance of the given fmu, adds a logger if logginOn == true
.
Arguments
fmu::FMU3
: Mutable struct representing a FMU and all it instantiated instances in the FMI 3.0 Standard.
Keywords
instanceName::String=fmu.modelName
: Name of the instancetype::fmi3Type=fmu.type
: Defines whether a Co-Simulation or Model Exchange is presentpushInstances::Bool = true
: Defines if the fmu instances should be pushed in the application.visible::Bool = false
if the FMU should be started with graphic interface, if supported (default=false
)loggingOn::Bool = fmu.executionConfig.loggingOn
if the FMU should log and display function calls (default=false
)externalCallbacks::Bool = fmu.executionConfig.externalCallbacks
if an external shared library should be used for the fmi3CallbackFunctions, this may improve readability of logging messages (default=false
)eventModeUsed::Bool = false
: Defines if the FMU instance can use the event mode. (default=false
)ptrIntermediateUpdate=nothing
: Points to a function handling intermediate Updates (defalut=nothing
)logStatusOK::Bool=true
whether to log status of kindfmi3OK
(default=true
)logStatusWarning::Bool=true
whether to log status of kindfmi3Warning
(default=true
)logStatusDiscard::Bool=true
whether to log status of kindfmi3Discard
(default=true
)logStatusError::Bool=true
whether to log status of kindfmi3Error
(default=true
)logStatusFatal::Bool=true
whether to log status of kindfmi3Fatal
(default=true
)
Returns
- Returns the instance of a new FMU coSimulation instance.
Source
- FMISpec3.0 Link: https://fmi-standard.org/
- FMISpec3.0: 2.4.7 Model variables
- FMISpec3.0: 2.3.1. Super State: FMU State Setable
See also fmi3InstantiateCoSimulation
.
FMIImport.fmi3InstantiateModelExchange!
— Methodfmi3InstantiateModelExchange!(fmu::FMU3; instanceName::String=fmu.modelName, type::fmi3Type=fmu.type, pushInstances::Bool = true, visible::Bool = false, loggingOn::Bool = fmu.executionConfig.loggingOn, externalCallbacks::Bool = fmu.executionConfig.externalCallbacks,
logStatusOK::Bool=true, logStatusWarning::Bool=true, logStatusDiscard::Bool=true, logStatusError::Bool=true, logStatusFatal::Bool=true)
Create a new modelExchange instance of the given fmu, adds a logger if logginOn == true
.
Arguments
fmu::FMU3
: Mutable struct representing a FMU and all it instantiated instances in the FMI 3.0 Standard.
Keywords
instanceName::String=fmu.modelName
: Name of the instancetype::fmi3Type=fmu.type
: Defines whether a Co-Simulation or Model Exchange is presentpushInstances::Bool = true
: Defines if the fmu instances should be pushed in the application.visible::Bool = false
if the FMU should be started with graphic interface, if supported (default=false
)loggingOn::Bool = fmu.executionConfig.loggingOn
if the FMU should log and display function calls (default=false
)externalCallbacks::Bool = fmu.executionConfig.externalCallbacks
if an external shared library should be used for the fmi3CallbackFunctions, this may improve readability of logging messages (default=false
)logStatusOK::Bool=true
whether to log status of kindfmi3OK
(default=true
)logStatusWarning::Bool=true
whether to log status of kindfmi3Warning
(default=true
)logStatusDiscard::Bool=true
whether to log status of kindfmi3Discard
(default=true
)logStatusError::Bool=true
whether to log status of kindfmi3Error
(default=true
)logStatusFatal::Bool=true
whether to log status of kindfmi3Fatal
(default=true
)
Returns
- Returns the instance of a new FMU modelExchange instance.
Source
- FMISpec3.0 Link: https://fmi-standard.org/
- FMISpec3.0: 2.4.7 Model variables
- FMISpec3.0: 2.3.1. Super State: FMU State Setable
See also fmi3InstantiateModelExchange
.
FMIImport.fmi3InstantiateScheduledExecution!
— Methodfmi3InstantiateScheduledExecution!(fmu::FMU3; ptrlockPreemption::Ptr{Cvoid}, ptrunlockPreemption::Ptr{Cvoid}, instanceName::String=fmu.modelName, type::fmi3Type=fmu.type, pushInstances::Bool = true, visible::Bool = false, loggingOn::Bool = fmu.executionConfig.loggingOn, externalCallbacks::Bool = fmu.executionConfig.externalCallbacks,
logStatusOK::Bool=true, logStatusWarning::Bool=true, logStatusDiscard::Bool=true, logStatusError::Bool=true, logStatusFatal::Bool=true)
Create a new ScheduledExecution instance of the given fmu, adds a logger if logginOn == true
.
Arguments
fmu::FMU3
: Mutable struct representing a FMU and all it instantiated instances in the FMI 3.0 Standard.
Keywords
ptrlockPreemption::Ptr{Cvoid}
: Points to a function handling locking PreemptionptrunlockPreemption::Ptr{Cvoid}
: Points to a function handling unlocking PreemptioninstanceName::String=fmu.modelName
: Name of the instancetype::fmi3Type=fmu.type
: Defines whether a Co-Simulation or Model Exchange is presentpushInstances::Bool = true
: Defines if the fmu instances should be pushed in the application.visible::Bool = false
if the FMU should be started with graphic interface, if supported (default=false
)loggingOn::Bool = fmu.executionConfig.loggingOn
if the FMU should log and display function calls (default=false
)externalCallbacks::Bool = fmu.executionConfig.externalCallbacks
if an external shared library should be used for the fmi3CallbackFunctions, this may improve readability of logging messages (default=false
)logStatusOK::Bool=true
whether to log status of kindfmi3OK
(default=true
)logStatusWarning::Bool=true
whether to log status of kindfmi3Warning
(default=true
)logStatusDiscard::Bool=true
whether to log status of kindfmi3Discard
(default=true
)logStatusError::Bool=true
whether to log status of kindfmi3Error
(default=true
)logStatusFatal::Bool=true
whether to log status of kindfmi3Fatal
(default=true
)
Returns
- Returns the instance of a new FMU ScheduledExecution instance.
Source
- FMISpec3.0 Link: https://fmi-standard.org/
- FMISpec3.0: 2.4.7 Model variables
- FMISpec3.0: 2.3.1. Super State: FMU State Setable
See also fmi3InstantiateScheduledExecution
.
FMIImport.fmi3LoadModelDescription
— MethodExtract the FMU variables and meta data from the ModelDescription
FMIImport.fmi3SerializeFMUState
— Methodfmi3SerializeFMUState(c::FMU3Instance, state::fmi3FMUState)
Serializes the data referenced by the pointer FMUstate and copies this data into the byte vector serializedState of length size to be provided by the environment.
Arguments
c::FMU3Instance
: Mutable struct represents an instantiated instance of an FMU in the FMI 3.0 Standard.state::fmi3FMUState
: Argumentstate
is a pointer to a data structure in the FMU that saves the internal FMU state of the actual or a previous time instant.
Returns
serializedState:: Array{fmi3Byte}
: ReturnserializedState
contains the copy of the serialized data referenced by the pointer FMUstate
Source
- FMISpec3.0 Link: https://fmi-standard.org/
- FMISpec3.0: 2.2.3 Platform Dependent Definitions
- FMISpec3.0: 2.2.6.4. Getting and Setting the Complete FMU State
See also fmi3SerializeFMUState
.
FMIImport.fmi3SerializedFMUStateSize
— Methodfmi3SerializedFMUStateSize(c::FMU3Instance, state::fmi3FMUState)
Returns the size of the byte vector in which the FMUstate can be stored.
Arguments
c::FMU3Instance
: Mutable struct represents an instantiated instance of an FMU in the FMI 3.0 Standard.state::fmi3FMUState
: Argumentstate
is a pointer to a data structure in the FMU that saves the internal FMU state of the actual or a previous time instant.
Returns
- Return
size
is an object that safely references a value of typeCsize_t
.
Source
- FMISpec3.0 Link: https://fmi-standard.org/
- FMISpec3.0: 2.2.3 Platform Dependent Definitions
- FMISpec3.0: 2.2.6.4. Getting and Setting the Complete FMU State
See also fmi3SerializedFMUStateSize
.
FMIImport.fmi3UpdateDiscreteStates!
— Methodfmi3UpdateDiscreteStates!(c::FMU3Instance)
This function is called to signal a converged solution at the current super-dense time instant. fmi3UpdateDiscreteStates must be called at least once per super-dense time instant. Results are returned, use fmi3UpdateDiscreteStates
for the out-of-place variant.
Arguments
c::FMU3Instance
: Mutable struct represents an instantiated instance of an FMU in the FMI 3.0 Standard.
Returns
fmi3Status
Source
- FMISpec3.0 Link: https://fmi-standard.org/
- FMISpec3.0: 2.2.3 Platform Dependent Definitions
- FMISpec3.0: 2.3.5. State: Event Mode
FMIImport.getGUID
— MethodgetGUID(md::fmi2ModelDescription)
Returns the tag 'guid' from the model description.
Arguments
md::fmi2ModelDescription
: Struct which provides the static information of ModelVariables.
Returns
guid::String
: Returns the tag 'guid' from the model description.
FMIImport.getState
— MethodgetState(solution::FMUSolution, i::fmi2ValueReferenceFormat; isIndex::Bool=false)
Returns the solution state for a given value reference i
(for isIndex=false
) or the i-th state (for isIndex=true
).
FMIImport.getStateDerivative
— MethodgetStateDerivative(solution::FMUSolution, i::fmi2ValueReferenceFormat; isIndex::Bool=false)
Returns the solution state derivative for a given value reference i
(for isIndex=false
) or the i-th state (for isIndex=true
).
FMIImport.getTime
— MethodgetTime(solution::FMU2Solution)
Returns the points in time of the solution solution
.
FMIImport.info
— Method info(fmu)
Print information about the FMU.
Arguments
fmu::FMU
: The FMU you are interessted in.
Further reading
- FMISpec2.0.2 Link: https://fmi-standard.org/
FMIImport.isModelStructureAvailable
— MethodisModelStructureAvailable(md::fmi2ModelDescription)
Returns true if the FMU model description contains dependency
information.
Arguments
md::fmi2ModelDescription
: Struct which provides the static information of ModelVariables.
Returns
::Bool
: Returns true, if the FMU model description containsdependency
information.
FMIImport.isModelStructureDerivativesAvailable
— MethodisModelStructureDerivativesAvailable(md::fmi2ModelDescription)
Returns if the FMU model description contains dependency
information for derivatives
.
Arguments
md::fmi2ModelDescription
: Struct which provides the static information of ModelVariables.
Returns
::Bool
: Returns true, if the FMU model description containsdependency
information forderivatives
.
FMIImport.loadPointers
— MethodloadPointers(fmu::FMU2)
load pointers to fmu
s c functions from shared library handle (provided by
fmu.libHandle`)
FMIImport.loadPointers
— MethodloadPointers(fmu::FMU3)
load pointers to fmu
s c functions from shared library handle (provided by
fmu.libHandle`)
FMIImport.reload
— Methodreload(fmu::FMU2)
Reloads the FMU-binary. This is useful, if the FMU does not support a clean reset implementation.
Arguments
fmu::FMU2
: Mutable struct representing a FMU and all it instantiated instances in the FMI 2.0.2 Standard.
FMIImport.unloadFMU
— FunctionunloadFMU(fmu::FMU2, cleanUp::Bool=true; secure_pointers::Bool=true)
Unload a FMU. Free the allocated memory, close the binaries and remove temporary zip and unziped FMU model description.
Arguments
fmu::FMU2
: Mutable struct representing a FMU and all it instantiated instances in the FMI 2.0.2 Standard.cleanUp::Bool= true
: Defines if the file and directory should be deleted.
Keywords
secure_pointers=true
whether pointers to C-functions should be overwritten with dummies with Julia assertions, instead of pointing to dead memory (slower, but more user safe)
FMIImport.unzip
— Methodunzip(pathToFMU::String; unpackPath=nothing, cleanup=true)
Create a copy of the .fmu file as a .zip folder and unzips it. Returns the paths to the zipped and unzipped folders.
Arguments
pathToFMU::String
: The folder path to the .zip folder.
Keywords
unpackPath=nothing
: Via optional argumentunpackPath
, a path to unpack the FMU can be specified (default: system temporary directory).cleanup=true
: The cleanup option controls whether the temporary directory is automatically deleted when the process exits.
Returns
unzippedAbsPath::String
: Contains the Path to the uzipped Folder.zipAbsPath::String
: Contains the Path to the zipped Folder.
See also mktempdir
.