I try to obtain the maximum value of a continuous variable. For this I have used two different approaches:
For the two approaches u = input and y = output (i.e. the max value of u)
1 - y=max((u), y)
This solution involvess non-linear solving and makes th e simulation heavier.
2- Detection of a max value by using a derivative of the input signal u. Comparing this value with the precendent detecting local maximum and keeping the bigger (bloc triggeredMax in the standard Modelica Library).
This solution requires a derivation and is not efficient in case of a monotonic varaition of the input signal.
Do you know another more efficient solution ?
Thanks in advance.
Have you tried something along the lines of
to avoid the nonlinear equation?
Itīs not so easy using continuous signals. Using discrete signals is very easy but leads to slower simulation speed.
Another approach (not tested) could be:
How about this:
Powered by Invision Power Board (http://www.invisionboard.com)
© Invision Power Services (http://www.invisionpower.com)