我正在尝试将 Simulink 模型(称为“variableStepByHand”)导出为联合仿真独立 FMU。输入相应命令后:
exportToFMU2CS('variableStepByHand', 'CreateModelAfterGeneratingFMU', 'on');
我收到以下错误:
Unable to build a standalone executable to simulate the model 'variableStepByHand' in rapid accelerator mode.
Caused by:
Error using simscape.engine.sli.dae.DaeCgSupport.support
['variableStepByHand/Subsystem/Solver Configuration']: Error opening
'C:\Users\...\44425e75_dcdb_4be9_89d8_63fb166f08d0\slprj\raccel_deploy\variableStepByHand\variableStepByHand_ec9fa5b3_1_ds_dxm_p.h~'
for writing: No such file or directory
我很确定这与可变步长求解器的使用有关。模式设置为正常而不是快速加速,与错误消息不一致。
如果我使用固定步长求解器导出模型,效果很好,但我需要它与可变步长求解器一起使用。
我自己找到了解决方案: 在在线观察该程序在matlab中运行后,我更新了自己的matlab(版本仍然是2023b)。现在可以导出了。