- Index
- » Usage and Applications
- » OpenModelica Usage and Applications
- » Matrix singular problem
Matrix singular problem
Matrix singular problem
I am trying out a very simple first order time integral and I keep having "Matrix singular!" problem during simulation.
Can someone point out what is wrong? I think something is fundamentally wrong here but I still can't figure it out for two days now >.<
The model that I try to simulate is the following:
model ModelExample
TimeIntegral timeintegral1 annotation(Placement(visible = true, transformation(origin = {4, -6}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
Modelica.Blocks.Sources.TimeTable timetable1(table = [0, 0; 0.05, 1; 0.1, 2]) annotation(Placement(visible = true, transformation(origin = {-66, 0}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
Modelica.Blocks.Sources.TimeTable timetable2(table = [0, 0; 0.05, 1; 0.1, 2]) annotation(Placement(visible = true, transformation(origin = {-66, 36}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
Modelica.Blocks.Sources.TimeTable timetable3(table = [0, 0; 0.05, 1; 0.1, 2]) annotation(Placement(visible = true, transformation(origin = {-66, 70}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
equation
connect(timetable3.y, timeintegral1.dot_x[3]) annotation(Line(points = {{-55, 70}, {-22, 70}, {-22, 0}, {-6, 0}}, color = {0, 0, 127}));
connect(timetable2.y, timeintegral1.dot_x[2]) annotation(Line(points = {{-55, 36}, {-28, 36}, {-28, 0}, {-6, 0}}, color = {0, 0, 127}));
connect(timeintegral1.x[3], timeintegral1.x0[3]) annotation(Line(points = {{14, -6}, {34, -6}, {34, -32}, {-22, -32}, {-22, -12}, {-6, -12}, {-6, -12}, {-6, -12}, {-6, -12}}, color = {0, 0, 127}));
connect(timeintegral1.x[2], timeintegral1.x0[2]) annotation(Line(points = {{14, -6}, {28, -6}, {28, -28}, {-18, -28}, {-18, -12}, {-6, -12}, {-6, -12}}, color = {0, 0, 127}));
connect(timeintegral1.x[1], timeintegral1.x0[1]) annotation(Line(points = {{14, -6}, {22, -6}, {22, -24}, {-14, -24}, {-14, -12}, {-8, -12}, {-8, -12}, {-8, -12}}, color = {0, 0, 127}));
connect(timetable1.y, timeintegral1.dot_x[1]) annotation(Line(points = {{-55, 0}, {-6, 0}, {-6, 0}, {-6, 0}}, color = {0, 0, 127}));
annotation(Icon(coordinateSystem(extent = {{-100, -100}, {100, 100}}, preserveAspectRatio = true, initialScale = 0.1, grid = {2, 2})), Diagram(coordinateSystem(extent = {{-100, -100}, {100, 100}}, preserveAspectRatio = true, initialScale = 0.1, grid = {2, 2})));
end ModelExample;
where TimeIntegral is a model defined as such:
model TimeIntegral
import SI = Modelica.SIunits;
parameter SI.Time delta_t = 0.01 "integration time step in seconds";
Modelica.Blocks.Interfaces.RealInput dot_x[3] annotation(Placement(visible = true, transformation(origin = {-110, 60}, extent = {{-10, -10}, {10, 10}}, rotation = 0), iconTransformation(origin = {-104, 60}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
Modelica.Blocks.Interfaces.RealInput x0[3](start = {0, 0, 0}) annotation(Placement(visible = true, transformation(origin = {-110, -60}, extent = {{-10, -10}, {10, 10}}, rotation = 0), iconTransformation(origin = {-104, -60}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
Modelica.Blocks.Interfaces.RealOutput x[3](start = {0, 0, 0}) annotation(Placement(visible = true, transformation(origin = {110, 0}, extent = {{-10, -10}, {10, 10}}, rotation = 0), iconTransformation(origin = {104, 0}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
equation
x = x0 + dot_x * delta_t;
annotation(Diagram(coordinateSystem(extent = {{-100, -100}, {100, 100}}, preserveAspectRatio = true, initialScale = 0.1, grid = {2, 2})), Icon(coordinateSystem(extent = {{-100, -100}, {100, 100}}, preserveAspectRatio = true, initialScale = 0.1, grid = {2, 2}), graphics = {Text(origin = {120, 10}, extent = {{-8, 6}, {8, -6}}, textString = "x"), Text(origin = {-124, -40}, extent = {{-8, 6}, {8, -6}}, textString = "x0"), Text(origin = {-122, 60}, extent = {{-8, 6}, {8, -6}}, textString = "dot_x"), Rectangle(origin = {0, -2}, extent = {{-96, 88}, {96, -88}}), Text(origin = {7, 2}, extent = {{-53, 18}, {53, -18}}, textString = "x = x0 + delta_t*dot(x)")}));
end TimeIntegral;
- Index
- » Usage and Applications
- » OpenModelica Usage and Applications
- » Matrix singular problem