The first photosynthetic civilisation?

In 2008 David Mackay published a very useful online book which contained detailed calculations on the amount of energy consumed per person and the potential for replacing fossil fuel consumption by renewables.

The main conclusion of the work was that the UK could not feasibly switch to using only renewable sources of energy alone based on currentl levels of consuption. There are too few renewable options that produce enough energy per unit of surface area. Even if Wind turbines were placed on every available onshore and offshore site the total energy produced would barely reach 10% of conspumption. Most of the calculations are still correct, to within the level of precision that is useful to consider the options. However David Mackay rather underestimated the potential of direct solar energy. At the time the book was written photovoltaic panels were much more expensive and somewhat less efficient than they are today.

# https://ourworldindata.org/energy-production-and-changing-energy-sources
d<-read.csv("global-primary-energy.csv")
library(tidyr)
d<-pivot_longer(d,cols=4:12)
d$name<-gsub("..terawatt.hours.", "", d$name)
global_energy<-d
save(global_energy,file="/home/rstudio/rstudio/aqm/data/global_energy.rda")
d %>% group_by(Year) %>% summarise(total=sum(value)/1000) -> ttl
d %>% filter(Year==2017) %>% arrange(value) %>% 
  mutate(name = factor(name, name)) %>% mutate(percent=100*value/sum(value)) %>%
  
  
ggplot(aes(x=name, y=value, label=paste(round(percent,1), "%"))) + geom_col() +  geom_label() +coord_flip() + ylab("Terrawat hours") +ggtitle("World energy production in 2017")

#ggplot(d, aes(x=Year,y=value/ 1000,fill=name)) + geom_area() + ylab("Kwh * 10^12") +ggtitle("Total global energy use") + scale_fill_brewer(palette = "Dark2")

In 2017 the world still relies on fossil fuels with all renewables including hydro electric making up around 7% of the total consumption. Direct solar power still only contributes a tiny fractoin at 0.3%. Is this set to change dramatically?

Current total world energy consumption stands at around 160 x 10² kwh per year and still rising. There are reasons to suspect that the upward trend will flatten out in the near future.

ggplot(d, aes(x=Year,y=value/ 1000,fill=name)) + geom_area() + ylab("Kwh * 10^12") +ggtitle("Total global energy use") + scale_fill_brewer(palette = "Dark2")

The argument in favour of directly converting solar energy into a form that can be used to power our economy is very simple. All other forms of energy, with the exception of nuclear, are based on a very ineficient energy conversion mechanism. This is photosynthesis. The alternative is to “cut out the middle man” and base our economies on direct solar capture in real time. Photosynthesis at best can only convert around 4% of incoming solar radiation into useable biomass. Fossil fuel reserves are the result of integrating this process over millions of years. One of the strongest arguments against using current photosynthesis as an energy harvesting mechanism through the growth of biofuels is that the phtosynthetic process itself involves two inputs. These are water and solar radiation. The problem is that they have a tendency to be negatively correlated with each other. The most efficient crop producition involves irrigation, but this leads to additional issues. Photosynthesis is needed to provide food for the human population and to support ecosystems.

The potential of solar power

The total energy that could be captured through the use of photovoltaic cells or other direct conversion mechanisms varies according to latitude and climate.

Solar panels have a maximum efficiency of about 20% so they produce around 200 kwh of electricty per square meter per year in the South of England. There is more energy to be converted in sunnier climates, with a maximum value of around 400 to 500 kwh in a sunny desert with clear skies almost every day.

Taking 200 kwh as an average figure for energy generation we can estimate the land surface that needs to be covered by solar panels to provide the entire current world’s energy supply.

sqmt<-160 * 10^12 / 200
sqkm<-sqmt/1000000
tsqkm<-sqkm /1000

This figure of 800 thousand square kilometers is a very large area. Assuming that a proportion of energy would be produced more efficiently this estimate is similar to the land area of France or Spain. China has a total land area of just under 10 million square kilometers, so the figure represents 8 % of the area China. It is not worth trying to be more precise than this, as there are too many uncertainties involved. However the ball park figure is useful. The total area of the Sahara desert is 9.2 million square km. Covering a proportion of the Algerian desert with solar panels could produce the entire World’s energy if it were possible to solve all the associated problems of enery storage and transportation. These problems do seem insurmountable in practice.

r<-sqrt(tsqkm*1000) * 1000
algeria<-rnaturalearth::ne_countries(country = 'algeria', scale=10, ret="sf")
algeria<-st_transform(algeria,3857)
poly<-st_centroid(algeria)
poly<-st_as_sfc(st_bbox(st_buffer(poly,r/2)))
africa<-rnaturalearth::ne_countries(continent = 'africa', scale=10, ret="sf")
library(tmap)
qtm(africa)+qtm(algeria) + qtm(poly,fill="red")

The UK currently uses around 2 thousand terrawatt hours per year.

d<-read.csv("energy_by_country.csv")
d<-pivot_longer(d,cols=4:11)
d$name<-gsub("..terawatt.hours.", "", d$name)
d$name<-gsub("\\.terrawatt.hours.", "", d$name)
d$name<-gsub("\\.TWh.", "", d$name)

energy_by_country<-d
save(energy_by_country,file="/home/rstudio/rstudio/aqm/data/energy_by_country.rda")

d %>% group_by(Year) %>% summarise(total=sum(value)/1000) -> ttl
d %>% filter(Year==2017) %>% filter(Entity=="United Kingdom") %>% arrange(value) %>% 
  mutate(name = factor(name, name)) %>% mutate(percent=100*value/sum(value)) %>%
  
  
ggplot(aes(x=name, y=value, label=paste(round(percent,1), "%"))) + geom_col() +  geom_label() +coord_flip() + ylab("Terrawatt hours") +ggtitle("UK energy production in 2017")

So the same caclulations can be run to find the area needed to produce all the UK’s energy from direct solar.

sqmt<-2.2 * 10^12 / 200
sqkm<-sqmt/1000000
tsqkm<-sqkm /1000

This is about 1.375 % of the world’s energy . The ball park area of solar panels that would produce that amount is thus 11 thousand square km which is around half the area of Wales or about 4% of the total land area of the UK. The polygon shows an illustrative area of the South of England that could provide the UK’s energy if totally covered by solar panels.

UK<-rnaturalearth::ne_countries(country = 'united kingdom', scale=10, ret="sf")
UK<-st_transform(UK,3857)
r<-sqrt(tsqkm*1000) * 1000
poly<-st_geometry(st_centroid(UK)) + c(100000, -500000) # Move to a more central area
poly<-st_as_sfc(st_bbox(st_buffer(poly,r/2)))
library(tmap)
qtm(UK) + qtm(poly, fill="red")

Of course if an attempt were made to generate all our power from solar panels they would in reality be dispersed across the country. Around 6% of the UK is urbanised i.e. around 15 thousand square km, so there is at least the potential to use some of this space for solar. The area of solar capacity would be about 166.7 square meters per person or 500 square meters per household, which is much more than the available area on roofing and car parking spaces. A solar panel installation on a south facing roof can generate most of a households electricity, but it cannot generate the energy required to heat the house unless combined with an efficient heat pump boiler. So some of the claims about solar are misleading. For example the follwing statement was made about 125 hectare site at Parley. “On a typical summer’s day the Chapel Lane Solar Farm is now meeting the electricity needs of 60,000 households or three quarters of homes in Bournemouth.” This is not really a fair statement, as the plant does not operate at this capacity year round. The electricity needs do not equate to the total energy needs. A household uses between 10 and 20 thousand kwh per year, so the solar farm can only cover the total annual energy consumption of around 12 thousand households at best and note that this is not taking into account total energy use per person outside the home. The population of Bourmouth and Poole combined is over 465 thousand so to cover their entire energy needs would use an area of around 7752 hectares i.e. 62 more installations of the size of Chapel Lane.

library(giscourse)
load("parley.rda")
save(parley,file="/home/rstudio/rstudio/aqm/data/parley.rda")

mapviewOptions(basemaps =c("Esri.WorldImagery","OpenStreetMap"))
mapview(parley, alpha.regions = 0,alpha=0) %>% extras()
global_energy %>% filter(name=="Solar") %>% group_by(Year) %>% filter(Year> 2000) %>% summarise(total=sum(value)/1000) -> sol

mod<- lm(data=sol,log10(total)~ Year)

ggplot(sol, aes(x=Year,y=total)) + geom_point() + ylab("Kwh * 10^12") + geom_line(aes(y=10^predict(mod)))

d<- data.frame(Year=2000:2020)
d$solar<-10^predict(mod,newdata=d)

ggplot(d, aes(x=Year,y=solar)) + geom_line() + ylab("Kwh * 10^12") + geom_point(data=sol, aes(x=Year,y=total))

d<- data.frame(Year=2000:2031)
d$solar<-10^predict(mod,newdata=d)

ggplot(d, aes(x=Year,y=solar)) + geom_line() + ylab("Kwh * 10^12") + geom_point(data=sol, aes(x=Year,y=total)) + geom_hline(yintercept = 160,col="red")

#f<-function(x,K=1000,r=0.1,n1=10) K/(1+((K-n1)/n1)*exp(-r*x))
#plot(0:100,f(0:100))
logistic_mod<-"
model {
 
  ## step through observations
  for (i in 1:N) {
     mu[i]<- K/(1+((K-n1)/n1)*exp(-r*i))
     n[i] ~ dnorm(mu[i],tau)
  }
  ## aux variables
  ## priors
  r ~ dunif(0,10)
  K ~ dunif(120,160)
  tau~ dgamma(0.005,0.005)
}
"
dat<-list(
  N=length(sol$Year),
  n=sol$total,
   n1=sol$total[1]) 


mod <- jags.model(textConnection(logistic_mod), data = dat, n.chains = 1)
## Compiling model graph
##    Resolving undeclared variables
##    Allocating nodes
## Graph information:
##    Observed stochastic nodes: 17
##    Unobserved stochastic nodes: 3
##    Total graph size: 150
## 
## Initializing model
update(mod, 10000)

mod_sim <- coda.samples(model = mod, variable.names = c("r","K"), n.iter = 10000)

#mod_sim
#summary(mod_sim)
#plot(mod_sim)
ms <-ggs(mod_sim) 
ms %>% spread(Parameter, value) -> ms
#ms
    
i<-1:50

pred<-function(i, mt=ms, n1=sol$total[1]){
      pred<- ms$K/(1+((ms$K-n1)/n1)*exp(-ms$r*i))
      return(list(quantile(pred,c(0.025,0.5,0.975))))
}
    
pred_mod<-data.frame(i=i,do.call("rbind",sapply(i,pred)))
names(pred_mod)<-c("i","lwr","mid","upr")
ggplot(pred_mod,aes(x=i+2000,y=mid)) + geom_line() + geom_line(aes(y=lwr),col="blue") +  geom_line(aes(y=upr),col="red")