问题描述
我尝试使用 Modelica 在 Twinbuilder 中对液压系统进行建模.但是我总是遇到错误,我认为这与收敛问题有关.为了理解问题是什么,我将我的系统简化为动态管道、固定边界和扫描体积,其运动将由正弦函数给出.但是在这种简化的情况下,我仍然遇到错误.即使收到警告,我也能够编译模型.当我尝试求解模型时,.它没有解决.我想问一下你对这个问题有什么建议吗?
这是模型的框图
我在尝试求解模型时遇到的错误如下:
在 Hochdruckreiniger3_1 上进入初始化模式时发生错误.
在用户模型的初始化函数中遇到错误.
初始化模拟器时遇到错误
残差函数评估在1"的初始点失败来自 Hochdruckreiniger3_1:雅可比评估在1"的初始点失败来自 Hochdruckreiniger3_1:未能在1"中的事件迭代中找到一致的解决方案,0 在 0.0000000000000000E+000来自 Hochdruckreiniger3_1:残差函数评估在3"的初始点失败#r171#"来自 Hochdruckreiniger3_1:初始化失败.
代码如下:
模型 Hochdruckreiniger3//声明真实 V_max = 0.000003;真实 V_tod = 0.000002;实际圆周率 = 3.14;真实 N = 2800;//组件)Modelica.Fluid.Machines.SweptVolume Swept1 (活塞横截面积 = 0.0001131,间隙 = 0.00000250621,重新声明包 Medium = Modelica.Media.Water.StandardWater,nPorts = 1,use_portsData = 真,use_T_start = true,T_start = 293.15);内部 Modelica.Fluid.System 系统;Modelica.Mechanics.Translational.Sources.Position Posit1 (exact = true, useSupport = false);Modelica.Blocks.Sources.Sine Sine1 (振幅 = 0.005567,频率Hz = 46.72,偏移量 = 0.005567,相位 = -pi/2);Modelica.Fluid.Sources.FixedBoundary 边界(p = 4e5,重新声明包Medium = Modelica.Media.Water.StandardWater,nPorts = 1);Modelica.Fluid.Pipes.DynamicPipe pipe1 (长度 = 0.5,直径 = 0.03,重新声明包 Medium = Modelica.Media.Water.StandardWater,modelStructure = Modelica.Fluid.Types.ModelStructure.av_b);方程//连接连接(Posit1.flange,Swept1.flange);连接(Sine1.y,Posit1.s_ref);连接(pipe1.port_b,Swept1.ports[1]);连接(边界.端口[1],pipe1.port_a);结束 Hochdruckreiniger3;
Dymola 在您的模型中显示两个错误:
pi
必须是constant
或parameter
以符合phase
中参数的可变性代码>正弦代码>块.顺便说一下,参考Modelica.Constants.pi
是一种很好的做法.- 在
swept1
中设置use_portsData = true
但不提供任何端口数据.
解决这两个问题后,模型会模拟但会警告您未明确设置初始值.
I try to model a hydraulic system in Twinbuilder with Modelica. But I get always errors which I think has to do with convergence problem. To understand what the problem is, I simplified my system to a dynamic pipe, fixed boundary, and swept volume whose movement will be given by a sinus function. But I still get an error in this simplified case. I am able to compile the model even though I get warnings. When I try to solve the model,. It is not solved. I want to ask if you give me a suggestion on this problem?
This is block diagramm of the model
Errors which I get when I try to solve the model are as follows:
The code is as follows:
model Hochdruckreiniger3
//Declaration(s)
Real V_max = 0.000003;
Real V_tod = 0.000002;
Real pi = 3.14;
Real N = 2800;
//Component(s)
Modelica.Fluid.Machines.SweptVolume Swept1 (
pistonCrossArea = 0.0001131,
clearance = 0.00000250621,
redeclare package Medium = Modelica.Media.Water.StandardWater,
nPorts = 1,
use_portsData = true,
use_T_start = true,
T_start = 293.15);
inner Modelica.Fluid.System system;
Modelica.Mechanics.Translational.Sources.Position Posit1 (exact = true, useSupport = false);
Modelica.Blocks.Sources.Sine Sine1 (
amplitude = 0.005567,
freqHz = 46.72,
offset = 0.005567,
phase = -pi/2);
Modelica.Fluid.Sources.FixedBoundary boundary (p = 4e5, redeclare package Medium = Modelica.Media.Water.StandardWater, nPorts = 1);
Modelica.Fluid.Pipes.DynamicPipe pipe1 (
length = 0.5,
diameter = 0.03,
redeclare package Medium = Modelica.Media.Water.StandardWater,
modelStructure = Modelica.Fluid.Types.ModelStructure.av_b);
equation
//Connection(s)
connect(Posit1.flange, Swept1.flange);
connect(Sine1.y, Posit1.s_ref);
connect(pipe1.port_b, Swept1.ports[1]);
connect(boundary.ports[1], pipe1.port_a);
end Hochdruckreiniger3;
Dymola shows two errors in you model:
pi
must be aconstant
orparameter
to comply with the variability of the parameterphase
in thesine
block. By the way, it is good practice to refer toModelica.Constants.pi
.- in
swept1
you setuse_portsData = true
but don´t provide any port data.
Fixing these two issues, the model simulates but warns you about initial values not being explicitly set.
这篇关于动态管道系统的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!