Opened 4 years ago

Last modified 4 years ago

#6254 assigned defect

Backend fails with discrete-time first order model — at Initial Version

Reported by: Rüdiger Franke Owned by: Karim Adbdelhak
Priority: critical Milestone:
Component: Backend Version: 1.16.0
Keywords: Cc: Karim Adbdelhak

Description

The below model samples a FirstOrder model. -d=backenddaeinfo says:

[7] 18:26:42 Symbolisch Meldung
Torn system details for strict tearing set:
 * Linear torn systems: 1 {(1,100.0%) 1}
 * Non-linear torn systems: 0

-d=dumpSimCode shows the following equation system -- without Jacobian and with index: -1 !?

10:  (LINEAR) index:0 jacobian: false 
        variables: 
index: -1: firstOrder.y (no alias)  initial: firstOrder.y_start no arrCref index:() []  
        b-vector: 
        8: $DER.firstOrder.y=(firstOrder.k * firstOrder.u - firstOrder.y) / firstOrder.T [Real] 
        9: interval() * (if firstTick() then 0.0 else $DER.firstOrder.y) + previous(firstOrder.y) - firstOrder.y (RESIDUAL) 

The C runtime reports "Failed to solve linear system of equations (no. 10) at time 0.000000, system is singular for U[2, 2].".
The Cpp runtime removes the equation during code generation.

model DiscreteTimeLoop
  Modelica.Blocks.Continuous.FirstOrder firstOrder(T = 1)  annotation(
    Placement(visible = true, transformation(origin = {18, 10}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
  Modelica_Synchronous.RealSignals.Sampler.SampleClocked sample1 annotation(
    Placement(visible = true, transformation(origin = {-24, 10}, extent = {{-6, -6}, {6, 6}}, rotation = 0)));
  Modelica_Synchronous.ClockSignals.Clocks.PeriodicRealClock periodicClock1(period = 0.1)  annotation(
    Placement(visible = true, transformation(origin = {-54, -44}, extent = {{-6, -6}, {6, 6}}, rotation = 0)));
  Modelica.Blocks.Interfaces.RealInput u(start = 1)  annotation(
    Placement(visible = true, transformation(origin = {-82, 10}, extent = {{-8, -8}, {8, 8}}, rotation = 0), iconTransformation(origin = {-72, 10}, extent = {{-20, -20}, {20, 20}}, rotation = 0)));
equation
  connect(u, sample1.u) annotation(
    Line(points = {{-82, 10}, {-32, 10}, {-32, 10}, {-32, 10}}, color = {0, 0, 127}));
  connect(sample1.y, firstOrder.u) annotation(
    Line(points = {{-18, 10}, {6, 10}, {6, 10}, {6, 10}}, color = {0, 0, 127}));
  connect(periodicClock1.y, sample1.clock) annotation(
    Line(points = {{-48, -44}, {-24, -44}, {-24, 2}, {-24, 2}}, color = {175, 175, 175}));

annotation(
    uses(Modelica(version = "3.2.3"), Modelica_Synchronous(version = "0.93.0")));
end DiscreteTimeLoop;

Change History (0)

Note: See TracTickets for help on using tickets.