external/input_devel/model-demo.md

title: "Model demo" author: "Lyndon Estes" date: "13 January 2015" output: html_document: highlight: tango theme: spacelab toc: yes pdf: bibliography: trade.bib

Spatial Tradeoff Model (trademod)

Some examples

A few of the input datasets

plot of chunk unnamed-chunk-1

And a few analyses

Let's establish production targets

A doubling in the need for 9 crops (over current production), except for maize (4X) and soybean (8X):

setwd(path)
currprod <- brick(full_path(path, "external/ext_data/ZA-current-production.tif"))
prod_targ <- c("maize" = 4, "cassava" = 2, "ground" = 2, "cotton" = 2, "soy" = 8, "pulse" = 2, 
               "sunflower" = 2, "sugarcane" = 2, "wheat" = 2)
potprod <- brick(full_path(path, "external/ext_data/ZA-potential-production-current-area.tif"))
target <- targets(prod_targ = prod_targ, currprod = currprod, potprod = potprod, ybeta = NULL)
target
##           current potential  target target_newland t_pct_currland
## maize      754962    662523 3019848        2357325           21.9
## cassava    660066    931814 1320132         388318           70.6
## ground      44322     93433   88644          -4789          105.4
## cotton      63798     88894  127596          38702           69.7
## soy         15332     11334  122656         111322            9.2
## pulse       14613      5991   29226          23235           20.5
## sunflower    8231     11484   16462           4978           69.8
## sugarcane 1717108      4619 3434216        3429597            0.1
## wheat       67354        38  134708         134670            0.0
##           t_pct_newland
## maize              78.1
## cassava            29.4
## ground             -5.4
## cotton             30.3
## soy                90.8
## pulse              79.5
## sunflower          30.2
## sugarcane          99.9
## wheat             100.0

And then run constraints to see which areas are most likely to be converted

We'll first assume no constraint other than crop yield potential is applied

setwd(path)
con1 <- constraints(y = y, ybeta = NULL, cbetas = c(0, 0, 0), clist = clist)
## [1] "C : no constraint applied"    "bd : no constraint applied"  
## [3] "cost : no constraint applied"
## [1] "B"
names(con1) <- cropnames
plot(con1,axes = FALSE, box = FALSE) 

plot of chunk unnamed-chunk-3

Next we'll assume that we care about protecting carbon and biodiversity also

setwd(path)
con2 <- constraints(y = y, ybeta = NULL, cbetas = c(1, 1, 0), clist = clist)
## [1] "cost : no constraint applied"
## [1] "C : full constraint applied"
## [1] "bd : full constraint applied"
## [1] "B" "C" "D"
names(con2) <- cropnames
plot(con2,axes = FALSE, box = FALSE) 

plot of chunk unnamed-chunk-4

Lastly, let's see what get's converted given the crop production targets we need to meet

setwd(path)
converted1 <- convert2(con1, target, crop_frac = crop_frac, pot_yield = pot_yield, valind = valind, 
                       cropnames = cropnames)
converted2 <- convert2(con2, target, crop_frac = crop_frac, pot_yield = pot_yield, valind = valind,
                       cropnames = cropnames)

If crop yield is the only constraint plot of chunk unnamed-chunk-6

If we also care about carbon and biodiversity plot of chunk unnamed-chunk-7



PrincetonUniversity/agroEcoTradeoff documentation built on May 8, 2019, 3:12 p.m.