FMI for Model Exchange
This chapter contains the interface description to access the equations of a dynamic system from a C program.
Providing Independent Variables and Re-initialization of Caching
Depending on the situation, different variables need to be computed. In order to be efficient, it is important that the interface requires only the computation of variables that are needed in the present context. The state derivatives shall be reused from the previous call. This feature is called “caching of variables” in the sequel. Caching requires that the model evaluation can detect when the input arguments, like time or states, have changed.
FMICore.fmi2SetTime — FunctionSource: FMISpec2.0.2[p.83]: 3.2.1 Providing Independent Variables and Re-initialization of Caching
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).
fmi2SetTime(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: Argumenttimecontains a value of typefmi2Realwhich is a alias type forRealdata type.timesets the independent variable time t.
Keywords
soft::Bool=false: If the Keywordsoft = truethe 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: Returnstatusis an enumeration of typefmi2Statusand 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.
fmiSetTime(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: Argumenttcontains a value of typeReal.tsets the independent variable time t.
Returns
status::fmi2Status: Returnstatusis an enumeration of typefmi2Statusand 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.fmi2SetContinuousStates — FunctionSource: FMISpec2.0.2[p.83]: 3.2.1 Providing Independent Variables and Re-initialization of Caching
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
fmiSetContinuousStates(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}}:Argumentxis theAbstractArrayof the vector values ofFloat64orFloat32.
Returns
status::fmi2Status: Returnstatusis an enumeration of typefmi2Statusand 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.
Evaluation of Model Equations
FMICore.fmi2EnterEventMode — FunctionSource: FMISpec2.0.2[p.84]: 3.2.2 Evaluation of Model Equations
The model enters Event Mode from the Continuous-Time Mode and discrete-time equations may become active (and relations are not “frozen”).
fmi2EnterEventMode(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 = truethe command is only performed if the FMU is in an allowed state for this command.
Returns
status::fmi2Status: Returnstatusis an enumeration of typefmi2Statusand 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.
FMIImport.fmi2NewDiscreteStates — Functionfmi2NewDiscreteStates(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 withfmi2BooleanVariables
More detailed:
newDiscreteStatesNeeded::fmi2Boolean: IfnewDiscreteStatesNeeded = fmi2Truethe 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 = fmi2Truecallfmi2TerminatenominalsOfContinuousStatesChanged::fmi2Boolean: IfnominalsOfContinuousStatesChanged = fmi2Truethen 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,valuesOfContinuousStatesChangedmust return fmi2False.nextEventTimeDefined::fmi2Boolean: IfnextEventTimeDefined = fmi2True, then the simulation shall integrate at most untiltime = nextEventTime, and shall callfmi2EnterEventModeat this time instant. If integration is stopped before nextEventTime, the definition ofnextEventTimebecomes 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.
FMICore.fmi2NewDiscreteStates! — FunctionSource: FMISpec2.0.2[p.84]: 3.2.2 Evaluation of Model Equations
The FMU is in Event Mode and the super dense time is incremented by this call.
fmi2NewDiscreteStates!(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 withfmi2BooleanVariables that
More detailed:
newDiscreteStatesNeeded::fmi2Boolean: IfnewDiscreteStatesNeeded = fmi2Truethe 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 = fmi2Truecallfmi2TerminatenominalsOfContinuousStatesChanged::fmi2Boolean: IfnominalsOfContinuousStatesChanged = fmi2Truethen 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,valuesOfContinuousStatesChangedmust return fmi2False.nextEventTimeDefined::fmi2Boolean: IfnextEventTimeDefined = fmi2True, then the simulation shall integrate at most untiltime = nextEventTime, and shall callfmi2EnterEventModeat this time instant. If integration is stopped before nextEventTime, the definition ofnextEventTimebecomes obsolete.nextEventTime::fmi2Real: next event ifnextEventTimeDefined=fmi2True
Returns
status::fmi2Status: Returnstatusis an enumeration of typefmi2Statusand 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.fmi2EnterContinuousTimeMode — FunctionSource: FMISpec2.0.2[p.85]: 3.2.2 Evaluation of Model Equations
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.
fmi2EnterContinuousTimeMode(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 = truethe command is only performed if the FMU is in an allowed state for this command.
Returns
status::fmi2Status: Returnstatusis an enumeration of typefmi2Statusand 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.
FMIImport.fmi2CompletedIntegratorStep — FunctionfmiCompletedIntegratorStep(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 = fmi2Trueiffmi2SetFMUStatewill no longer be called for time instants prior to current time in this simulation run.
Returns
status::fmi2Status: Returnstatusis an enumeration of typefmi2Statusand 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 callfmi2EnterEventModeterminateSimulation::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.
FMICore.fmi2CompletedIntegratorStep! — FunctionSource: FMISpec2.0.2[p.85]: 3.2.2 Evaluation of Model Equations
This function must be called by the environment after every completed step of the integrator provided the capability flag completedIntegratorStepNotNeeded = false. If enterEventMode == fmi2True, the event mode must be entered If terminateSimulation == fmi2True, the simulation shall be terminated
fmi2CompletedIntegratorStep!(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 = fmi2Trueiffmi2SetFMUStatewill no longer be called for time instants prior to current time in this simulation run.enterEventMode::Ref{fmi2Boolean}: ArgumententerEventModepoints to the return value (fmi2Boolean) which signals to the environment if the FMU shall callfmi2EnterEventMode.fmi2Booleanis an alias type forBooleandata type.terminateSimulation::Ref{fmi2Boolean}: ArgumentterminateSimulationpoints to the return value (fmi2Boolean) which signals signal if the simulation shall be terminated.fmi2Booleanis an alias type forBooleandata type.
Returns
status::fmi2Status: Returnstatusis an enumeration of typefmi2Statusand 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!.
FMIImport.fmi2GetDerivatives — Functionfmi2GetDerivatives(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 offmi2Realvalues representing thederivativesfor 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!.
FMICore.fmi2GetDerivatives! — FunctionSource: FMISpec2.0.2[p.86]: 3.2.2 Evaluation of Model Equations
Compute state derivatives at the current time instant and for the current states.
fmi2GetDerivatives!(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}: Argumentderivativescontains values of typefmi2Realwhich is a alias type forRealdata type.derivativesis theAbstractArraywhich contains theRealvalues 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: Argumentnxdefines the length of vectorderivativesand is provided for checking purposes
Returns
status::fmi2Status: Returnstatusis an enumeration of typefmi2Statusand 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!.
fmi2GetDerivatives!(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}: Storesfmi2Realvalues representing thederivativesfor the current states. The ordering of the elements of the derivatives vector is identical to the ordering of the state vector.
Returns
status::fmi2Status: Returnstatusis an enumeration of typefmi2Statusand 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!.
FMIImport.fmi2GetEventIndicators — Functionfmi2GetEventIndicators(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!.
FMICore.fmi2GetEventIndicators! — FunctionSource: FMISpec2.0.2[p.86]: 3.2.2 Evaluation of Model Equations
Compute event indicators at the current time instant and for the current states.
fmi2GetEventIndicators!(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}: ArgumenteventIndicatorscontains values of typefmi2Realwhich is a alias type forRealdata type.eventIndicatorsis theAbstractArraywhich contains theRealvalues of the vector that represent the event indicators.ni::Csize_t: Argumentnidefines the length of vectoreventIndicatorsand is provided for checking purposes
Returns
status::fmi2Status: Returnstatusis an enumeration of typefmi2Statusand 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!.
fmi2GetEventIndicators!(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
FMIImport.fmi2GetContinuousStates — Functionfmi2GetContinuousStates(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 offmi2Realvalues 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!.
FMICore.fmi2GetContinuousStates! — FunctionSource: FMISpec2.0.2[p.86]: 3.2.2 Evaluation of Model Equations
Return the new (continuous) state vector x.
fmi2GetContinuousStates!(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}: Argumentxcontains values of typefmi2Realwhich is a alias type forRealdata type.xis theAbstractArraywhich contains theRealvalues of the vector that represent the new state vector.nx::Csize_t: Argumentnxdefines the length of vectorxand is provided for checking purposes
Returns
status::fmi2Status: Returnstatusis an enumeration of typefmi2Statusand 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!.
FMIImport.fmi2GetNominalsOfContinuousStates — Functionfmi2GetNominalsOfContinuousStates(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 offmi2Realvalues 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.
FMICore.fmi2GetNominalsOfContinuousStates! — FunctionSource: FMISpec2.0.2[p.86]: 3.2.2 Evaluation of Model Equations
Return the nominal values of the continuous states.
fmi2GetNominalsOfContinuousStates!(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_nominalcontains values of typefmi2Realwhich is a alias type forRealdata type.x_nominalis theAbstractArraywhich contains theRealvalues of the vector that represent the nominal values of the continuous states.nx::Csize_t: Argumentnxdefines the length of vectorxand is provided for checking purposes
Returns
status::fmi2Status: Returnstatusis an enumeration of typefmi2Statusand 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!.