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.fmi2SetTimeFunction

Source: 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).

source
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: Argument time contains a value of type fmi2Real which is a alias type for Real data type. time sets the independent variable time t.

Keywords

  • soft::Bool=false: If the Keyword soft = 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: Return status is an enumeration of type fmi2Status and indicates the success of the function call.

More detailed:

  • fmi2OK: all well
  • fmi2Warning: things are not quite right, but the computation can continue
  • fmi2Discard: if the slave computed successfully only a subinterval of the communication step
  • fmi2Error: the communication step could not be carried out at all
  • fmi2Fatal: if an error occurred which corrupted the FMU irreparably
  • fmi2Pending: 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.

source
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: Argument t contains a value of type Real. t sets the independent variable time t.

Returns

  • status::fmi2Status: Return status is an enumeration of type fmi2Status and indicates the success of the function call.

More detailed:

  • fmi2OK: all well
  • fmi2Warning: things are not quite right, but the computation can continue
  • fmi2Discard: if the slave computed successfully only a subinterval of the communication step
  • fmi2Error: the communication step could not be carried out at all
  • fmi2Fatal: if an error occurred which corrupted the FMU irreparably
  • fmi2Pending: 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

source
FMICore.fmi2SetContinuousStatesFunction

Source: 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

source
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}}:Argument x is the AbstractArray of the vector values of Float64 or Float32.

Returns

  • status::fmi2Status: Return status is an enumeration of type fmi2Status and indicates the success of the function call.

More detailed:

  • fmi2OK: all well
  • fmi2Warning: things are not quite right, but the computation can continue
  • fmi2Discard: if the slave computed successfully only a subinterval of the communication step
  • fmi2Error: the communication step could not be carried out at all
  • fmi2Fatal: if an error occurred which corrupted the FMU irreparably
  • fmi2Pending: 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.

source

Evaluation of Model Equations

FMICore.fmi2EnterEventModeFunction

Source: 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”).

source
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 Keyword soft = true the command is only performed if the FMU is in an allowed state for this command.

Returns

  • status::fmi2Status: Return status is an enumeration of type fmi2Status and indicates the success of the function call.

More detailed:

  • fmi2OK: all well
  • fmi2Warning: things are not quite right, but the computation can continue
  • fmi2Discard: if the slave computed successfully only a subinterval of the communication step
  • fmi2Error: the communication step could not be carried out at all
  • fmi2Fatal: if an error occurred which corrupted the FMU irreparably
  • fmi2Pending: 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.

source
FMIImport.fmi2NewDiscreteStatesFunction
fmi2NewDiscreteStates(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 with fmi2Boolean Variables

More detailed:

  • newDiscreteStatesNeeded::fmi2Boolean: If newDiscreteStatesNeeded = 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: If terminateSimulation = fmi2True call fmi2Terminate
  • nominalsOfContinuousStatesChanged::fmi2Boolean: If nominalsOfContinuousStatesChanged = fmi2True then the nominal values of the states have changed due to the function call and can be inquired with fmi2GetNominalsOfContinuousStates.
  • valuesOfContinuousStatesChanged::fmi2Boolean: If valuesOfContinuousStatesChanged = 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 with fmi2GetContinuousStates. If no element of the continuous state vector has changed its value, valuesOfContinuousStatesChanged must return fmi2False.
  • nextEventTimeDefined::fmi2Boolean: If nextEventTimeDefined = fmi2True, then the simulation shall integrate at most until time = nextEventTime, and shall call fmi2EnterEventMode at this time instant. If integration is stopped before nextEventTime, the definition of nextEventTime becomes obsolete.
  • nextEventTime::fmi2Real: next event if nextEventTimeDefined=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.

source
FMICore.fmi2NewDiscreteStates!Function

Source: 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.

source
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 with fmi2Boolean Variables that

More detailed:

  • newDiscreteStatesNeeded::fmi2Boolean: If newDiscreteStatesNeeded = 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: If terminateSimulation = fmi2True call fmi2Terminate
  • nominalsOfContinuousStatesChanged::fmi2Boolean: If nominalsOfContinuousStatesChanged = fmi2True then the nominal values of the states have changed due to the function call and can be inquired with fmi2GetNominalsOfContinuousStates.
  • valuesOfContinuousStatesChanged::fmi2Boolean: If valuesOfContinuousStatesChanged = 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 with fmi2GetContinuousStates. If no element of the continuous state vector has changed its value, valuesOfContinuousStatesChanged must return fmi2False.
  • nextEventTimeDefined::fmi2Boolean: If nextEventTimeDefined = fmi2True, then the simulation shall integrate at most until time = nextEventTime, and shall call fmi2EnterEventMode at this time instant. If integration is stopped before nextEventTime, the definition of nextEventTime becomes obsolete.
  • nextEventTime::fmi2Real: next event if nextEventTimeDefined=fmi2True

Returns

  • status::fmi2Status: Return status is an enumeration of type fmi2Status and indicates the success of the function call.

More detailed:

  • fmi2OK: all well
  • fmi2Warning: things are not quite right, but the computation can continue
  • fmi2Discard: if the slave computed successfully only a subinterval of the communication step
  • fmi2Error: the communication step could not be carried out at all
  • fmi2Fatal: if an error occurred which corrupted the FMU irreparably
  • fmi2Pending: 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.

source
FMICore.fmi2EnterContinuousTimeModeFunction

Source: 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.

source
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 Keyword soft = true the command is only performed if the FMU is in an allowed state for this command.

Returns

  • status::fmi2Status: Return status is an enumeration of type fmi2Status and indicates the success of the function call.

More detailed:

  • fmi2OK: all well
  • fmi2Warning: things are not quite right, but the computation can continue
  • fmi2Discard: if the slave computed successfully only a subinterval of the communication step
  • fmi2Error: the communication step could not be carried out at all
  • fmi2Fatal: if an error occurred which corrupted the FMU irreparably
  • fmi2Pending: 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.

source
FMIImport.fmi2CompletedIntegratorStepFunction
fmiCompletedIntegratorStep(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: Argument noSetFMUStatePriorToCurrentPoint = fmi2True if fmi2SetFMUState will no longer be called for time instants prior to current time in this simulation run.

Returns

  • status::fmi2Status: Return status is an enumeration of type fmi2Status and indicates the success of the function call.

More detailed:

  • fmi2OK: all well
  • fmi2Warning: things are not quite right, but the computation can continue
  • fmi2Discard: if the slave computed successfully only a subinterval of the communication step
  • fmi2Error: the communication step could not be carried out at all
  • fmi2Fatal: if an error occurred which corrupted the FMU irreparably
  • fmi2Pending: this status is returned if the slave executes the function asynchronously
  • enterEventMode::Array{fmi2Boolean, 1}: Returns enterEventMode[1] to signal to the environment if the FMU shall call fmi2EnterEventMode
  • terminateSimulation::Array{fmi2Boolean, 1}: Returns terminateSimulation[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.

source
FMICore.fmi2CompletedIntegratorStep!Function

Source: 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

source
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: Argument noSetFMUStatePriorToCurrentPoint = fmi2True if fmi2SetFMUState will no longer be called for time instants prior to current time in this simulation run.
  • enterEventMode::Ref{fmi2Boolean}: Argument enterEventMode points to the return value (fmi2Boolean) which signals to the environment if the FMU shall call fmi2EnterEventMode. fmi2Boolean is an alias type for Boolean data type.
  • terminateSimulation::Ref{fmi2Boolean}: Argument terminateSimulation points to the return value (fmi2Boolean) which signals signal if the simulation shall be terminated. fmi2Boolean is an alias type for Boolean data type.

Returns

  • status::fmi2Status: Return status is an enumeration of type fmi2Status and indicates the success of the function call.

More detailed:

  • fmi2OK: all well
  • fmi2Warning: things are not quite right, but the computation can continue
  • fmi2Discard: if the slave computed successfully only a subinterval of the communication step
  • fmi2Error: the communication step could not be carried out at all
  • fmi2Fatal: if an error occurred which corrupted the FMU irreparably
  • fmi2Pending: 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!.

source
FMIImport.fmi2GetDerivativesFunction
fmi2GetDerivatives(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 of fmi2Real values representing the derivatives 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!.

source
FMICore.fmi2GetDerivatives!Function

Source: 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.

source
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}: Argument derivatives contains values of type fmi2Real which is a alias type for Real data type.derivatives is the AbstractArray which contains the Real 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: Argument nx defines the length of vector derivatives and is provided for checking purposes

Returns

  • status::fmi2Status: Return status is an enumeration of type fmi2Status and indicates the success of the function call.

More detailed:

  • fmi2OK: all well
  • fmi2Warning: things are not quite right, but the computation can continue
  • fmi2Discard: if the slave computed successfully only a subinterval of the communication step
  • fmi2Error: the communication step could not be carried out at all
  • fmi2Fatal: if an error occurred which corrupted the FMU irreparably
  • fmi2Pending: 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!.

source
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}: Stores fmi2Real values representing the derivatives 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: Return status is an enumeration of type fmi2Status and indicates the success of the function call.

More detailed:

  • fmi2OK: all well
  • fmi2Warning: things are not quite right, but the computation can continue
  • fmi2Discard: if the slave computed successfully only a subinterval of the communication step
  • fmi2Error: the communication step could not be carried out at all
  • fmi2Fatal: if an error occurred which corrupted the FMU irreparably
  • fmi2Pending: 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!.

source
FMIImport.fmi2GetEventIndicatorsFunction
fmi2GetEventIndicators(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!.

source
FMICore.fmi2GetEventIndicators!Function

Source: 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.

source
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}: Argument eventIndicators contains values of type fmi2Real which is a alias type for Real data type.eventIndicators is the AbstractArray which contains the Real values of the vector that represent the event indicators.
  • ni::Csize_t: Argument ni defines the length of vector eventIndicators and is provided for checking purposes

Returns

  • status::fmi2Status: Return status is an enumeration of type fmi2Status and indicates the success of the function call.

More detailed:

  • fmi2OK: all well
  • fmi2Warning: things are not quite right, but the computation can continue
  • fmi2Discard: if the slave computed successfully only a subinterval of the communication step
  • fmi2Error: the communication step could not be carried out at all
  • fmi2Fatal: if an error occurred which corrupted the FMU irreparably
  • fmi2Pending: 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!.

source
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
source
FMIImport.fmi2GetContinuousStatesFunction
fmi2GetContinuousStates(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 of fmi2Real values representing the new continuous state vector x.

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!.

source
FMICore.fmi2GetContinuousStates!Function

Source: FMISpec2.0.2[p.86]: 3.2.2 Evaluation of Model Equations

Return the new (continuous) state vector x.

source
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}: Argument x contains values of type fmi2Real which is a alias type for Real data type.x is the AbstractArray which contains the Real values of the vector that represent the new state vector.
  • nx::Csize_t: Argument nx defines the length of vector x and is provided for checking purposes

Returns

  • status::fmi2Status: Return status is an enumeration of type fmi2Status and indicates the success of the function call.

More detailed:

  • fmi2OK: all well
  • fmi2Warning: things are not quite right, but the computation can continue
  • fmi2Discard: if the slave computed successfully only a subinterval of the communication step
  • fmi2Error: the communication step could not be carried out at all
  • fmi2Fatal: if an error occurred which corrupted the FMU irreparably
  • fmi2Pending: 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!.

source
FMIImport.fmi2GetNominalsOfContinuousStatesFunction
fmi2GetNominalsOfContinuousStates(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 of fmi2Real values representing the new continuous state vector x.

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.

source
FMICore.fmi2GetNominalsOfContinuousStates!Function

Source: FMISpec2.0.2[p.86]: 3.2.2 Evaluation of Model Equations

Return the nominal values of the continuous states.

source
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}: Argument x_nominal contains values of type fmi2Real which is a alias type for Real data type.x_nominal is the AbstractArray which contains the Real values of the vector that represent the nominal values of the continuous states.
  • nx::Csize_t: Argument nx defines the length of vector x and is provided for checking purposes

Returns

  • status::fmi2Status: Return status is an enumeration of type fmi2Status and indicates the success of the function call.

More detailed:

  • fmi2OK: all well
  • fmi2Warning: things are not quite right, but the computation can continue
  • fmi2Discard: if the slave computed successfully only a subinterval of the communication step
  • fmi2Error: the communication step could not be carried out at all
  • fmi2Fatal: if an error occurred which corrupted the FMU irreparably
  • fmi2Pending: 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!.

source