我正在使用 Modelon 的热功率库。热电库中有一个冷凝器组件,用于发电厂建模。冷凝器组件中 wall_2 的默认传热面积为0.8*A_heat_tot,变量 ofA_heat_tot是冷凝器组件中的内部变量,但是当我尝试使用此变量时,出现错误显示此变量未定义。
我的问题是,如果我可以直接使用内部变量。如果没有,我应该如何使用它?
我正在对热传递中的 LMTD 方法进行编码,并且在同时使用 和 运算符两次以上时遇到了一些错误。
if (del_T1 > beta) and (del_T2 > beta) and (del_T1<>del_T2) then
T_LMTD = (del_T1-del_T2) / ( (log(del_T1)) - (log(del_T2)));
elseif (del_T1 > beta) and (del_T2 > beta) and (del_T1==del_T2) then
T_LMTD = (del_T1-del_T2) / 2;
elseif (del_T1 > beta) and (del_T2 < beta) then
T_LMTD = (del_T1 - beta) / ( (log(del_T1/beta)) * (1 - zeta * (del_T2 - beta)));
elseif (del_T1 < beta) and (del_T2 > beta) then
T_LMTD = (del_T2 - beta) / …Run Code Online (Sandbox Code Playgroud) 调整 PID 参数在控制系统开发中至关重要,这里有一个示例,说明如何仅对一个 PID 控制器执行此操作。 https://www.claytex.com/tech-blog/tuning-pid-gains-dymola-modelling/
但是如果 Modelica 模型中有多个 PID 控制器,是否有调整参数的标准程序?
是否有用于多个 PID 控制器调整的 Modelica 库?
I meet an error of using newton solver to solve nonlinear equation in Dymola, but the simulation ends with success, just like another question here,
my question is:
In the list of solvers, there is no newton solver, why would Dymola use newton solver?
Does Dymola choose dassal solver only when newton solver doesn't work?
我构建了一个简单的模型来理解“离散表达式”的概念,代码如下:
model Trywhen
parameter Real B[ :] = {1.0, 2.0, 3.0};
algorithm
when time>=0.5 then
Modelica.Utilities.Streams.print("message");
end when;
annotation (uses(Modelica(version="3.2.3")));
end Trywhen;
Run Code Online (Sandbox Code Playgroud)
但是在检查模型时,我收到一条错误消息,表明“time==0.5”不是离散表达式。

如果我更改time==0.5为time>=0.5,模型将通过检查。
如果我使用if-clauseto when-clause,该模型工作正常,但警告显示“不能比较 Real 类型的变量是否相等。”
我的问题是:
time==0.5不是离散表达式?我试图通过使用pre运算符来避免 Modelica 中的代数循环,但是当我使用类似的东西时pre(x>0.5),会出现Internal error in code generation for pre. 如果我使用pre(cond), wherecond是一个布尔类型变量,就不会有任何错误。
我的问题是:是否有一些pre运算符规定要求我不能在pre运算符中使用表达式。
下面是代码和截图:
model WithAlgebraicLoop_Wrong2
"Demonstration of how to avoid generating algebraic loop,
but end up with internal error in code generation for pre"
Real x,y(start=1,fixed=true);
equation
when pre(x>0.5) then
y=1*time;
end when;
x=sin(y*10*time);
end WithAlgebraicLoop_Wrong2;
Run Code Online (Sandbox Code Playgroud)
model WithAlgebraicLoop_Right "Demonstration of how to avoid generating algebraic loop"
Real x,y(start=1,fixed=true);
Boolean cond;
equation
cond=x>0.5;
when pre(cond) then
y=1*time; …Run Code Online (Sandbox Code Playgroud) 在我的模型中,我对为什么没有完全指定初始条件感到困惑。
下面是代码和截图:
model WithAlgebraicLoop_Right
extends Modelica.Icons.Example;
Real x;
Real y(start=1, fixed=true);
Boolean cond;
equation
cond = x > 0.5;
when pre(cond) then
y = 1*time;
end when;
x = sin(y*10*time);
end WithAlgebraicLoop_Right;
Run Code Online (Sandbox Code Playgroud)
我认为在初始化期间,x可以从 计算y,所以cond可以从 计算x,那么为什么 Dymola 没有像我想的那样做呢?
我正在制作可以在仿真循环中输入模型参数的接口包。为了连接接口包和仿真模型,我使用了 Standard Modelica Library Ver. 中的 Controlbus。3.2.2.
检查模型没问题,但是如果我模拟模型,则会弹出如下图所示的错误。
这是与这个模型相关的方程
Omega_e = Omega_d * N_t[N];
Alpha_d = der(Omega_d);
为了求解微分方程,我认为求解器需要 N_t 的特定参数。所以我把来自接口模型的参数放入并使用标准 Modelica 库中的 Controlbus 组件发送参数。
如上图,我肯定把参数。(参数的具体值被删除,因为它是机密)
我找不到这个错误的问题是什么。请帮帮我。
非常感谢。
Dymola 模拟的结果是 .mat 文件,该文件可能会很大。这里是一个电厂模型的一系列结果,模拟时间间隔是0-100000s,但我只需要90000到100000s期间的数据,那么有什么办法让Dymola只输出90000到100000s的数据呢?
我目前正在尝试重建论文“向具有集成季节性地热能存储的太阳能区域供热网过渡的策略”中提出的模型(https://ideas.repec.org/a/eee/energy/v228y2021ics0360544221009117.html)但总是遇到问题,模拟失败,因为Warning: Failed to solve nonlinear system using Newton solver.
对于该模型,我尝试使用 MoSDH 库(https://github.com/MoSDH/MoSDH)。
我无法在这个论坛上上传我的模型,但我很高兴与有兴趣研究我的问题的每个人分享。
我将添加错误消息的最后几行,以便更好地理解我的问题。
Warning: Failed to solve nonlinear system using Newton solver.
During initialization at time: 0
Tag: simulation.nonlinear[27]
Homotopy reducing
Warning: Failed to solve nonlinear system using Newton solver.
During initialization at time: 0
Tag: simulation.nonlinear[27]
Error: Integrator failed to start model.
... Error message from dymosim
ERROR: The simulation of FormhalsModellNachbau.SolarThermalTest3 FAILED
Run Code Online (Sandbox Code Playgroud)
我已经尝试过 Dassl 和 Cvode 解决案例,它们应该是最好的工作案例。两者都遇到了同样的问题。
是否有用 Modelica 编写的开源换热器库,涵盖不同类型的换热器?喜欢这个网页https://en.wikipedia.org/wiki/Heat_exchanger