在 Modelica 中搜索“冗长"之类的概念 [英] Searching for a concept like 'verbosity' in Modelica

查看:33
本文介绍了在 Modelica 中搜索“冗长"之类的概念的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在为大型 Modelica 模型的输出文件大小而苦苦挣扎.当然,我可以保护一些对象,以便将它们从结果文件中完全删除.但是,这会带来两个问题:

I'm struggling with the size of output files for large Modelica models. Off course, I can protect some objects in order to remove them completely from the result file. However, that gives rise to two problems:

  1. 无法重新声明受保护的对象
  2. 如果我想详细测试我的模型(例如在短时间内),我需要再次公开声明这些对象以查看它们的变量

我想知道是否有设置 Modelica 模型详细程度"的技巧.也许我想要的是 publicprotected 旁边的第三个关键字,例如.透明.然后,在设置模拟时,我希望能够将详细级别设置为 1 或 2,并具有以下效果:

I wonder if there's a trick to set the 'verbosity' of a Modelica model. Maybe what I would like is a third keyword next to public, protected, eg. transparent. Then, when setting up a simulation, I want be able to set the verbosity level to 1, or 2 with the following effect:

1--> 将所有 transparent 元素视为 protected

1--> consider all transparentelements as protected

2--> 将所有 transparent 元素视为 public

2--> consider all transparentelements as public

这种效果会传播到所有模型和子模型.
我不认为这已经存在.但是有没有简单的解决方法?

This effect would propagate to all models and submodels.
I don't think this already exists. But is there an easy workaround?

谢谢,罗尔

推荐答案

Roel,

我知道有几个人在为这个问题苦苦挣扎.目前,所有这些都取决于所使用的工具.我不知道其他工具如何处理结果过滤,但在 Dymola 中,您可以通过为信号提供特殊限定符(例如受保护)来控制它(如您所指出的).

I know several people wrestling with this issue. At the moment, all of this depends on the tool being used. I don't know how other tools handle filtering of results, but in Dymola you control it (as you point out) by giving the signals special qualifiers (e.g. protected).

我过去做过的一件事是从模型扩展,然后为我感兴趣的事物添加一堆输出信号.然后您可以在 Dymola 中选择输出"以确保这些信号进入结果文件.这远非完美,因为 a) 列出您想要的所有内容可能会变得乏味,并且 b) 引用受保护的变量是严格不允许的(尽管 Dymola 允许您摆脱它但会发出警告).

One thing I've done in the past is to extend from a model and then add a bunch of output signals for things I'm interested in. Then you can select "Outputs" in Dymola to make sure those get in the results file. This is far from perfect because a) listing everything you want can get tedious and b) referencing protected variables is not strictly allowed (although Dymola lets you get away with it but issues a warning).

在达索,我们正在积极讨论这个想法,并希望沿着这些方向提供一些更好的功能.目前尚不清楚此类功能是否严格特定于工具,或者是否会以某种方式涉及语言.但如果是语言相关的,我们(当然)会与设计组合作制定其他工具供应商也可以支持的规范.

At Dassault, we are actively discussing this idea and hope to provide some better functionality along these lines. It isn't clear whether such functionality will be strictly tool specific or whether it will involve the language somehow. But if it is language related, we will (of course) work with the design group to formulate a specification that other tool vendors can support as well.

这篇关于在 Modelica 中搜索“冗长"之类的概念的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆