I have a problem when simulating a model. I hope that you can help me as usual..
Let's take a look to this part of my code:
CODE
...
Boolean test(start=true);
equation
// test = true <-- i can't do this, error of singularity.
when change(transdin1.numbeventT) then
reinit( x, dout1.s);
test= false;
end when;
if x <= 0.6 and [b]test[/b] then
der(x)= 2*x;
elseif (change(din1.numbevent) and x<= 0.6 and test) then
der(x)= 2*x;
else
der(x)= 0;
end if;
I would to initialize the variable test.. but i can do it in the equation part. I had done this in the algorithm part of my model but in simulating a have a message error like this:
QUOTE
The current version of Dymola cannot generate code for algebraic loops involving when equations or algorithms with when parts. You may be able to cut the loop by putting 'pre' around some of the references to unknown continuous time variables in when parts or when conditions.
So my problem is that i want to initialise my variable test by true.. For one cycle of simulation, the simulation is ok, but for the second cycle the simulation is wrong because the variable test is false since it changes from true to false..
I am using Dymola version 6.0d.
Thank you
Regards,
Jawhar
