Simulink导出FMU模型文件方法

一、安装FMIKIT

首先下载FMIKit-Simulink-master.zip文件,然后解压缩,在matlab中把添加该文件到路径

addpath("C:\FMIKit-Simulink-master")

二、加载FMIKIT

初始化FMIKIT在matlab命令行输入:

FMIKit.initialize()

三、安装Cmake

安装“cmake-3.21.0-windows-x86_64.msi”,用以编译用的

四、导出FMU模型文件

  1. Add external inputs and outputs (optional)
  2. Open **Simulation > Model Configuration Parameters** (CTRL+E)
  3. Under **Solver > Type** select **Fixed-step** for a Co-Simulation FMU or **Variable-step** for a Model Exchange FMU
  4. Under **Code Generation > System target file** click **Browse** and select **grtfmi.tlc** for a Generic Real-Time based FMU or **rtwsfcnfmi.tlc** for an S-function based FMU
  5. Under **Code Generation > CMake** select the **CMake generator** for your toolchain
  6. Apply the **Model Configuration Parameters** dialog
  7. Select **Code > C/C++ Code > Build Model** (CTRL+B) to export the FMU to the current working directory。
     

在simulink测试导出的模型,

或者用FMIpy测试

 

 

评论 11
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值