Page 117 - ExtendSim User Guide
P. 117

Feedback
The practice of connecting an output of a model back to an input is called feedback; it is the main factor that causes complex behavior in continuous models. A model with feedback will cause the result of a calculation to be fed back to one of the original variables in the calcula- tion, influencing its own rate of change. Thus feedback causes iterative changes to model vari- ables as the simulation runs. The initial output variable ripples through the calculations such that the effect loops back and re-affects the ini- tial variable.
Delays in feedback loops
Concepts, Tips, and Techniques 91
Integration
Reservoir 3 model feeds contents of Holding Tank back to Equation block to calculate overflow
ExtendSim is designed to facilitate feedback in models, but using feedback correctly entails some additional modeling techniques. Since continuous models are recalculated at every time step, there will be a delay between when the initial variable first affects the model and when the chain of calculations ultimately and indirectly affects the initial variable. The introduction of a delay can cause the behavior of a model to change significantly, because there is a differ- ence between the effect that instantaneous access can cause and the response that would hap- pen if access is not instantaneous.
When you run a model that uses feedback, the feedback is delayed by one simulation time step. This happens because the output feedback signal has to be calculated before it can be used on the next simulation step, effectively delaying it for one time step. When feedback is delayed too much, it can have a deleterious effect as it arrives too late, causing the system to over- or under-compensate. Reducing the time step or delta time of the model will reduce feedback delay and result in a model with more accurate results. See “Determining which dt to use” on page 89 for more information.
Integration
Integration is a method of estimating the present value by estimating the past and/or future val- ues of the inputs, calculations, and outputs in a model. It is another way of summing or accu- mulating values when the input is a rate (expressed as units per time). The advantage of integration over just summing values is that integration will accumulate correctly when delta time is not exactly 1.0, making it especially useful in feedback models that need a smaller delta time to work well. A simple form of integration (Euler) just multiplies the input rates by delta time and accumulates the result.
The Holding Tank and Integrate blocks in the Value library have integration capabilities. You can also use ModL functions to add integration to blocks you create. The Holding Tank block accumulates and, if wanted, releases values. Its dialog gives the option to either sum or inte- grate the inputs. (Whichever option you choose will have an impact on the accuracy of contin- uous simulations. To learn more, see “Integration vs. summation in the Holding Tank block” on page 709.) The Integrate block is used to perform the mathematical function of integration in models.
☞ There is no feedback in the My Reservoir model you built in the ExtendSim Tutorial on page 23 and it uses a delta time of 1. For that model, the Holding Tank could be set to either sum its inputs or integrate them (but the end time would need to be adjusted). The Overflow
Continuous


































































































   115   116   117   118   119