Dear Friends
I am implementing a digital controller using the function WhenEvent
SolH = NDSolve[{EqnsC, InitsC, control}, VarsC, {t, 0, tf},
DiscreteVariables -> \[ScriptD][t]];
Plot[{Subscript[\[ScriptI], \[ScriptL]][t], \[ScriptD][t]} /.
SolH, {t, 0.0025, tf}]
the control input is updated every h seconds
h = 0.00001;
control = WhenEvent[Mod[t, h] == 0, \[ScriptD][t] -> ucontrol];
The simulation develops well when ucontrol= constant but it does not when I plug in my design function. It seem that the control which a large function of systems states reminds unevaluated. What I am doing wrong? I have followed the documentation.
Hopefully someone out there will have a suggestion.
I am including a notebook that contains the system specifications.
Best regards
Jesus
Attachments: