我试着用I have explained here来模拟三维滑动体的一维系统。
下面是我实现的代码:
model friction
//constants
parameter Real muk = 0.2;
parameter Real mus = 0.3;
parameter Real m1 = 1.0;
parameter Real m2 = 2.0;
parameter Real m3 = 3.0;
parameter Real Fn12 = 3.0;
parameter Real Fn23 = 2.0;
parameter Real absTol = 0.1;
//variables
Real X1, X2, X3, V1, V2, V3, A1, A2, A3, F1, F2, F3, Ff12, Ff23, Fs12, Fs23;
initial equation
X1 = 0;
X2 = 0;
X3 = 0;
V1 = 0;
V2 = 0;
V3 = 0;
equation
F1 = 2 * sin(5 * time);
F2 = 2 * sin(7 * time);
F3 = 3 * sin(11 * time);
V1 = der(X1);
V2 = der(X2);
V3 = der(X3);
A1 = der(V1);
A2 = der(V2);
A3 = der(V3);
m1 * A1 = F1 - Ff12;
m2 * A2 = F2 + Ff12 - Ff23;
m3 * A3 = F3 + Ff23;
Fs12 = (m2 * F1 - m1 * (F2-Ff23)) / (m1 + m2);
Fs23 = (m3 * (F2 + Ff12) - m2 * F3) / (m2 + m3);
if abs(V1 - V2) < absTol and abs(Fs12) < mus * Fn12 then
Ff12 = Fs12;
else
Ff12 = muk * Fn12 * sign(V1 - V2);
end if;
if abs(V3 - V2) < absTol and abs(Fs23) < mus * Fn23 then
Ff23 = Fs23;
else
Ff23 = muk * Fn23 * sign(V2 - V3);
end if;
end friction;
Wolfram SystemModeler能够运行模拟直到t=6sec,但结果不是我所期望的I have explained here。当我使用OpenModelica解决仿真问题时,我得到以下错误:
C:/Users/foo/AppData/Local/Temp/OpenModelica/OMEdit/friction.exe-port=64457-xmltcp--=startTime=0,stopTime=10,stepSize=0.02,公差=1e-6,solver=dassl,outputFormat=mat,变量=0.2r=摩擦_res.mat-jacobian=coloredNumerical lv=coloredNumerical=xmltcp-r=0,solver=dassl,stepSize=0.02,solver=dassl,outputFormat=mat,solver=dassl,solver=dassl,outputFormat=mat,solver=dassl,outputFormat=mat,solver=dassl,solver=dassl,outputFormat=mat,变量,r=0.2,w-lv=0.0 0=coloredNumerical L-lv=0.0 2,0.0 2,0.2,0.2,0.2,0.2,0.2,0.2,0.2,0.2,0.2,0.2,0.2,0.2,0.2,0.2,0.2,0.2,0.2,0.2,0.2,0.2,0.2,0.2,0.2,0.2 0 2,0.2,0.2,0.2,0.2,0.2,0.2,0.2,0.2,0.2,0.2,0.2,0.2 0 2,0.2,0.2,0.2,0.2,0.2,0.2,0.2,0.2,0.2,0.2如需更多相关信息,请使用-lv/LOG_NLS。模拟过程失败.已退出与再编码-1.
如果你能帮我知道问题是什么以及我如何解决这个问题,我将不胜感激。
发布于 2017-11-13 15:42:15
你在尝试写你自己的摩擦模型。
在Modelica中,通常的方法是使用s-参数化,例如从: Modelica.Mechanics.Translational.Interfaces.PartialFriction继承(或者使用现有的模型)。
它的文档可在线访问:UsersGuide.html#Modelica.Mechanics.Rotational.UsersGuide.ModelingOfFriction
具体来说,Fs12和Fs23是粘附的最大摩擦力,如果粘着力是常数的话,这是有效的--但在这里,它们依赖于Ff12和Ff23,而它们又依赖于Fs12和Fs23,而后者不起作用。
发布于 2017-11-14 07:07:36
https://stackoverflow.com/questions/47224549
复制相似问题