#
# Simulation of the Kaya Model
# Cut-and-Paste into the window above and Run (Cmd-Enter)
#
Kaya <- function (time=100,N=100,n=1.4,L=50,Q=100,q=1.04,CO2=1,
Temp=1,l=.5,e=.75,c=.0002,t=.0001) UseMethod ("Kaya")
Kaya.default <- function (time=100,N=100,n=1.4,L=50,Q=100,q=1.04,CO2=1,
Temp=1,l=.5,e=.75,c=.02,t=.01) {
TEMP <- matrix(0,time,1)
TIME <- matrix(0,time,1)
for (i in 1:time) {
N <- N * n;
L <- N * l;
Q <- Q * q + L * e;
CO2 <- Q * c;
Temp <- CO2 * t;
TEMP[i,1] <- Temp;
TIME[i,1] <- i;
}
plot(TIME,TEMP)
}
par(mfrow=c(2,2))
# Sample Function Calls
# Exponential
Kaya(n=1.03,q=1.04)
# Asymptote
Kaya(n=.9,q=1)
# De-Growth
Kaya(n=.9,q=.9)
# Decline
Kaya(n=.6,q=.6)