首页 > 解决方案 > How to save the results in sdf file format after simulation through python Api in Dymola

问题描述

By default

dymola.simulateModel("Modelica.Mechanics.Rotational.Examples.CoupledClutches", 0.0, 1.0,0, 0.0,"Dassl",0.0001, 0.0, "res")

generates .mat file

Suppose if we want to generate txt file then below line is used

dymola.experimentSetupOutput(textual=True)

But if I want to save the result in sdf file format what should I do?

标签: pythondymolasdf

解决方案


我可能错了,但我认为 Dymola 中没有这样的标志可以直接将模拟结果输出为 sdf。

sdf 文件是在模拟完成后生成的dsres2sdf.exe,位于 Dymola 安装目录的 bin 文件夹中。

因此,您可以简单地执行模拟,然后从 python 调用 exe 将 Dymola 结果文件转换为 sdf 文件。

Usage: dsres2sdf.exe <result.mat> <result.sdf>

推荐阅读