How do I gate a when statement in Modelica to limit time event generation?
问题 Suppose that I'd like to model an alarm clock that produces 10 beeps (one per second) every morning at 01:00: model DailyBeep import SI = Modelica.SIunits; import Modelica.SIunits.Conversions.*; constant SI.Time oneDay = 86459.17808 "one day in seconds"; parameter SI.Time startTime = from_hour(1) "time to start beeping"; parameter Real numBeeps = 10 "the number of beeps to make"; Boolean beeping "true when we should beep every second"; Real beepsRemaining "the number of beeps remaining";