ITK 115
Delayed Feedback


Objectives:

  • Gain experience...
    • designing systems dynamics models
    • with behavior patterns of complex systems
    • working with Vensim
  • Learn to perform reality check on simulation results.
  • Learn effect of delayed feedback on system behavior.

Let's get started....

  • Click on the Open icon
  • Load the Drug model from the previous "Feedback Loops" lab (add dosage with initial value of 0.05 and ingesting = dosage)
            stock and flow diagram
Run a simulation creating a dataset named run1.

Reality Check

Examine the graphs of all the variables to see if they pass a reality check. That is, does the model behave as the real world would behave? Are the values of the variables realistic? For example, is absorbing always positive?

Changing the System to Affect Behavior

OK, everything looks reasonable, but what if, for medical reasons, the concentration in the blood stream must ramp up faster than this model indicates it will (but still to the same level)? Let's try some changes to the system to see how behavior is affected.

Change 1: Let's try using a higher dose--say making "ingesting" equal .07

  • Click on the Equations icon
  • Click on the dosage variable
  • Change the value to .07
  • Click OK

Run the model (run2) and display the graph of Drug in Bloodstream.

graph of drug in bloodstream

The top (blue) line is the result of the higher dosage. The concentration in the blood does ramp up faster but it also levels off at a higher level. This higher level is unacceptable, so, we have to search for another solution than will have the higher ramp-up rate but rise to the lower level.

Change 2: Let's see what would happen if we started treatment by giving the patient an IV that produces an initial level of Drug in Bloodstream of .5 after which the patient will take the same pills as originally.

Change Drug in Bloodstream to have an initial value of .5

  • Click on the Equations icon
  • Click on the Drug in Bloodstream variable
  • Enter .5 in the "Initial Value" box
  • Click OK
  • Change "ingesting" back to .05
    • Click on the dosage variable
    • Change the value to .05
    • Click OK

    graph of drug in bloodstream

    Eureka! the green graph line shows the drug in bloodstream level beginning at .5, dropping slightly before the first pill is taken, and then rising to the same level as in the first case.

    Now this looks great but what if a situation arises where it is impossible to give an IV?

    Change 3: Let's try varying the dose over time; starting at a high level and then decreasing it. Change the structure of the system to add a goal for the level of drug in the blood. The dose will be higher the further the actual level is from the desired level. Thus, to start, the difference will be high so a high dose will be given. Then as the amount in the bloodstream increases it will be closer to the goal which will call for a smaller dosage.

    Change the stock and flow diagram as follows...

          

    Make the following changes to the equations:

    • dosage goal equal to 1.2
    • dosage gap equal to the drug goal minus the drug in bloodstream
    • adjustment time equal to 1
    • dosage equal to dosage gap divided by adjustment time
    • ingesting equal to dosage
    • the initial value of drug in bloodstream equal to 0

    Save this model as Drug_Goal.

    Before we run this model let's delete the results of the runs of the previous model.

    • Click on the Menu item Windows
    • Click on Control Panel and then Datasets
    • Highlight the names of the datasets listed under Loaded - Info.
    • Click on the Transfer Left icon   transfer left icon
    • Highlight the datasets again
    • Click on the Delete button and Click Yes
    Now run the model as run1 and display the graph of Drug in Bloodstream. We do not get the same generic behavior. The value does not ramp up smoothly to the goal. Instead, it overshoots the target and then has a dampening oscillation.

               

    This somewhat surprising result is caused by the feedback control loop that was added to the model, i.e. drug in stomach-absorbing-drug in bloodstream-dosage gap-ingesting.
           

    The feedback here does not go directly from a stock to the flow into that stock. In this case, we want to control the Drug in Bloodstream but we can not control the absorbing rate directly. We must exercise indirect, i.e. delayed, control by controlling the ingesting flow. The control point is "upstream," controlling the flow into a previous stock (i.e. the level of drug in the blood is used to control the flow of drugs into the stomach). This produces a delay in the control action which causes a series of over and under corrections to the dose.
     
    The amount of oscillation is affected by the value of Adjustment Time. This is the number of time periods we plan to take to correct for the difference in the goal and the current value of Drug in Bloodstream.

    With a value of one, the system trys to make up the entire different in the next time period. So, a high enough dose was given to make up the difference in the next period. But, because of the ingesting and absorption delay, the level in the blood does not rise accordingly. So, the next period the level still appears to be low and the next dose is higher than required once the previous dose is fully absorbed. This causes a series of doses to be higher than actually needed which causes the system to overshoot the goal. Then the system begins correcting but, again, the delay causes another overshoot, but not as large as the first. This dampening in the oscillations continues until the system becomes stable.

    This model demonstrates the importance of direct control in a system. A delay in control produces oscillatory behavior. Unfortunately, direct control of a stock is often not possible in complex systems. Thus oscillatory behavior is very common in "real-world" systems.

    Now let's run a reality check. Look at the graphs of all of the variables to see if they are reasonable. What do you find? Oh no! the flows ingesting and absorbing both sometimes have negative values.

    Can you give a negative dose? Will the drug in the bloodstream ever be absorbed back into the stomach? Not very realistic! We will learn in a latter lab how to constrain a model to maintain realism. But for now, let's go on.
      The Affect of Adjustment Time on System Behavior

    Let's try something else. Change the Adjustment Time variable from 1 to 2. This causes the system to corrrect for half of the difference from the goal in the next time period (the system has 2 time periods to correct the full difference). Name this run, run2.

               

    The behavior pattern remains the same, dampened oscillation. Remember, the structure of the system was not changed, just the value of a variable (Adjustment Time). But, the original overshoot is not nearly as severe and the oscillations dampen out more quickly.

    Let's try another run, run3, with the Adjustment Time changed to 4.

               

    Note that the higher the Adjustment Time the slower the growth (i.e. the correction) and the less the original overshoot! (Look at the behavior during the first 10 hours)

    As Adjustment Time gets larger the behavior pattern approaches the "growth to goal" behavior (try an adjustment time value of 10). This is because the delay has less cummulative effect since only a small adjustment is being made each time period.

    We stated earlier that oscillatory behavior is very common in "real-world" systems. Well, if we have to deal with oscillatory behavior, what does this model indicate about the timing of control actions in such complex systems? Look back at the last graph of the three runs.

    • Run one, where we tried to respond quickly to bring the system to the desired behavioral level, produced the most exaggerated swings and, would you believe, the longest adjustment period.
    • The slower response, run3, has the seemingly contradictory behavior of getting a slower start but actually producing the desired behavior most rapidly since there was a shorted period of oscillation.
    • Submit the model (.mdl) to Blackboard.

     

    Quick Check: What characterisctics of the drug system caused oscillation?

      Interaction of balancing and reinforcing loops.
      Having two stocks.
      A delay in the balancing loop.
      Having a goal.

    Quick Check: Indirect control of a flow causes...
      Oscillation in the level of a stock.
      A delay in the effect on a stock.
      Explosive growth.
      "Growth to a goal" behavior.

    Quick Check: A delay in feedback with a long adjustment time causes...
      Behavior that approaches "growth to a goal."
      Severe oscillation.
      A long period of oscillation.
      Heavily dampened oscillatory behavior.

    How does what you have learned in this lab apply to binge drinking? Does it explain how someone can become more drunk than they intend?

    Next time you watch a basketball game, particularly an amateur game, see if an overly enthusiastic player over runs the basket on a fast break and misses a lay up! The saying in sports is to use "controlled speed."

    This is the end of the lab exercise. Save your final models and submit them to Blackboard.
    Your models should be...

    • drug_goal.mdl