OpenModelica -Connector生成的其他方程式超过预期

发布于 2025-02-12 11:34:33 字数 905 浏览 2 评论 0原文

我正在尝试在OpenModelica中实现一个简单的模型,但是我得到了由连接器引起的一系列方程式。

工具由三个项目组成:

第一个是连接器,其中仅定义了流量:

```
connector ConnectorMassFlow
flow Real G "Rate [kg/s]";
end ConnectorMassFlow;
```

第二个是压缩机模型,其中定义了1个连接器:

```
model ModelCompressor
ConnectorMassFlow MassFlowIn;
equation
end ModelCompressor;
```

然后,定义了压缩机,然后将电路模型定义为另一个连接器也是:

```
model ModelConditioner
ConnectorMassFlow MassFlowIn;
ModelCompressor Compressor;
equation
MassFlowIn.G = 1.0;
connect(Compressor.MassFlowIn,MassFlowIn);
end ModelConditioner;
```

问题是,即使只有2个方程,即:

  1. compressor.massflowin.g -MassFlowin.g = 0.0;
  2. massflowin.g = 1.0;

OpenModelica添加了另一个方程式,即:

  1. massFlowin.g = 0.0;

此外,在第一个方程式中应该有两个术语之间的A +,而不是负等式...

有人可以帮我吗?

I'm trying to implement a simple model in OpenModelica, but I got an overnumber of equations caused by the connector.

The tools is composed by three items:

The first is the connector, in which only a flow is defined:

```
connector ConnectorMassFlow
flow Real G "Rate [kg/s]";
end ConnectorMassFlow;
```

The second is a compressor model, in which 1 connector is defined:

```
model ModelCompressor
ConnectorMassFlow MassFlowIn;
equation
end ModelCompressor;
```

And then the circuit model, in which the compressor is defined, and another connector as well:

```
model ModelConditioner
ConnectorMassFlow MassFlowIn;
ModelCompressor Compressor;
equation
MassFlowIn.G = 1.0;
connect(Compressor.MassFlowIn,MassFlowIn);
end ModelConditioner;
```

The problem is that, even if there should be only 2 equations, i.e.:

  1. Compressor.MassFlowIn.G - MassFlowIn.G = 0.0;
  2. MassFlowIn.G = 1.0;

OpenModelica is adding another equation, that is:

  1. MassFlowIn.G = 0.0;

In addition, in the first equation there should be a + between the two terms, and not a minus...

Can someone help me please?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文