Ticket #74 (new defect)
how to re-initialze a contiuous variable which isn't a state
| Reported by: | AHaumer | Owned by: | ModelicaDesignList |
|---|---|---|---|
| Priority: | normal | Milestone: | Design58 |
| Component: | --Modelica Specification-- | Version: | 3.0 |
| Severity: | normal | Keywords: | reinit |
| Cc: | Hide ticket: | no |
Description
The Modelica specification doesn't allow to reinit a continuous variable which isn't a state;
but how should I get the peak value of a signal with respect to predefined periods:
block PosPeak "Positive peak during one period"
extends Modelica.Blocks.Interfaces.SISO;
parameter Modelica.SIunits.Frequency f=1 "Basic signal frequency";
protected
Real x;
equation
x=max(u,x);
when sample(0, 1/f) then
y=x;
reinit(x,u); // not standard compliant!
end when;
end PosPeak;
Attachments
Change History
Note: See
TracTickets for help on using
tickets.
