Functional Mock-up Interface (FMI) basic introduction

1. View ofThe Functional Mock-up Interface 3.0 - New Features Enabling New Applications(liu.se)

2. Functional Mock-up InterfaceSpecification (fmi-standard.org)

Especiallythe ability to package control code into FMUs required some workarounds in FMI2.0. With FMI 3.0, virtual electronic control units (vECUs) can be exported as FMUs in amore natural way. Concrete features to support vECU export are:

introductionof terminals to group variables semantically to ease connecting compatiblesignals,

introductionof icons to define a graphical representation of the FMU and itsterminals,

introductionof Clocks to more exactly control timing of events and evaluation of modelpartitions across FMUs,

introductionof more integer types and a 32-bit float type (see modelDescription.xml) to communicate native controller types to the outside,

introductionof a binary type to support non-numeric data handling, such as complex sensordata interfaces,

extensionof variables to arrays for more efficient and natural handling of non-scalarvariables,

introductionof structural parameters that allow description and changing of array sizes,even during runtime to support advanced online calibration of control code, and

additionof the new interface type "Scheduled Execution" (see Section 5) that allows activation of individual model partitions by an externalscheduler, e.g. on real-time platforms.


1.Model ExchangeThe Model Exchange interface exposes a simulationmodel as a hybrid ordinary differential equation (ODE)to a solver of animporter. Models are described by differ-ential, algebraic and discrete equations, interleaved withtime-, state- and step-events. Theintegration algorithm ofthe importer is responsible for advancing time, computingstate variables, handling events, etc.

2.The Co-Simulation interface is designed both for the cou-pling of simulation tools, andthe coupling of subsystemmodels, exported by their simulators together with theirsolvers as runnable code. The dataexchange between FMUs is restricted to discrete communication points. Inthe time between two communicationpoints the subsys-tem inside an FMU is solved independently by internalmeans. For FMI for Co-Simulation, theco-simulation al-gorithm is shielded from how the FMU advances time in-ternally.

3.The Scheduled Execution interface exposes individualmodel partitions (e. g., tasks of acontrol algorithm), to beorchestrated by a scheduler provided by the importer. Thescheduler is responsible for advancing theoverall simula-tion time, activating time-based and triggered clocks (foran explanation of clocks seesubsection 3.6) for all ex-posed model partitions of a set of FMUs, and to activatethe respective model partition. TheScheduled Executioninterface addresses simulation use cases with the follow-ing properties, that typically holdwhen the importer hasto communicate with external event sources/sinks that op-erate on independent individual timingschemes (e. g., realhardware, controller tasks on simulated or real controllerunits)


Allinterface types share common functionality, such asthe way variables and clocks are declared/interacted with,or common optional features likestore/restore the com-plete FMU state, or definitions of terminals and icons.Figure 1 ranks the different interfacetypes according totheir simplicity and flexibility trade-offs.An implementation that interacts with an FMU usingthe FMI API is called importer.


1.FMI提供了两种实现方法:needsExecutionTool =true 和needsExecutionTool=false。在第一种情况下,一个将DLL/SharedObject 做特别封装的工具必须作为二进制文件提供,在第二种情况下,要存储模型编译过的或源代码的版本,以及它的解算器。FMU常用的分发方式是DLLs/SharedObjects,因为这样就可以进行进一步的自动处理[例如导入到另一个工具中]。

2. 在模型Co-simulation中, 如果needsExecutionTool为true,则需要一个工具来执行模型。FMU只包含与这个工具的通信(参见图8)。[通常,此信息仅用于信息目的。例如,联合仿真master 可以通知用户,在slave 被实例化的计算机上必须有可用的工具。该工具的名称可以取自fmiModelDescription 的属性generationTool。]


fmi2OK – all well

fmi2Warning –不是完全正确,但计算可以继续。在模型中调用了函数“logger”(见下文),预计该函数已向用户显示了准备好的信息消息

fmi2Discard –只有在为相应的函数显式定义时,才可以使用此返回状态(CoSimulation: fmi2SetReal , fmi2SetInteger , fmi2SetBoolean , fmi2SetString,fmi2DoStep, fmiGetXXXStatus ).

fmi2Error – FMU 遇到错误。此FMU实例无法继续仿真。如果其中一个函数返回fmi2Error,则可以尝试通过调用fmi2setFMUstate 从以前存储的FMU状态重新启动仿真。

fmi2Fatal–所有FMU 实例的模型计算都无法修复地损坏。[例如,由于运行时异常,例如在执行FMI函数期间访问冲突或整数除零]。在FMU 中调用了函数“logger”(见下文),预设该函数已向用户显示了准备好的信息消息。无法为任何FMU 实例调用任何其他函数。

fmi2Pending–如果slave以异步方式执行功能,则仅从联合仿真接口返回。这意味着slave开始计算,但立即返回。master 必须调用fmi2GetStatus(..., fmi2DoStepStatus)来确定slave是否完成了计算。只能由fmi2DoStep和fmi2GetStatus 返回


  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值