Opened 13 years ago

Closed 12 years ago

#1611 closed defect (invalid)

TriggeredSampler with Feedback leads to Internal Error

Reported by: Peter Junglas Owned by: Peter Junglas
Priority: high Milestone:
Component: Backend Version:
Keywords: Cc: Peter Junglas, Frenkel, TUD, Willi Braun

Description

Running the model {{triggeredsampler1}} leads to the error
{{{ Error: Internal error BackendDAEUtil.incidenceMatrix failed

Error: Internal error sorting equations(strong components failed)}}}

The model {{triggeredsampler2}}, using a TriggeredSampler without feedback, works.

Attachments (2)

triggeredsampler1.mo (445 bytes ) - added by Peter Junglas 13 years ago.
triggeredsampler2.mo (331 bytes ) - added by Peter Junglas 13 years ago.

Download all attachments as: .zip

Change History (5)

by Peter Junglas, 13 years ago

Attachment: triggeredsampler2.mo added

comment:1 by Per Östlund, 13 years ago

The problem seems to be that BackendDAETransform.findDiscreteEquation gets a BackendDAE.WHEN_EQUATION which it doesn't know what to do with.

comment:2 by Willi Braun, 13 years ago

The is problem is that the model produce an algebraic loop involving a when equation, which is not that easy to solve(Dymola does not support that model). You can change the model and break the loop by using the pre operator.
My suggestion:

model triggeredsampler1
  Modelica.Blocks.Sources.BooleanPulse booleanpulse1(period = 3);
  Modelica.Blocks.Discrete.TriggeredSampler triggeredsampler1;
  Modelica.Blocks.Math.Add add1(k1 = -1);
  Modelica.Blocks.Sources.Constant constant1(k = 1);
  Modelica.Blocks.Interfaces.RealOutput tmp;
equation
  pre(add1.y) = tmp;
  connect(tmp,triggeredsampler1.u);
  connect(constant1.y,add1.u2);
  connect(triggeredsampler1.y,add1.u1);
  connect(booleanpulse1.y,triggeredsampler1.trigger);
end triggeredsampler1;

However, we need there a better error message.

comment:3 by Peter Junglas, 13 years ago

Thanks, that works for me.

comment:4 by Martin Sjölund, 12 years ago

Cc: Frenkel TUD added; Jens Frenkel removed
Component: Backend
Resolution: invalid
Status: acceptedclosed

Error-message now says "[...] Try to break the loop by using the pre operator [...]"

Note: See TracTickets for help on using tickets.