Van Butsic and Tobias Kuemmerle. 2015. Using optimization methods to align food production and biodiversity conservation beyond land sharing and land sparing. Ecological Applications 25:589595.


Matlab code for solving optimization problems and create Fig. 3 in the text.
Ecological Archives A025-032-S1.


File list (downloads)


Van Butsic
Department of Environmental Science, Policy, and Management
University of California Berkeley, Berkeley California, 94720, USA

Tobias Kuemmerle
Geography Department, Humboldt-University Berlin, Unter den Linden 6, 10099 Berlin, Germany
Integrative Research Institute on Transformations in Human-Environment Systems (IRI THESys), Humboldt-University Berlin, Unter den Linden 6, 10099 Berlin, Germany

File list

consletters.m (MD5: 2f9532ab9ff4f24590bca218e26fa674)

consconsletter1.m (MD5: 376470467e5c1959d2f1a153456f4129)

makebspareshare9.m (MD5: 16c990f61bb4242241c2b2facc674b4c)

profit.m (MD5: 2bc2a751b8a3d2d6f4f5dd7a4906cbaa)


There are 4 files of MATLAB code which will solve the optimization problems presented in Fig. 3 of the manuscript.

 “consletters.m”  This file contains the code to solve the optimization and calls out the following functions.

consconsletter1.m” is the constraint function that is called for the optimization.

makebspareshare9.m” contains the matrixes of coefficients for the yield density curves used in the optimizations.

profit.m” has the function to be maximized.

Key variables:

X= yield of each parcel(varies between 0–1)

a, g, in, in2 are coeffcients used to estimate the yield density curves

e = the minimum number of a given species that meets the minimum species constraint.

Obi= total production

All code is written and solved using the MATLAB optimization toolbox from MATLAB 2013B. We are unsure if the program will work in earlier or later versions.