【问题标题】:decrease the mat file size of Dymola result减小 Dymola 结果的 mat 文件大小
【发布时间】:2021-10-14 13:58:25
【问题描述】:

Dymola 模拟的结果是 .mat 文件,可能很大。这里是一个Power Plant模型的一系列结果,仿真时间间隔是0-100000s,但是我只需要90000到100000s之间的数据,那么有没有什么办法让Dymola只输出90000到100000s的数据?

【问题讨论】:

    标签: modelica dymola


    【解决方案1】:

    Dymola 用户手册中有一节叫做“输出点的可变频率”。在那里你会找到关于Advanced.Simulation.VariableInterval=true 和类似声明的解释

    when time >=… then
      Dymola.Simulation.SetOutputInterval(…);
    end when;
    

    将使您能够根据模拟时间设置输出间隔。

    那里显示的例子是:

    model VariableOutputInterval "demonstrate the use of variable output interval in a model"
      Real x;
    equation
      x = sin(10*time);
      
      when initial() then
        Dymola.Simulation.SetOutputInterval(0.1);
      end when;
    
      when time >= 0.5 then
        Dymola.Simulation.SetOutputInterval(0.05);
      end when;
    
      when time >= 1.1 then
        Dymola.Simulation.SetOutputInterval(0.002);
      end when;
    end VariableOutputInterval;
    

    还有两个注意事项:

    • 在模拟设置中“重置”间隔长度的唯一方法是显式设置该间隔,这是在上面的最后一个 when 语句中完成的。
    • 每次必须有单独的 when 语句。

    【讨论】:

      猜你喜欢
      • 2011-12-27
      • 2010-10-08
      • 2012-05-10
      • 2019-03-03
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-08-25
      相关资源
      最近更新 更多