ENST 101 Lab #1 - a Minimalistic Introduction to GIS and Arcview

Total Page:16

File Type:pdf, Size:1020Kb

ENST 101 Lab #1 - a Minimalistic Introduction to GIS and Arcview

GEOG 410 Modeling of Environmental Systems

Lab 4 – Modeling Growth and Decay Dynamics

Due Date: 5pm Oct 2, 2008

1. Objectives

Understanding three ecosystem behavior patterns: linear growth or decay, exponential growth or decay, and logistic growth with MATLAB.

2. Background As you should have learned from lectures, identifying the components of a system and the linkages between them is just one part of constructing a model. An equally critical activity is defining the rules that govern the system. This is usually done by specifying a set of equations that state what the system will do under a given set of conditions. In this lab, we will learn to use MATLAB to specify these rules in a .m file.

This lab exercise does not include the background and theory required for you to understand the origins and applicability of these behavior patterns. For that information, you should look to material from the lectures and Chapter 2 (pp. 28-65) of Deaton et al.

3. Procedures Before we start, we will introduce the for loop in MATLAB.

>> for i=1:10 a(i)=i+1 end a =

2 3 4 5 6 7 8 9 10 11

This is a loop to calculate all elements in the array “a”. In the first line, 1:10 tell us the range of the loop. The second line tells us each element a(i) is equal to i plus 1. The third line is the sentence to notify the end of the loop. This is a very simple, but useful way to make the computer to do certain computations again and again. Computers are very good at doing this.

Linear Growth or Decay

1) Assuming we have a Lake X whose only input of water is precipitation and output of water is evaporation. Its system diagram looks like the following:

1 Water in Lake X

precipitation evaporation

Fig.1 The structure of the system

2) Given the following inflow and outflow rate and initial conditions, please simulate the water volume for 12 years with a time step of 0.25 years: Precipitation=25 m3/year, Evaporation=20 m3/year, Initial lake volume=100 m3

To do the simulation in MATLAB, First, we need to set up the simulations time.

>>dt=0.25; %setting the time step >>length=12; %total simulations time >>time_steps=(length/dt)+1; %total simulation time steps >>time=0:dt:12; or >> time=0:0.25:12;

Note: the “;” at the end of each statement.

The time array stores times progress 0.25 unit time at a step. Because we have 12 time years and dt=0.25 years. So we have 12/0.25=48 time steps in total for the simulation, plus the initial time point when t=0, we have 49 time points.

The initial lake volume=100 m3, so we set stock(1)=100; dt=0.25; >>stock(1)=100; % this is a tiny lake! >>precipitation=25; >>evaporation=20;

After this, we can calculate the stock at each time point as

>>for t=2:time_steps stock(t)=stock(t-1)+(precipitation-evaporation)*dt; end

After the simulation , we can plot the results;

>>plot(time,stock); >>xlabel('Time (years)' >>ylabel(Water in Lake X (m^3)') >>title('Linear Model')

You should see the following graph pop up:

2 L i n e a r M o d e l 1 6 0

1 5 0 )

3 1 4 0 m (

X

e k

a 1 3 0 L

n i

r e t a 1 2 0 W

1 1 0

1 0 0 0 2 4 6 8 1 0 1 2 T i m e ( y e a r s ) Fig 2. The stock volume at each time point

We can put all the lines of MATLAB commands in a file to create a .m file , and saved it lab4_linear.m in the data/ folder. Please copy the file into your student folder, and experiment with the following

(i) Change the precipitation to15 m3/year and run the model again and see how the graph looks like.

(ii) Continue the settings from (i) and make an additional change so that the length of the simulation is 20 years now. Run the model and see how the graph looks like. Do you understand what is happening?

Exponential Growth or Decay

In order to experiment with exponential behavior, we are going to add a further process to our lake model. It was always a little odd that the only way water left our lake was through evaporation. Let’s assume that our lake also has a dam on it, and that it has an open gate to release water from the lake in proportion to how full the lake is. The systems diagram would look like:

3 Water in Lake X Evaporation

Precipitation

Outflow

flowrate

Based on the about diagram, we have an additional process that reduce the water in Lake X through the dam: outflow=stock(i-1)*flowrate. Assuming flowrate=0.2. Please modify the lab4_linear.m program to become lab4_exponential.m. Save lab4_exponential.m in your student folder and run it. Copy your figure in your lab report and explain the model behavior. You should see a figure like the following one.

E x p o n e n t i a l M o d e l 1 0 0

9 0

8 0 ) 3 m ( X

7 0 e k a L

n i

6 0 r e t a W 5 0

4 0

3 0 0 2 4 6 8 1 0 1 2 T i m e ( y e a r s )

Logistic Growth

In order to examine logistic growth behavior, our Lake X is used to feed hydroelectric generator. Unlike our last dam that just allowed the water to spill out in proportion to how much water was in our lake, this dam needs to have a controlled level of water in the Lake to run the hydroelectric generators. In this case, we can imagine there are engineers that regulate the system to ensure that the Lake doesn’t get full beyond its capacity. The system diagram would look like the following:

4 Water in Lake X

Inflow Outflow

Lake Capacity uncons trained flow rate

Here we ignored the inflow of precipitation and out flow of evaporation as their magnitudes are negligible compared to the inflow and outflow engineered. Assuming the Lake capacity is engineered to be 500 m3.

 Lake X’s initial value = 100 m3  Unconstrained Flow Rate = 0.2/year  Lake_Capacity = 500 m3  Inflow = Water_in_Lake_X *Unconstrained_Flow_Rate  Outflow = Water_in_Lake_X *Unconstrained_Flow_Rate* Water_in_Lake_X/ Lake_Capacity

Further modify the lab4_exponential.m file to become lab4_logistic.m based on the information given above. Please also increase the length of simulation to 24 years. Please save lab4_logistic.m in your student folder and run the program. You should see the following graph L o g i s t i c M o d e l 5 0 0

4 5 0

4 0 0 ) 3

m 3 5 0 (

X

e k

a 3 0 0 L

n i

r e t 2 5 0 a W

2 0 0

1 5 0

1 0 0 0 5 1 0 1 5 2 0 2 5 T i m e ( y e a r s ) include the graph in your lab report, and explain the behavior of the model.

Lab Report: 1. Include a description for each of the three types of models, including stock(s), flows, converters and interrelationships with the example we have in this lab. 2. Following the description, describe the model you are running. 3. Include all graphs you produced (2 for liner, 1 for exponential and logistic) 4. Explain the model behavior.

5

Recommended publications