Archived OpenModelica forums. Posting is disabled.

Alternative forums include GitHub discussions or StackOverflow (make sure to read the Stack Overflow rules; you need to have well-formed questions)


Forgot password? | Forgot username? | Register
  • Index
  • » Users
  • » jiotem
  • » Profile

Posts

Posts

Oct-01-15 14:13:15
Category: Programming

Hi,
I'm trying to simulate a ball-type linear drive.
The check of the model completes successfully in both OpenModelica and Dymola, but when I'm trying to simulate the model it breaks.
I don't see the mistake I made and it would be nice if someone could help me.

The error message is:
Failed to solve linear system of equations (no. 820) at time 0.000000, system is singular for U[2, 2].
The default linear solver fails, the fallback solver with total pivoting is started at time 0.000000. That might raise performance issues, for more information use -lv LOG_LS.
Matrix singular!
Failed to solve linear system of equations (no. 886) at time 0.000000, system is singular for U[6, 6].
The default linear solver fails, the fallback solver with total pivoting is started at time 0.000000. That might raise performance issues, for more information use -lv LOG_LS.
Matrix singular!

Here is the code I'm using

Code:


model ballTypeLinearDrive
  inner Modelica.Mechanics.MultiBody.World world annotation(Placement(transformation(extent = {{-80, 10}, {-60, 30}})));
  Modelica.Mechanics.MultiBody.Parts.BodyCylinder screwShaft(diameter = 0.2, innerDiameter = 0, z_0_fixed = false, w_0_fixed = false, animation = true, lengthDirection = {1, 0, 0}, length = 2, r = {1, 0, 0}, angles_start = {0, 0, 0}, angles_fixed = false) annotation(Placement(transformation(extent = {{14, 10}, {34, 30}})));
  Modelica.Mechanics.MultiBody.Parts.BodyCylinder screwNut(length = 0.1, diameter = 0.5, innerDiameter = screwShaft.diameter, lengthDirection = {1, 0, 0}, animation = true, r_shape = {0, 0, 0}, r = {1, 0, 0}, w_0_fixed = false, angles_fixed = false) annotation(Placement(transformation(extent = {{78, 10}, {98, 30}})));
  Modelica.Mechanics.MultiBody.Joints.Revolute revolute(useAxisFlange = true, n = {1, 0, 0}) annotation(Placement(transformation(extent = {{-20, 10}, {0, 30}})));
public
  Modelica.Mechanics.MultiBody.Parts.BodyBox bearing(length = 0.1, width = 0.1, height = 0.1, color = {215, 215, 215}, animation = true) annotation(Placement(transformation(extent = {{-50, 10}, {-30, 30}})));
  Modelica.Mechanics.Rotational.Sources.Torque torque(useSupport = false) annotation(Placement(transformation(extent = {{-30, 52}, {-10, 72}})));
  Modelica.Blocks.Sources.Ramp ramp(duration = 1, height = 1, offset = 0, startTime = 0) annotation(Placement(transformation(extent = {{-62, 52}, {-42, 72}})));
  Screw screw annotation(Placement(transformation(extent = {{46, 10}, {66, 30}})));
equation
  connect(revolute.frame_b, screwShaft.frame_a) annotation(Line(points = {{0, 20}, {14, 20}}, color = {95, 95, 95}, thickness = 0.5, smooth = Smooth.None));
  connect(bearing.frame_b, revolute.frame_a) annotation(Line(points = {{-30, 20}, {-20, 20}}, color = {95, 95, 95}, thickness = 0.5, smooth = Smooth.None));
  connect(torque.flange, revolute.axis) annotation(Line(points = {{-10, 62}, {-10, 30}}, color = {0, 0, 0}, smooth = Smooth.None));
  connect(ramp.y, torque.tau) annotation(Line(points = {{-41, 62}, {-32, 62}}, color = {0, 0, 127}, smooth = Smooth.None));
  connect(world.frame_b, bearing.frame_a) annotation(Line(points = {{-60, 20}, {-50, 20}}, color = {95, 95, 95}, thickness = 0.5, smooth = Smooth.None));
  connect(screw.frame_a, screwShaft.frame_b) annotation(Line(points = {{46, 20}, {34, 20}}, color = {95, 95, 95}, thickness = 0.5, smooth = Smooth.None));
  connect(screw.frame_b, screwNut.frame_a) annotation(Line(points = {{66, 20}, {78, 20}}, color = {95, 95, 95}, thickness = 0.5, smooth = Smooth.None));
  annotation(Diagram(graphics));
end ballTypeLinearDrive;

I couldn't find any model of a screw, so I tried to make one on my own:

Code:


model Screw
  import SI = Modelica.SIunits;
  SI.Angle[3] phi(start = {0, 0, 0});
  SI.Position[3] s;
  Real[3, 3] R;
  parameter Real k = 0.5;
  Modelica.Mechanics.MultiBody.Interfaces.Frame_a frame_a "Coordinate system fixed to the component with one cut-force and cut-torque" annotation(Placement(transformation(extent = {{-116, -16}, {-84, 16}}, rotation = 0)));
  Modelica.Mechanics.MultiBody.Interfaces.Frame_b frame_b "Coordinate system fixed to the component with one cut-force and cut-torque" annotation(Placement(transformation(extent = {{84, -16}, {116, 16}}, rotation = 0)));
protected
  outer Modelica.Mechanics.MultiBody.World world;
equation
  frame_a.R.w = der(phi);
  R = [1, 0, 0; 0, cos(phi[1]), -1 * sin(phi[1]); 0, sin(phi[1]), cos(phi[1])];
  for i in 1:3 loop
    frame_b.R.T[i, 2] = frame_a.R.T[i, 2] * R[i, 2];
  end for;
  frame_b.r_0 = frame_a.r_0 - s;
  s = {phi[1] * k, 0, 0};
  frame_a.f = -frame_b.f;
  frame_a.t = -frame_b.t;
  annotation(Icon(coordinateSystem(preserveAspectRatio = true, extent = {{-100, -100}, {100, 100}}, grid = {1, 1}), graphics = {Text(extent = {{-136, -25}, {-100, -50}}, lineColor = {128, 128, 128}, textString = "a"), Text(extent = {{100, -25}, {136, -50}}, lineColor = {128, 128, 128}, textString = "b"), Rectangle(extent = {{-53, 50}, {63, -64}}, lineColor = {0, 0, 255}, fillColor = {175, 175, 175}, fillPattern = FillPattern.Solid)}), Documentation(info = "<HTML>
<p>

</p>
</HTML>"), Diagram(coordinateSystem(preserveAspectRatio = true, extent = {{-100, -100}, {100, 100}}, grid = {1, 1}), graphics));
end Screw;

This is what it says when I'm using Dymola:
Log-file of program ./dymosim
(generated: Thu Oct 01 16:04:00 2015)

dymosim started
... "dsin.txt" loading (dymosim input file)
... "ballTypeLinearDrive.mat" creating (simulation result file)

Integration started at T = 0 using integration method DASSL
(DAE multi-step solver (dassl/dasslrt of Petzold modified by Dynasim))
ERROR: Failed to solve non-linear system using Newton solver.To get more information: Turn on Simulation/Setup/Debug/Nonlinear solver diagnostics/DetailsSolution to systems of equations not found at time = 2E-006   Nonlinear system of equations number = 2   Infinity-norm of residue = 1.0002E-011   Iteration is not making good progress.   Accumulated number of residue       calc.: 549   Accumulated number of symbolic Jacobian calc.: 246   Last values of solution vector:screwNut.body.Q[2] = 0
screwNut.body.Q[4] = 1
screwNut.body.Q[3] = 0Title
screwNut.body.Q[1] = 0
screw.phi[1] = 0
revolute.phi = 0
   Last values of residual vector:{ 1.33227E-015, 0, 6.66134E-016, 0, -1E-011,
  0 }
Solver will attempt to handle this problem.
[...]

  • Index
  • » Users
  • » jiotem
  • » Profile
You are here: