# NOT RUN {
#EXAMPLE 1: INDIVIDUAL MODELLING
#--------------------------------------------------------
#Get energy consumption
myconsumption <- energy_build(c(0, 200, -500), c(0, 365*2, 365*4), "Linear")
plot(1:(365*4), myconsumption, type = "l")
#Change interpolation to exponential
myexponential <- energy_build(c(0, 200, -500), c(0, 365*2, 365*4), "Exponential")
lines(1:(365*4), myexponential, type = "l", col = "red")
mystepwise <- energy_build(c(0, 200, -500), c(0, 365*2, 365*4), "Stepwise_R")
lines(1:(365*4), mystepwise, type = "l", col = "blue")
mystepwise2 <- energy_build(c(0, 200, -500), c(0, 365*2, 365*4), "Stepwise_L")
lines(1:(365*4), mystepwise2, type = "l", col = "green")
mylogarithmic <- energy_build(c(0, 200, -500), c(0, 365*2, 365*4), "Logarithmic")
lines(1:(365*4), mylogarithmic, type = "l", col = "purple")
mybrownian <- energy_build(c(0, 200, -500), c(0, 365*2, 365*4), "Brownian")
lines(1:(365*4), mybrownian, type = "l", col = "forestgreen")
#EXAMPLE 2: GROUP MODELLING
#--------------------------------------------------------
#Get energy consumption
multiple <- energy_build(cbind(runif(10,1000,2000),
runif(10,1000,2000),
runif(10,1000,2000)), c(0, 142, 365),
"Brownian")
matplot(1:365, t(multiple), type = "l")
# }
Run the code above in your browser using DataLab