Notes on Lab #2
- You can get the instructions
here, and the entire set of .MDL files for this and future labs
here.
- Note that 100e^{1.01t} is not
100 × 10^{1.01t}; this e is the natural base e
(approxmiately 2.718), corresponding to the EXP function.
- For this lab you should turn in a single .PDF writeup file, as well as
individual model files. Because there will be so many files, please first
create a folder with the appropriate name (for me, levys_lab2), and then
put the following files into that folder as you work through the lab:
- levys_lab2.pdf
- levys_lab2_unconstrainedError.mdl
- levys_lab2_periodic.mdl
- levys_lab2_pulse.mdl
- levys_lab2_logicalIF.mdl
- levys_lab2_logicalAND.mdlI
- levys_lab2_logicalOR.mdl
- levys_lab2_logicalNOT.mdl
- levys_lab2_dt.mdl
- levys_lab2_comparative.mdl
- levys_lab2_graphInput.mdl
- levys_lab2_conveyor.mdl
Then, when you're done, you can simply drag this lab2 folder into the turnin
folder for the class. If the system doesn't let you do this, you can first
zip up the folder by right-clicking on it, then doing
Iceows/make levys_lab2.zip
Don't worry if you don't complete all of these. The point of these first
few labs is to get familiar with Vensim. I'd rather have you work slowly and
steadily, understanding what you're doing at every step, than rushing
to finish the whole tutorial.
- In your writeup (PDF) file, please include the following, with appropriate
label or brief description:
- Graph for population and growth_rate (page 4)
- Graph for population and table for growth,
removal, and population (page 5)
- Answer to Quick Review Question 6 (page 6)
- Graph for for logcical_AND (page 7, "Run the simulation and
observe the effect...")
- Answers to Quick Review Question 11 parts b, c, d, f, h, i, j (pages 9-10)
- Answer to Quick Review Question 12 parts b, c, d, f, h, i, j (page 11)
- Answer to Quick Review Question 13 "Describe the shape of the graph and
explain the results" (page 13)
- Graph and table for the conveyor model
("Generate a graph for processing and a table containing processing
and total_out", page 13)
- Answers to Quick Review Question 14 (page 13)
- The instructions may be somewhat confusing. Here are some hints:
- For the first model you'll build (unconstrainedError), the solution
already exists in the folder you downloaded. I encourage you to build your
own solution first, then compare it to the existing one.
- If a variable or other piece of text appears jumbled together, you can
fix it by clicking on the little pencile/variable tool and editing the
variable name.
- For unconstrainedError, the value for result is what you
get from the population (from of the original model), and the value
for correct is what you
get from the analytical polution.
^{1}
- When you rename and open the model for the first time, some of the variable
names and comments may be messed up. Variable names can be cleaned up by
clicking on the variable tool at the top and then clicking on the variable name.
Comments can (and should) be cleaned up and correct by right-clicking on them.
- It may be easier to run some of the models without eliminating all errors.
For example, in the unconstrainedError model, you'll get a model-check
error saying that the relative error was not used in the model, but this will
not prevent you from running the model and seeing the results.
- In the periodic model,
- Just as you did in unconstrainedError, use the "shadow" variable
<Time> as the value for t, in the formula
asin(2 π t/p) + h.
- You will have to set the growth_rate variable to have type
Auxiliary
- For the constants a, p, and h, you can just plug the
appropriate values directly into the formula.
- For the PULSE_TRAIN model,
- the tutorial specifies initial_time,
width, interval, and end_time as the inputs. In the
version of VensimPLE you are using, these may show up with different names,
such as start, duration, repeattime and end.
- growth should have the same units as removal. For
amount_removed the units should be bacteria/Hour;
for init_removal_time, and
frequency_of_removal, Hour.
- It says to set frequency_of_removal to 8, but to see periodic
behavior within the eight-hour window, you'll need to set it to a smaller
value.
- For logicalAND, one of
De Morgan's Laws
should help you fill in the blanks.
^{1}
In general, a model is used when you don't
have an analytical (simple, single-formula) solution.
An analytical solution you may already know about is the Quadratic Formula for solving
ax^{2} + bx + c = 0; the analytical solution is
x = -b +/-√(b^{2}-4ac) / 2a .
So why are we building a model here when we have an analytical solution?
Probably because we are learning about how to evaluate models with respect to
a correct answer. In a more realistic modeling situation, the correct answer
would be real-world data. Here, we're using an analytical solution instead.