# proportional-integral (PI) controller in Vensim

In my last post, I discussed an attempt at designing a PID controller using the Kepler Scientific Workflow system. Here I report on a similar (yet successful) development of a proportional-integral (PI) controller in Vensim PLE. Vensim is a software package for describing and simulating dynamic models, particularly those involving feedback. I’ve often described it as a tool for “point and click differential equations” since it allows users to draw models for simulation using a mouse that would ordinarily require specification as a set of differential equations.

A PI controller is a feedback control system configuration where the difference (error) between a system response and a desired set point is directed toward a proportional multiplier and an integrator. Each of the proportional multiplier and integrator values are in turn multiplied by constants, called “gains”, and then both results are summed together. The resulting value is then directed toward the input of the system. As the system response gets closer to the set point, the calculated input value approaches a constant.

Most real-world instances of PI controllers often have a “D” component as well, and are called “PID” controllers. The “D” stands for “derivative”, but I was not able to make Vensim PLE calculate derivatives so I left this feature out.

The basic system we are controlling looks like:

We want to control the value of the reservoir by adjusting the inward flow. The outward flow is not controlled, and it equals a positive constant multiplied by the reservoir’s value. Because the outward flow is greater than zero whenever the reservoir value is greater than zero, we always have to replenish the reservoir using the inward flow if we want its value to stay constant. For this exercise we want to control the inward flow so that the reservoir’s value equals ten. The reservoir’s initial value is zero for this experiment.