Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/cmake/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Modelica 无法解线性方程组_Modelica_Openmodelica - Fatal编程技术网

Modelica 无法解线性方程组

Modelica 无法解线性方程组,modelica,openmodelica,Modelica,Openmodelica,我在试着破解密码 model modelTest // types type Mass = Real (unit = "Kg", min = 0); type Length = Real (unit = "m"); type Area = Real (unit = "m2", min = 0); type Force = Real (unit = "Kg.m/s2"); type Pressur

我在试着破解密码

model modelTest

// types
  type Mass = Real (unit = "Kg", min = 0);
  type Length = Real (unit = "m");
  type Area = Real (unit = "m2", min = 0);
  type Force = Real (unit = "Kg.m/s2");
  type Pressure = Real (unit = "Kg/m/s2");
  type Torque = Real (unit = "Kg.m2/s2");
  type Velocity = Real (unit = "m/s");
  type Time = Real (unit = "s");

// constants
  constant Real pi = 2 * Modelica.Math.asin(1.0);
  parameter Mass Mp = 0.01;
  parameter Length r1 = 0.010;
  parameter Integer n = 3;
  parameter Area A = 0.020 * 0.015;
  parameter Time Stepping = 0.1;
  parameter Real DutyCycle = 0.5;
  parameter Pressure Pin = 5000;
  parameter Real Js = 1;

// variables
  Length x[n];
  Velocity vx[n];
  Real theta;
  Real vt;
  Pressure P[n]; 

initial equation
  theta = 0;
  vt = 0;

algorithm
  for i in 1:n loop
    if noEvent((i - 1) * Stepping < mod(time, Stepping)) and noEvent(mod(time, Stepping) < (i - 1) * Stepping + Stepping * DutyCycle) then
      P[i] := Pin;
    else
      P[i] := 0;
    end if;
  end for;

equation
  vx = der(x);
  vt = der(theta);
  x = r1 * {sin(theta + (i -1) * 2 * pi / n) for i in 1:n};
  Js * der(theta) = r1 * sum((Mp * der(vx) + P * A) .* {cos(theta + (i -1) * 2 * pi / n) for i in 1:n});

annotation(
    experiment(StartTime = 0, StopTime = 10, Tolerance = 1e-6, Interval = 0.01),
    __OpenModelica_simulationFlags(lv = "LOG_STATS", outputFormat = "mat", s = "dassl"));
end modelTest;
模型试验
//类型
类型质量=实际质量(单位=“Kg”,最小值=0);
类型长度=实际长度(单位为m);
类型面积=实际面积(单位=“m2”,最小值=0);
类型力=实际力(单位=“Kg.m/s2”);
类型压力=实际压力(单位=“Kg/m/s2”);
类型扭矩=实际扭矩(单位=“Kg.m2/s2”);
类型速度=实际速度(单位为m/s);
类型时间=实际时间(单位为秒);
//常数
常数实pi=2*Modelica.Math.asin(1.0);
参数质量Mp=0.01;
参数长度r1=0.010;
参数整数n=3;
参数面积A=0.020*0.015;
参数时间步进=0.1;
参数Real DutyCycle=0.5;
参数压力销=5000;
参数Real Js=1;
//变数
长度x[n];
速度vx[n];
真θ;
真实vt;
压力P[n];
初始方程
θ=0;
vt=0;
算法
对于1:n循环中的i
如果noEvent((i-1)*步进
但解算器从未完成显示错误:

未能解决线性方程组(第51号)在时间。。。剩余范数是

默认线性解算器失败,回退解算器在时间点总旋转。。。这可能会破坏plv日志

如果您能帮助我了解问题所在以及如何解决,我将不胜感激。提前感谢您的支持

p.S.1.我15个月前发现的

p.S.2.代码中有几个错误。可以找到修改后的版本