-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Dear all,

I am running the following model using 1.9.1+dev (r20342) (RML version)

The model works fine, unless I uncomment the two lines in RLC.
Basically I want to grab the event when the voltage reaches the
Hi-level after a switch occurred. However, the output will generate an
awful lot of events (basically shattering between the -Hi level and
the expected gradual level). Is this expected? Is there a known way to
have the outc variable only capture the expected event?

//run.mos
loadModel(ModelicaServices);
loadModel(Modelica);
loadFile("signals.mo");
simulate(Signals.RLC, stopTime=1.0, tolerance=1e-12, outputFormat="wall"
);

//signals.mo
package Signals

import Modelica.Electrical.Analog.Interfaces;
import Modelica.Electrical.Analog.Basic;
import Modelica.Electrical.Analog.Sources;

constant Real Low = 1;
constant Real Hi = 12;

model Signal
  extends Interfaces.OnePort;
  discrete Real voltage(start = Low);
  equation
  v = voltage;
end Signal;

model RLC
  Signal signal;
  Basic.Inductor inductor(L=1e-2);
  Basic.Capacitor capacitor(C=1e-5);
  Basic.Resistor resistor(R=1e3);
  Basic.Ground ground;
  //discrete Boolean out(start=false);
equation
  connect(inductor.n, resistor.n);
  connect(capacitor.p, inductor.n);
  connect(inductor.p, signal.p);
  connect(capacitor.n, ground.p);
  connect(resistor.p, ground.p);
  connect(signal.n, ground.p);

  when time > 0.5 then
    signal.voltage = Hi;
  end when;

  //out = resistor.v < -Hi;

end RLC;

end Signals;


- -- 
Christoph Höger

Technische Universität Berlin
Fakultät IV - Elektrotechnik und Informatik
Übersetzerbau und Programmiersprachen

Sekr. TEL12-2, Ernst-Reuter-Platz 7, 10587 Berlin

Tel.: +49 (30) 314-24890
E-Mail: christoph.hoe...@tu-berlin.de
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iEYEARECAAYFAlU/WhYACgkQhMBO4cVSGS8YbwCdHMjj2t7MRwVl/KDLvhLy24IE
2dwAnRyP9R/3KwA5xsNtz7ER2ii1Xz9r
=brN8
-----END PGP SIGNATURE-----

Reply via email to