I am trying to understand the Modelica semantics for a discrete signal. Given a step signal that instantaneously transitions from 0.0 to 1.0 with infinite slope at t = 0.5. Then let's say you also have a when statement as in the following code:
model test_discrete
Modelica.Blocks.Interfaces.RealOutput q(start = -1.0);
Modelica.Blocks.Sources.Step step(
height=1,
offset=0,
startTime=0.5)
algorithm
when time >= 0.5 and time <= 0.5 then
q := step.y;
end when;
equation
end test_discrete;
My question is whether q will be 0.0 or 1.0? Lets assume q is initialized to -1. When I implement the code, it transitions to 1.0, but my confusion is that 0.0 would also satisfy the equation. So I am just wondering if there are any rules to prevent non-determinant behavior. If someone could help or point me to any literature, that would be greatly appreciated! Thanks for your time.