<html><!-- InstanceBegin template="/Templates/template_work.dwt" codeOutsideHTMLIsLocked="false" -->
<head>
<!-- InstanceBeginEditable name="doctitle" -->
<TITLE>BathLab Model</TITLE>
<!-- InstanceEndEditable -->
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<!-- InstanceBeginEditable name="head" --><!-- InstanceEndEditable -->
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="Fabio Boschetti Home Page" name=title>
<META content="CSIRO" name=organisation>
<META content="Fabio Boschetti" name=author>
<META content="Complex System Science, Ecological Modelling, Inverse problems, Emergence" name=keywords>
<style type="text/css">
<!--
body,td,th {font-family: Palatino Linotype;	font-size: 14px;	color: #000000;}
body {background-color: #FFFFFF;}
a {font-size: 14px;}
a:link {text-decoration: none;color: #0000FF;}
a:visited {text-decoration: none;color: #0000FF;}
a:hover {text-decoration: none;color: #0000FF;}
a:active {text-decoration: none;color: #0000FF;}
.style1 {font-size: 14px;font-weight: bold;}




/************* #search styles ***************/



-->
</style>


</head>

<body>



<table width="100%"  border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td width="18%" height="142" rowspan="2" align="left" valign="top">
      <table width="96%"  border="0" align="left" cellpadding="0" cellspacing="0">
        <tr>
          <td height="30" align="left" valign="middle" bgcolor="#FFFFFF"><span class="style1">Fabio Boschetti</span>, <br>
          Research Scientist, <br>
          CSIRO CMAR, Australia </td>
        </tr>
        <tr>
          <td height="30" align="left" valign="middle" bgcolor="#FFFFFF">
<a href="../full_pap_list.html"><span class="style1">Publications</span></a></td>
        </tr>
        <tr>
          <td height="30" align="left" valign="middle" bgcolor="#FFFFFF"><a href="../CSS.htm"><span class="style1">Complex System Science</span></a></td>
        </tr>

        <tr>
          <td height="33" align="left" valign="middle" bgcolor="#FFFFFF"><a href="../Ecol_Modelling.htm"><strong>Ecological Modelling</strong></a> </td>
        </tr>
        <tr>
          <td height="47" align="left" valign="middle" bgcolor="#FFFFFF"><a href="../Learn_Css.htm"><strong>Can we learn how systems work?</strong></a></td>
        </tr>
        <tr>
          <td height="33" align="left" valign="middle" bgcolor="#FFFFFF"><a href="../ABM.htm"><strong>Agent Based, Economic Modelling &amp; Game Theory </strong></a></td>
        </tr>
        <tr>
          <td height="33" align="left" valign="middle" bgcolor="#FFFFFF"><a href="../emergence.htm"><span class="style1">Emergence</span></a></td>
        </tr>
        <tr>
          <td height="33" align="left" valign="middle" bgcolor="#FFFFFF"><a href="../APE.htm"><span class="style1">APE model</span></a></td>
        </tr>
        <tr>
          <td height="29" align="left" valign="middle" bgcolor="#FFFFFF"><a href="../context.htm" class="style1">Modelling the non-separability of a very complex world</a> (ECCS'10)</td>
        </tr>
        <tr>
          <td height="29" align="left" valign="middle" bgcolor="#FFFFFF"><a href="ToyModels.htm"><span class="style1">Toy Models</span></a></td>
        </tr>
        <tr>
          <td height="29" align="left" valign="middle" bgcolor="#FFFFFF"><a href="../inversion.html"><span class="style1">Optimisation</span></a> </td>
        </tr>
        <tr>
          <td height="30" align="left" valign="middle" bgcolor="#FFFFFF"><span class="style1"><a href="../visualisation.htm">Visualisation of scientific data </a></span></td>
        </tr>
        <tr>
          <td height="30" align="left" valign="middle" bgcolor="#FFFFFF"><span class="style1"><a href="../Geophysics.htm">Geophysics</a></span></td>
        </tr>
        <tr>
          <td height="26" align="left" valign="middle" bgcolor="#FFFFFF"><a href="../papers/Fabio_Boschetti_CV.pdf"><span class="style1">CV</span></a> </td>
        </tr>
        <tr>
          <td height="29" align="left" valign="middle" bgcolor="#FFFFFF"><a href="../contacts.html"><span class="style1">Contacts</span></a> </td>
        </tr>
        <tr>
          <td height="29" align="left" valign="middle" bgcolor="#FFFFFF"><a href="../index.html"><span class="style1">Home</span></a></td>
        </tr>
        <tr>
          <td height="29" align="left" valign="middle" bgcolor="#FFFFFF">&nbsp;</td>
        </tr>
        <tr>
          <td height="50" align="left" valign="top" bgcolor="#FFFFFF"></td>
        </tr>
      </table>      
    <p><a href="../index.html"><br>
    </a></p></td>

  </tr>
  <tr>
    <td width="82%" height="53" align="left" valign="top"><!-- InstanceBeginEditable name="Document body" --><!-- #BeginLibraryItem "/Library/BathLab_Manual.lbi" --><table width="90%"  border="0" align="center" cellpadding="0" cellspacing="0">
    
    <tr>
      <td colspan="3"> 
      
      <h2 align="center">The BathLab - Quick Guide</h2>

<table width="39%" border="0" align="center">

  <tr>
    <td><img src="Figures/BathLab_cartoon.jpg" alt="bathLab Model" width="420" height="227" /></td>
  </tr>
</table>
<br>
      
          
<a name="Interactive"></a>This program implements an interactive version of the BathTub toy model, as inspired by <a href="#Sweeney">Sweeney and Sterman (2000)</a>. Here you can find information about the model, including its purpose, description, and technical details. In its initial implementation, we expect the BathLab will be used in interactive sessions guided by a facilitator, who will specify the exact aim of the exercise. .<a name="Content" id="Content"></a>
<ol>
            <li><a href="#Download">Installation</a></li>
            <li><a href="#Purpose">Purpose</a></li>
 </ol>        
 The use the model, you need to
 <ol>
        <li><a href="#Flows">Define the strength of the Inflow and Outflow</a></li>
        <li><a href="#Run">Run the BathTub dynamics for a certain amount of time steps</a></li>
        <li><a href="#Stock">Observe the level of Stock in the container</a></li>
        <li><a href="#Save">Optionally, you can save and load settings for specific training exercises</a></li>
        </ol>
        <hr>
        
        <h3>	<a name="Purpose"></a>Purpose</h3>
          <p>This interactive model is designed to train on a simple dynamical system involving stocks & flows. While the specific aim of the training will be set by the facilitator, in general you will be asked to predict the amount of material in the central image (a container holding the stock of a certain material) as a function of how much material enters the container (from the top left box) and exits the container (from the bottom right box). At any given time, the amount in the container (Stock) is equal to the stock at the previous time step, plus the Inflow, minus the Outflow, that is:</p>
          <p> Stock(<em>next time step</em>) = Stock(<em>now</em>)  + Inflow(<em>now</em>) -  Outflow(<em>now</em>)            </p>
          <p>As explained in <a href="#Sweeney">Sweeney & Sterman (2000)</a>, even well educated people often fail at predicting the behaviour of this apparently simple process.</p>
          <p> In the rest of the document we call <em>BathLab</em> the interactive model and <em>BathTub</em> dynamics the evolution of the above equation.</p>
          <a name="Sweeney"></a>
          <p>Sweeney, L. B., & Sterman, J. D. (2000). Bathtub dynamics: initial results of a systems thinking inventory. System Dynamics Review, 16(4), 249-286. </p>
         <a href="#Content">Back to Manual table of contents</a>
        <hr>
        
        <h3>	<a name="Flows"></a>Define the strength of the Inflow and Outflow</h3>
        <p>The flows are visualised and controlled via the panels at the top-left (Inflow) and bottom-right (Outflow). The Inflow panel is shown in Figure (2a); the Outflow panel works in exactly the same manner. </p>
        <p>Each panel is divided into two sub-panels:        </p>
        <ol>
          <li>The visualisation panel (Figure 2b) </li>
          <li>	The control panel (Figure 2c)</li>
        </ol>
    
        <table width="91%" border="0" align="center" cellpadding="0" cellspacing="0">
          <tr>
            <td width="333"><img src="Figures/BathLab_Manual2a.jpg" alt="BathLab Model" width="333" height="220"></td>
            <td width="16"></td>
            <td width="305"><img src="Figures/BathLab_Manual2b.jpg" alt="BathLab Model" width="305" height="220"></td>
            <td width="10">&nbsp;</td>
            <td width="153"><img src="Figures/BathLab_Manual2c.jpg" alt="BathLab Model" width="152" height="220"></td>
          </tr>
          <tr>
            <td>Figure 2a</td>
            <td width="16"></td>
            <td>Figure 2b</td>
            <td>&nbsp;</td>
            <td>Figure 2c</td>
          </tr>
        </table>
        <p>The visualisation panel displays on the X axis the time throughout the dynamics (from time step 1 to time step 100) and on the Y axis the intensity (or strength) of the Flow.        </p>
        <p>When you load the BathLab you will see a time series plotted on this panel (blue for Inflow and red for Outflow as in Figure 2a). These represent how the flows will vary in time.        </p>
        <p>The Control Panel allows you to change/control the flow in two different modes: Draw Flow and Control Flow. 
          
          In the default setting, you will see the option Draw Flow ticked (Figure 3a). This setting allows you to change the flow plot by drawing your own time evolution. 
          To do so:        </p>
        <ol>
          <li>point the cursor over the plot </li>
          <li>	<strong>Left-click</strong> to input a few points; the chosen points will be shown in the panel </li>
          <li>	<strong>Shift+Left-click</strong> to complete the flow time series. This will draw a line as a cubic-spline interpolation of the chosen points. </li>
        </ol>
        <p>During the model run,  the number above the Delay field shows the current value of the flow strength (Figure 3b).        </p>
        <p>In this setting you can also:        </p>
        <ul>
          <li>add Noise to the flow strength by typing on the Noise field (Figure 3c). This value represents the maximum amplitude of an additive white noise, which is added to the flow at each time step. </li>
          <li>impose a Delay to the flow time evolution by typing on the Delay field (Figure 3c). This value represents how many time steps need to occur before any change in the flow impacts the Stock in the container. </li>
        </ul>
       <table width="70%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
            <td width="190"><img src="Figures/BathLab_Manual3a.jpg" alt="BathLab Model" width="186" height="278"></td>
          <td width="30"></td>
          <td width="186"><img src="Figures/BathLab_Manual3b.jpg" alt="BathLab Model" width="186" height="278"></td>
          <td width="18" rowspan="2">&nbsp;</td>
          <td width="199"><img src="Figures/BathLab_Manual3c.jpg" alt="BathLab Model" width="186" height="278"></td>
         </tr>
          <tr>
            <td>Figure 3a</td>
            <td width="30"></td>
            <td>Figure cb</td>
            <td>Figure 3c</td>
          </tr>
        </table>
        <p>If you tick Control Flow (see Figure 3a) you can control the flow in a step by step mode. After clicking Control Flow you will see that a) the Draw Flow button disappears and b) a slider appears. 
          
          Now you can        </p>
        <ul>
          <li> Change the flow strength at the current time step using the slider (the change will appear in the field in Figure 3b) </li>
          <li> Change the flow strength by directly typing on the field in Figure 3b.</li>
        </ul>
        <p>The new value of the flow strength will then be used in the model run until the value is changed again. 
          
          Notice that to go back to the Draw Flow mode, the simulation needs to be re-initialised by clicking on Clear (see below). <br>
        </p>
        </p>
         <a href="#Content">Back to Manual table of contents</a>
        <hr>
<h3><a name="Run" id="Run"></a>Run the BathTub dynamics for a certain amount of time steps</h3>
        <p>The BathLab run can be controlled via the buttons immediately above the  central plotting area, as highlighted in Figure 4.</p>
        <ul>
          <li><strong>Step</strong> carries out the simulation for one time step and pauses for user input;</li>
            <li> <strong>Run</strong> completes  the simulation from the current time to the final step; then awaits  user input</li>
          <li> <strong>Restart</strong> clears the time series plot and allows you to restart the simulation from the start. It does not reset the In and Out flows and does not clear your drawing on the time series plot<a name="Clear" id="Draw2"></a></li>
          <li> <strong>Clear</strong> clears all time series plots, and all parameter changes. It is equivalent to closing the program and re-launching it.  </li>
            
        </ul>
<table width="54%" border="0" align="center" cellspacing="0">
<tr>
              <td><img src="Figures/BathLab_Manual4.jpg" alt="APE model" width="483" height="237"></td>
          </tr>
            <tr>
              <td>Figure 4</td>
            </tr>
        </table>
        <a href="#Content">Back to Manual table of contents</a>
        <hr>
        <h3><a name="Stock"></a>Observe the level of Stock in the container</h3>
       
        <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
              <td width="60%" rowspan="2"><p>As for the flow  visualisation plots, the Stock panel displays on the X axis the time thought  the dynamics (from 1 to 100 time steps) and on the Y axis the level of the  Stock (how much material is in the container). The Stock level at the current  time is also displayed at the top-right of the plot (see Figure 5). The Stock value  cannot be changed or edited in the panel, since it is determined solely by the  strength of the Inflow and Outflow.</p>
              <p>In order to help the interaction between the facilitator and the user(s) and  to test the learning you can draw lines over the Stock plot. This allows, for  example, to draw the expected or desired behaviour of the Stock, which can then  be compared to the actual output of the run. To draw the line:
                </p>
              </p></td>
              <td width="3%" rowspan="2">&nbsp;</td>
              <td width="37%"><img src="Figures/BathLab_Manual5.jpg" alt="BathLab Model" width="306" height="160"></td>
          </tr>
            <tr>
              <td>Figure 5</td>
            </tr>
        </table>
        <br>
        <ol start="1" type="1">
            <li>point the       cursor over the time-series plot </li>
            <li><strong>Left-click</strong>       to input a few points; the chosen points will be shown in the panel </li>
            <li><strong>Shift+Left-click</strong>       to complete the line. This will draw the line as a cubic-spline       interpolation of the chosen point</li>
            <li><strong>Right-click</strong>       on the line allows to change the line colour or to delete the line. Notice       that this is the only way to delete the line, since it will <em>not</em> be deleted       when the button <a href="../APE/InteractiveAPE.html#Clear">Clear</a> is pressed) </li>
            <li>More lines       can be drawn with the same procedure        </li>
        </ol>
          <p><a href="#Content">Back to Manual table of contents</a>
        <hr>
        <h3><a name="Save" id="Save"></a>Save and load user-defined settings</h3>
          

        <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
  <td rowspan="2"><p>You can load and save the settings via the buttons shown in Figure 7. The settings are saved as a structure in a Matlab file (.mat) and include:</p>
    <p>The availabe buttons provide for the following:</p>
          <ul>
            <li><strong>Load</strong>: loads a pre-saved setting file and resets all parameters</li>
            <li><strong>Save</strong>: saves the current parameters</li>
            <li><strong>Close: </strong> quits APE and closes the GUI.</li>
        </ul>
          <p><a href="#Content">Back to Manual table of contents</a></td>
  <td rowspan="2">&nbsp;</td>
              <td><img src="Figures/BathLab_Manual6.jpg" alt="APE model" width="464" height="259"></td>
            </tr>
            <tr>
              <td>Figure 6</td>
            </tr>
          </table>
    
          
        <!-- #BeginLibraryItem "/Library/BathLab_Download.lbi" --><hr>
        <h3><a name="Download"></a>Download BathLab Model</h3>
          
        
<p><em>Notice, currently  the model runs only on PC</em>.</p>
          <p>To use this  model you first need to install the MATLAB Compiler Runtime (MCR) on you PC (<a href="http://www.mathworks.com/access/helpdesk/help/toolbox/compiler/f12-999353.html" target="_blank">see information on the MCR</a>):</p>
          <ul>
            <li><a href="../Library/APE/MCRInstaller.exe">download  MCRInstaller.exe</a> (<em>150Mb, be patient</em>)</li>
            <li>run  it - this will install the MCR</li>
            <li>the entire operation  will take a few minutes, but you need to so it only once.</li>
          </ul>
          <p>Once you have installed your MATLAB Compiler  Runtime (MCR):</p>
          <ul>
            <li> <a href="../Library/APE/InteractiveAPE.zip">download the BathLab model</a></li>
            <li>unzip the folder</li>
            <li>run BathLab.exe</li>
            <li>the first time you run the model, it will extract  some files; this may take a few seconds but this also will be done only once.</li>
</ul>
      <!-- #EndLibraryItem --><a href="#Content">Back to Manual table of contents</a></td>
  </tr>
  </table><!-- #EndLibraryItem --><!-- InstanceEndEditable -->
		
</td>
</tr>
 <tr>
    <td height="53" colspan="2" align="left" valign="top">&nbsp;</td>
  </tr>
</table>
</body>
<!-- InstanceEnd --></html>
