Courses: Introduction to GoldSim:

Unit 9 - Representing Complex Dynamics: Delays

Lesson 9 - Exercise: Adding a Forecast to a Proportional Controller

In Unit 8, Lesson 9, we showed an example of a Proportional Controller that was used to control an outflow in order to maintain a target volume with a high variable (oscillating and increasing) uncontrolled inflow (Example6_Proportional_Controller).  You will recall that the Controller was unable to effectively manage the volume and return it to the target. It oscillated (like the inflow rate) around the target, and increasingly diverged from it:

The reason a Proportional Controller fails in this case is because the Bias is specified as a constant.  If you think about how a Proportional Controller works, you will realize that for Outflow Controllers like this, the Bias can be thought of as the sum of the expected uncontrolled inflows minus expected uncontrolled outflows (in this case there is one uncontrolled inflow and no uncontrolled outflows). Hence, if the error was currently at zero, the Bias is the outflow needed to maintain a zero error given the expected uncontrolled inflow.

If the uncontrolled inflow was relatively constant, a constant Bias (that represented that constant value of the uncontrolled inflow) would allow the Proportional Controller to perform well.  But in this case, the uncontrolled inflow is changing significantly (it is not only oscillating, but is also increasing). What if we made the Bias time-variable?  In particular, what if we made it a forecast of the expected uncontrolled inflow? 

We saw in the previous Lesson that we can use an Information Delay to create such a forecast. Let's do an Exercise that does exactly that.  

To create this model, do the following:

  • Go to the “Examples” subfolder of the “Basic GoldSim Course” folder you should have downloaded and unzipped to your Desktop, and open the model file we looked at in the previous Unit named Example6_Proportional_Controller.gsm. 
  • Replace the Data element named Bias with an Information Controller of the same name. The Input Signal for the Information Delay should be the Inflow. The Delay Time should be 1 day, the Dispersion should be 1 (Erlang n), and the Initial Value should be 5 m3/day.

 Stop now and try to build and run the model.

Once you are done with your model, save it to the “MyModels” subfolder of the “Basic GoldSim Course” folder on your desktop (call it Exercise11.gsm). If, and only if, you get stuck, open and look at the worked out Exercise (Exercise11_Proportional_Forecast.gsm in the “Exercises” subfolder) to help you finish the model.

Your model structure should look something like this:

If you run you model and look at the Results Time History Result element, it should look like this:

As can be seen, the Controller is able to track the target quite well now.  This should not be surprising, as the Controller is using more information: it is not only using the current value of the volume, but is also using the past values of the uncontrolled inflow.

You may recall from Unit 8, Lesson 10 that a PID Controller also performed quite well for this particular problem.  So for systems like this, what type of Controller should you use?  In general, both the PID Controller and the Proportional Controller with a forecast perform well in these situations.  Both require some effort to program. In particular,  a PID Controller has four “tuning parameters, and tuning the PID Controller can therefore require a bit of effort. On the other hand, in a complex model, collecting all of the uncontrolled inflows and outflows (in order to create the forecast to use as the Bias for a Proportional Controller) could also require a bit of effort. Hence, which you use will typically be based on your experience and level of comfort with each approach.