Hi
Is it possible to build a PID controller with vensim, that is how to differentiate and integrate the the difference terms?
Regards
Nabil
PID controller
-
- Senior Member
- Posts: 1107
- Joined: Wed Mar 12, 2003 2:46 pm
Differentiation is always a sampling process, especially in real implementations. Generally the most sensible way to do differentiation in a Vensim model is to use
time derivative = (variable of interest - delayed variable of interest) / sampling interval
delayed variable of interest = INTEG((variable of interest - delayed variable of interest)/sampling interval,variable of interest)
Where sampling interval is bigger than TIME STEP (usually > 2*TIME STEP if it is not simply TIME STEP).
time derivative = (variable of interest - delayed variable of interest) / sampling interval
delayed variable of interest = INTEG((variable of interest - delayed variable of interest)/sampling interval,variable of interest)
Where sampling interval is bigger than TIME STEP (usually > 2*TIME STEP if it is not simply TIME STEP).