



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Community
Ask the community for help and clear up your study doubts
Discover the best universities in your country according to Docsity users
Free resources
Download our free guides on studying techniques, anxiety management strategies, and thesis advice from Docsity tutors
For this introduction, we will be creating a model of a simple system with two compartments analogous to containers of a liquid which can flow between the.
Typology: Exams
1 / 6
This page cannot be seen from the preview
Don't miss anything!
For this introduction, we will be creating a model of a simple system with two compartments analogous to containers of a liquid which can flow between the containers depending upon the difference in quantity in the two compartments: Assuming that you have downloaded and installed the Berkeley-Madonna program, startup the program (selecting the demo mode when asked). We will be creating a model using the graphical interface and so you can close the default equations view that appears when the program is started. Under the file menu, select “New Flowchart Document”. You should have a blank model like this:
First we will add the two compartments, called “Reservoirs” in the program. Select the reservoir tool at the top of the flowchart (third tool from the left) and click in the open space in the window roughly where you want the reservoir located. You can always drag it around later. Do this twice to create both reservoirs. Edit the reservoir names by double-clicking on the default name in the upper left of the reservoir. Change those names to “A” and “B” as shown in the model diagram above. Your flowchart should look something like this: Next we want to add the flow between the two compartments. Select the flow tool from the toolbar (looks like an arrow with a dot in the middle). Now click on reservoir A and drag over to reservoir B to add the flow. If you get the flow wrong (or any other diagram object), you can always select that object and push the delete button (crossed out circle symbol) at the end of the toolbar. Also rename that flow to “Jab”. Now your flowchart should look like this:
indicating that they will be influences on the flow. Also shown is the “Optional input” of the parameter k. Enter the equation as shown in the figure at the start of this document. Make sure you use parentheses to force the subtraction operation to be done before the multiplication by k. Also, don’t forget the “*” for multiplication. The dialog for Jab should now look like this: Once you push “Ok”, the question mark in the flow should now have disappeared because you have fully specified the equation for that flow. The reservoirs still have question marks because their initial values have not been set. Double-click on each reservoir and set these initial values: A 0 = 100, B 0 = 20. Now your flowchart should look like this: The last item we need to set is the final time for the simulation. Often you can just go along with the default the program chooses, but let’s set the final time. Look at the parameters for the run over on the right. Select the “STOPTIME” and change the value from 10 to 5. Push the “Run” button (or pick “Run” from under the “Compute” menu item). You should see a graph like this:
Notice that the quantities for A and B are plotted with two separate vertical axes. At time zero, they start at the initial values as entered. By time = 5, they are both approaching a quantity of 60. This value should make sense to you given the equation used for the flow. Also note that conservation of the quantities is maintained: the sum of the initial A and B values is equal to the sum of the final values. There are quite a few options for the graph, try out the toolbar items at the top of the plot. If you double-click by one of the plot axes, you can change the scales and axis labels, by first unchecking the “Auto” checkbox. Sometimes it is easier to view the results if you set the same scales for both variables A and B. Some of the other options for the graph: Select the legend button to add a legend to the graph that can be dragged around to somewhere convenient. Try the Line appearance button. If you want to see the raw data, pick the “table” button. Pick the variables to be graphed by double-clicking in the middle of the graph. Ordinarily you would not put variables with different units (like compartment quantities and flow rates) on the same graph. Lastly, take a look at the equations that were automatically created by the program based on your flowchart. The entries should make sense to you based on your understanding of the compartment modeling process.