• No results found

Environmental Modelling

N/A
N/A
Protected

Academic year: 2021

Share "Environmental Modelling"

Copied!
5
0
0

Bezig met laden.... (Bekijk nu de volledige tekst)

Hele tekst

(1)

Environmental Modelling:

############################################################## #################

## Soetaert and Meysman ## Ecological Modelling

## Exercise: Algal growth in a bucket

############################################################## ##################

require(deSolve)

#============================================================= ================

# Units used in the program:

#============================================================= ================ # Space = m # Time = day # Mass = mmolN #============================================================= ================ # Model geometry #============================================================= ================ V <- 0.01 # volume system [m3] #============================================================= ================ # Model parameters: #============================================================= ================ # Transport parameters # Not applicable here # Reaction parameters

pMax <- 1.0 # Maximal uptake rate [d-1] kN <- 1.0 # Saturation constant [mmolN m-3] pDIN <- 1

kDIN <- 1 mPHYTO <- 0.5

(2)

mBACT <- 0.3 pDET <- 2 kDET <- 1 q <- 0.25

# Assembling the 'parameters' vector parameters <- c(pMax = pMax,

kN = kN, pDIN = pDIN, kDIN = kDIN, mPHYTO=mPHYTO, mBACT= mBACT, pDET = pDET, kDET = kDET, q = q) #============================================================= ================ # Model formulation #============================================================= ================

Batch.model <- function(t, state, parameters) {

with(as.list(c(state, parameters)),{ # PROBLEM-SPECIFIC CODE STARTS HERE # Rate expressions DINuptake <- pMax*DIN/(DIN+kN)*PHYTO phytomort <- mPHYTO*PHYTO DETuptake <- pDET*DET/(DET+kDET)*BACT bactmort <- mBACT*BACT # Balance equations

dPHYTO <- DINuptake - phytomort

dDIN <- - DINuptake + (1-q)*DETuptake dBACT <- (DETuptake*q) - bactmort dDET <- phytomort+bactmort-DETuptake # output variable: total nitrogen TN <- DIN + PHYTO + DET + BACT

(3)

# return list

return(list(c(dPHYTO, dDIN, dDET, dBACT), # rate of change, a vector

TotalN = TN ) # output variable )

# PROBLEM-SPECIFIC CODE ENDS HERE })

} # end of model equations

#============================================================= ================

# Model solution: transient

#============================================================= ================ # Initial conditions: PHYTO_0 <- 1 # mmolN/m3 DIN_0 <- 10.0 # mmolN/m3 DET_0 <- 1 BACT_0 <- 1

# Initializing the state variable vector with the initial conditions:

state <- c(PHYTO = PHYTO_0, DIN = DIN_0, DET = DET_0, BACT = BACT_0) # Time sequence: t_start <- 0 # day t_stop <- 40 # day

n_output <- 101 # number of output times

time_seq <- seq(from = t_start, to = t_stop,length = n_output) # Calculation of the transient solution

# The routine 'ode' from the package deSolve is used

out <- ode(y = state, times = time_seq, func = Batch.model, parms = parameters)

(4)

head(out)

parameters["mBACT"] <- 0.6

out2 <- ode(y = state, times = time_seq, func = Batch.model, parms = parameters)

tail(out) head(out)

#============================================================= ================

# Plotting model output

#============================================================= ================

#windows()

par(oma = c(0, 0, 3, 0)) # increase outer margin size (oma) plot(out, out2, lwd=2, xlab = "time [days]", ylab =

"concentration [mmolN/m3]") # plot all variables at once mtext(outer = TRUE, side = 3, "BUCKET model", cex = 1.5) Theoretical part:

1. Definition of functional response; what are the three main types (give examples).

2. Definition of forcing function, give examples from class Exercises (paper):

1. Fill in the box of a conceptual model using a scenario. Define the state variables. Write the mass balance and rate expression.

2. Scenario wherein fish population is migrating into an enclosed bay and eaten by killer whales and seals. Write a conceptual model about the carbon transfer. Define the state variables. What are the transport and reaction processes. Write the mass balance and rate expressions.

Tip: Make sure to solve the exercises given in class and understand them, and your good to go! Although the equations are given for the computer exercise, you still have to

memorize them for the paper exercise. Exercise (computer):

(5)

Tip: Saving your work from time to time will help (in case of accidental deletion or computer shutdown).

Referenties

GERELATEERDE DOCUMENTEN

employment of verbal or nonverbal mechanisms for communicating an idea when precise linguistic forms are not readily available. ” Dit is die metodes wat

To compare the company model with the logistic regression, we use all data ranging from 2007 to 2011 for the product types Mortgage- Linked Savings, Savings, Annuity and Term Life,

Dit literatuuroverzicht toont dus aan dat coöperatieve groepen en groepen met juiste coöperatieve taakrepresentaties een hoge epistemische motivatie en een prosociale motivatie

Vorige week donderdag presenteerden bedrijven hun innovaties voor de internationale vakbeurs Horti Fair, die ditjaar plaatsvindt van dinsdag 31 oktober tot en met wijdag

Een Urban Heat Island is een stedelijk gebied waarvan de temperatuur gemiddeld gezien hoger ligt dan in de omlig- gende landelijke omgeving. De temperatuursverschillen tussen de stad

This thesis will focus on one of such cases: the interpretation process of pages 29 to 46 of the Codex Borgia, a religious manuscript used in Central Mexico in

Locatienaam absolute achteruitgang soortenrijkdom door stress 1 absolute achteruitgang door vermesting/ verdroging/ verzuring 2 dominante factor voor oorzaken- cluster

Dit werd goedge- keurd mits archeologische begeleiding door de Dienst Stadsarcheologie van de Stad Gent (opgra- vingsvergunning 2007/135) 2