I am doing a project about wind turbines where I test whether it is possible to heat a house only with energi from the wind turbine. So I made this R code. The code can predict the inside temperature. I have dataset in Excel that contains the outside temperature and windspeed every hour in january 2009.
R <- 5 This is the isolation of the wall
C <- 4 This is heat capacity of the wall
Ta <- rep(3,24) constant outside temperature in 24 hour
Ph <- rep(2,24) constant effect of the wind turbine in kW in 24 hour
Ti0 <- 20 This is the beginning temperature in the house
a <- -1/(R*C)
for(k in 2:24) {
Ti[k] <- Ta[k] + exp(a) * (Ti[k-1] - Ta[k]) + R * (1-exp(a)) * Ph[k]
}
My question is. How can I load my Excel dataset into R so R can predict the inside temperatur with changing temperature in 24 hour and changing effect in 24 hour, instead of holding these constant