\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage{mathtools}
\usepackage{blkarray}
\usepackage{longtable}
\usepackage{lscape}
\usepackage{arydshln}
\usepackage{supertabular}
\usepackage[lofdepth,lotdepth]{subfig}
\usepackage{authblk}
\usepackage[displaymath, mathlines]{lineno}
\newcounter{magicrownumbers}
\newcommand\rownumber{\stepcounter{magicrownumbers}\arabic{magicrownumbers}}



\title{A Healthy Diet for a Growing Population: A Case Study of Arua, Uganda\\ 
\quad\\
\large Appendix B - Linear Programming Model Formulation\\
\quad \\
\small Joural: Food Security}

\author[1,*]{M.I. Hermelink}
\author[2]{K.H. Pittore}
\author[3]{A. Alvarez Aranguiz}
\author[4]{F.I. Pereira da Silva}
\author[2]{M.M.I. Roefs}
\author[5]{R. Kajobe}
\author[5]{R. Maligumu}
\author[1]{H. Hengsdijk}
\affil[1]{Wageningen Plant Research, Droevendaalsesteeg 1, 6708 PB, Wageningen, The Netherlands}
\affil[2]{Wageningen Centre for Development Innovation, Droevendaalsesteeg 1, 6708 PB, Wageningen, The Netherlands}
\affil[3]{Wageningen Livestock Research, De Elst 1, 6708 WD, Wageningen, The Netherlands}
\affil[4]{Wageningen Food \& Biobased Research, Bornse Weilanden 9, 6708 WG, Wageningen,
The Netherlands}
\affil[5]{Muni University, P.O. Box 725, Arua, Uganda}
\affil[*]{Corresponding author: M.I. (Marleen) Hermelink, marleen.hermelink@wur.nl}
\date{}

\setcounter{Maxaffil}{0}
\renewcommand\Affilfont{\itshape\small}

\begin{document}
\linenumbers
\maketitle
\newpage

\begin{landscape}
\section{Appendix B1 - Model Symbols}

\begin {longtable}[t]{lcll}
\caption{Symbol definitons for the linear programming model in Appendix B2}\\
\hline
Symbol & Unit(s) & Definition \\
\hline
\multicolumn{3}{l}{\textbf{Sets}}\\
\hdashline[0.5pt/5pt]
$i$ & - & Cropping system \\
\hdashline[0.5pt/5pt]
$p$ & - & Crop  \\
\hdashline[0.5pt/5pt]
$j$ & - & Food product \\
\hdashline[0.5pt/5pt]
$k$ & - & Food group  \\
\hdashline[0.5pt/5pt]
$z$ & - & Human nutrient  \\
\hdashline[0.5pt/5pt]
$e$ & - & Animal nutrient \\
\hdashline[0.5pt/5pt]
$a$ & - & Animal type \\
\hdashline[0.5pt/5pt]
$t$ & - & Growing Season  \\
\hdashline[0.5pt/5pt]
& & & \\

\multicolumn{3}{l}{\textbf{Objective Value}}\\
\hdashline[0.5pt/5pt]
$A$ & ha & Agricultural area $i$ \\
\hdashline[0.5pt/5pt]
& & & \\

\multicolumn{3}{l}{\textbf{Decision Variables}}\\
\hdashline[0.5pt/5pt]
$x_i$ & ha & Area of cropping system $i$ \\
\hdashline[0.5pt/5pt]
$l_a$ & -  & Number of animals of type $a$ \\
\hdashline[0.5pt/5pt]
$r_{pa}$ & kg/y & Amount of crop residue of crop p fed to animal
type $a$\\
\hdashline[0.5pt/5pt]
$f_{ja}$ & kg/y & Amount of edible part of product $j$ fed to
animal type $a$ \\
\hdashline[0.5pt/5pt]
$q_{ja}$ & kg/y & Amount of non-edible part of product $j$ fed to animal type $a$ \\
\hdashline[0.5pt/5pt]
$h_{j}$ & kg/y & Amount of edible part of product $j$ consumed by humans \\
\hdashline[0.5pt/5pt]
$d_{j}$ & kg/y & Amount of edible part of product $j$ discarded \\
\hdashline[0.5pt/5pt]
\multicolumn{3}{l}{\textit{Continued on next page}}\\
\newpage

\hline
Symbol & Unit(s) & Description \\
\hline
& & & \\
\multicolumn{3}{l}{\textbf{Parameters}}\\
\hdashline[0.5pt/5pt]
$Y_{jp}$ & kg/ha/s &  Yield (per season) of product $j$ from crop $p$ \\
\hdashline[0.5pt/5pt]
$X_{p}$ & kg/ha/s &  Yield (per season) of crop residues from crop $p$ \\
\hdashline[0.5pt/5pt]
$Z_{ja}$ & kg/a/y & Yield (per year) of product $j$ from animal type $a$  \\
\hdashline[0.5pt/5pt]
$B_{pit}$ & 1/0 & Is crop $p$ produced in cropping system $i$ in season $t$? (binary)\\
\hdashline[0.5pt/5pt]
$P_{jk}$ & 1/0 & Does product $j$ belong to food group $k$? (binary: 1=yes, 0=no) \\
\hdashline[0.5pt/5pt]
$G^-_k, G^+_k$ & kg/y & Min \& max yearly intake of food group $k$ of whole population \\
\hdashline[0.5pt/5pt]
\hdashline[0.5pt/5pt]
$C_{zj}$ & kcal/kg  & Content of human nutrient $z$ in product $j$ per kg in harvest conditions   \\
 & g prot/kg &  \\
 & mg Iron/kg &  \\
 & $\mu$g RAE/kg &  \\
 \hdashline[0.5pt/5pt]
$N^-_z$ & kcal/y  & Min yearly intake of human nutrient $z$ of whole population \\
 & g prot/y  &  \\
 & mg Iron/y &  \\
 & $\mu$g RAE/y &  \\
 \hdashline[0.5pt/5pt]
$L_j$ & frac. & Fraction lost of product $j$ in supply chain \\
\hdashline[0.5pt/5pt]
$E_j$ & frac. & Edible fraction of product $j$ \\
\hdashline[0.5pt/5pt]
$D^{'}_p$ & kg DM/kg & Dry matter content of crop residue of crop $p$ in harvest conditions \\
\hdashline[0.5pt/5pt]
$D^{''}_j$ & kg DM/kg & Dry matter content of edible part of product $j$ in harvest conditions \\
\hdashline[0.5pt/5pt]
$D^{'''}_j$ & kg DM/kg  & Dry matter content of non-edible part of product $j$ in harvest conditions \\
\hdashline[0.5pt/5pt]
$M_a$ & kg DM/a/y & Min yearly dry matter intake for animal type $a$ \\
\hdashline[0.5pt/5pt]
$S^{'}_{pa}$ & 1/0 & Residues of crop $p$ suitable for animal type $a$? (binary: 1=yes, 0=no) \\
\hdashline[0.5pt/5pt]
$S^{''}_{ja}$ & 1/0 & Edible part of product $j$ suitable for animal type $a$? (binary: 1=yes, 0=no) \\
\hdashline[0.5pt/5pt]
\multicolumn{3}{l}{\textit{Continued on next page}}\\
\newpage
\hline
Symbol & Unit(s) & Description \\
\hline
$S^{'''}_{ja}$ & 1/0 & Non-edible part of product $j$ suitable for animal type $a$? (binary: 1=yes, 0=no) \\
\hdashline[0.5pt/5pt]
$T^{'}_{epa}$ & MJ ME/kg DM  & Content of animal nutrient $e$ in residue of crop $p$ for animal type $a$ \\
 & kg CP/kg DM &  \\
 & Fibrous DM? 1/0 &  \\
 \hdashline[0.5pt/5pt]
$T^{''}_{eja}$ & See $T^{'}_{epa}$  & Content of animal nutrient $e$ in edible part of product $j$ for animal type $a$ \\
\hdashline[0.5pt/5pt]
$T^{'''}_{eja}$ & See $T^{'}_{epa}$  & Content of animal nutrient $e$ in non-edible part of product $j$ for animal type $a$ \\
\hdashline[0.5pt/5pt]
$V^-_{ea}, V^+_{ea}$ & MJ ME/a/y & Min \& max intake per animal unit of nutrient $e$ by animal type $a$  \\
 & kg CP/a/y & \\
 & kg fibrous DM/a/y & \\
\hline
\end {longtable}
\end{landscape}

\section{Appendix B2 -  Model Formulation} \label{OptimizationProblem}


%\begin{equation*}
%\min_{x_{i}}          \;  \Big\{A = \sum_{i} x_{i}\Big\}   
%\end{equation*}

\begin{linenomath}
\begin{align*}  
\text{Objective Function:}  & \quad \min_{x_{i}}          \;  \Big\{A = \sum_{i} x_{i}\Big\} &                       &                           && 
\end{align*}

\begin{align*}
\text{\textit{Subject to:} }    &   &                                                                               &                           && \\
\text{\underline{Production:}}  &  &  \quad                                                                        & \quad                     &&\  \\
\text{Crop Res. Produced:}      &  &  \sum_{i,t}x_iX_pB_{pit}                                                      & =  R_{p}                  &&\  \forall p\\
\text{Food Produced:}           &  &  \sum_{i,p,t}x_{i}Y_{jp}B_{pit}(1-L_{j})E_j+l_{a}Z_{ja}                       & =  F_{j}                   &&\  \forall j\\
\text{Non-Edible Produced}      &  &  \frac{F_{j}}{E_{j}} (1-E_{j})                                                & =  Q_{j}                  &&\  \forall j\\
\text{Food for Pop.:}           &  &  F_{j} - \sum_{a}f_{ja} - d_{j}                                               & =  h_j                    &&\  \forall j\\
\text{\underline{Healthy Diet:}}&  &  \quad                                                                & \quad                     &&\  \\
\text{Food Group Intake:}       &  &  G^{-}_{k} \leq \sum_{j}h_{j}P_{jk}                                           & \leq  G^{-}_{k}           &&\  \forall k\\
\text{Nutrient Intake:}         &  &  \sum_{j}h_{j}C_{zj}                                                          & \geq  N_{z}               &&\  \forall z\\
\text{\underline{Feed Availability:}}        &  &                                                    &                      &&\  \\
\text{Crop Residue:}             &  &  \sum_{a}r_{pa}                                                               & \leq  R_{p}               &&\  \forall p\\
\text{Edible Frac.:}             &  &  \sum_{a}f_{ja}                                                               & \leq  F_{j}               &&\  \forall j\\
\text{Non-Edible Frac.:}         &  &  \sum_{a}q_{ja}                                                               & \leq  Q_{j}               &&\  \forall j\\
\text{\underline{Feed Requirements:}} &  &                                                                     &                      &&\  \\
\text{DM Intake:}                & \  & \sum_{p}r_{pa}D^{'}_pS^{'}_{pa}+   \qquad \qquad \qquad \qquad \qquad     &                      && \\
                                & \  & \sum_{j}\left(f_{ja}D^{''}_j S^{''}_{ja} +q_{ja}D^{'''}_jS^{'''}_{ja}\right)  & \leq  l_aM_a              &&\  \forall a\\
\text{Nutrient Intake:}          & \  & l_aV^{-}_{ea} \leq\sum_{p}r_{pa}D^{'}_{p}T^{'}_{epa}S^{'}_{pa}+ \qquad \qquad \qquad & \                      && \\
\quad                           &\   & \sum_{j}\left(f_{ja}D^{''}_jT^{''}_{eja}S^{''}_{ja} + q_{ja}D^{'''}_jT^{'''}_{eja}S^{'''}_{ja} \right)& \leq  l_aV^{+}_{ea}    &&\  \forall a\\
\quad                           &  &  \quad x_{i}, l_a, r_{pa}, f_{ja}, q_{ja}, h_{j}, d_j                         &\geq 0                     &&  \  \\
\end{align*}
\end{linenomath}

\newpage
\section{Appendix B3: Decision Sets}
\begin{table}[h]
\caption{ Set lists of crops ($i$), food products ($j$), food groups ($k$), human nutrients ($z$), animal nutrients ($e$), and growing seasons ($t$) used in the LP model. *Grass is included as a food product but has an edible fraction of 0.}\small
\subfloat{\begin {tabular}[t]{rlrl}

\hline
$p$ & Crop & $j$ & Food Product  \\
\hline
1 & maize       & 1  & maize  \\
2 & sorghum     & 2  & sorghum \\
3 & cassava     & 3  & cassava root  \\
  &             & 4  & cassava leaves  \\
4 & sweet potato& 5  & sweet potato root   \\
  &             & 6  & sweet potato leaves  \\
5 & plantain    & 7  & plantain \\
6 & mango       & 8  & mango  \\
7 & banana      & 9  & banana \\
8 & papaya      & 10 & papaya  \\
9 & beans       & 11 & beans \\
10 & pigeon pea & 12 & pigeon pea \\
11 & soybeans   & 13 & soybeans \\
12 & sesame     & 14 & sesame  \\
13 & groundnuts & 15 & groundnuts \\
14 & tomato     & 16 & tomato \\
15 & cabbage    & 17 & cabbage  \\
16 & onion      & 18 & onion  \\
17 & pumpkin    & 19 & pumpkin flesh  \\
   &            & 20 & pumpkin seeds  \\
   &            & 21 & pumpkin leaves  \\
18 & eggplant   & 22 & eggplant  \\
19 & sugarcane  & 23 & sugarcane stalks  \\
20 & grass      & 24 & grass*  \\
\multicolumn{4}{l}{}\\
\hline
$a$ & Animal Type & $j$ & Food Product  \\
\hline
1 & dairy cattle & 25 & beef \\
  &	             & 26 & milk \\
3 & beef cattle	 & 25 & beef \\
4 & goats	     & 27 & goat meat \\
5 & chicken	     & 28 & chicken meat \\
  &              & 29 & eggs  \\
\hline

\end{tabular}}
\quad
\subfloat{\begin {tabular}[t]{rl}
\hline
$k$ & Food Group  \\
\hline
1 & cereals  \\
2 & eggs  \\
3 & fruits  \\
4 & vegetables  \\
5 & meat  \\
6 & dairy  \\
7 & oils  \\
8 & legumes  \\
9 & tubers  \\
\multicolumn{2}{l}{}\\
\hline
$z$ & Human Nutrient  \\
\hline
1 & calories  \\
2 & proteins  \\
3 & Iron  \\
4 & vitamin A  \\
\multicolumn{2}{l}{}\\
\hline
$e$ & Animal Nutrient  \\
\hline
1 & metabolizable energy  \\
2 & crude protein  \\
3 & fibrous dry matter  \\

\multicolumn{2}{l}{}\\
\hline
$t$ & Growing Season  \\
\hline
1 & season 1 (Mar-May)  \\
2 & season 2 (Aug-Dec)  \\
\hline
\end{tabular}}

\end{table}
\nolinenumbers

\topcaption{Set list of cropping systems ($i$) included in the LP model, with the first crop grown in season 1 (Mar-May, $t=1$) and the second in season 2 (Aug-Dec, $t=2$). *Grass is included amongst the cropping systems as permanent grassland, with grass in both seasons, but its harvested product has en edible fraction of 0.} \small
\twocolumn
\tablehead{\hline $i$ & Cropping system  \\ \hline}
\begin{supertabular}{rl}
\rownumber & maize - maize  \\
\rownumber & maize - sorghum  \\
\rownumber & maize - sweet potato  \\
\rownumber & maize - potato  \\
\rownumber & maize - beans  \\
\rownumber & maize - pigeon pea  \\
\rownumber & maize - soybeans  \\
\rownumber & maize - sesame  \\
\rownumber & maize - groundnuts  \\
\rownumber & maize - tomato  \\
\rownumber & maize - cabbage  \\
\rownumber & maize - onion  \\
\rownumber & maize - pumpkin  \\
\rownumber & maize - eggplant  \\
\rownumber & sorghum - sorghum  \\
\rownumber & sorghum - sweet potato  \\
\rownumber & sorghum - potato  \\
\rownumber & sorghum - beans  \\
\rownumber & sorghum - pigeon pea  \\
\rownumber & sorghum - soybeans  \\
\rownumber & sorghum - sesame  \\
\rownumber & sorghum - groundnuts  \\
\rownumber & sorghum - tomato  \\
\rownumber & sorghum - cabbage  \\
\rownumber & sorghum - onion  \\
\rownumber & sorghum - pumpkin  \\
\rownumber & sorghum - eggplant  \\
\rownumber & sweet potato - sweet potato  \\
\rownumber & sweet potato - potato  \\
\rownumber & sweet potato - beans  \\
\rownumber & sweet potato - pigeon pea  \\
\rownumber & sweet potato - soybeans  \\
\rownumber & sweet potato - sesame  \\
\rownumber & sweet potato - groundnuts  \\
\rownumber & sweet potato - tomato  \\
\rownumber & sweet potato - cabbage  \\
\rownumber & sweet potato - onion  \\
\rownumber & sweet potato - pumpkin  \\
\rownumber & sweet potato - eggplant  \\
\rownumber & beans - pigeon pea  \\
\rownumber & beans - soybeans  \\
\rownumber & beans - sesame  \\
\rownumber & beans - groundnuts  \\
\rownumber & beans - tomato  \\
\rownumber & beans - cabbage  \\
\rownumber & beans - onion  \\
\rownumber & beans - pumpkin  \\
\rownumber & beans - eggplant  \\
\rownumber & pigeon pea - soybeans  \\
\rownumber & pigeon pea - sesame  \\
\rownumber & pigeon pea - groundnuts  \\
\rownumber & pigeon pea - tomato  \\
\rownumber & pigeon pea - cabbage  \\
\rownumber & pigeon pea - onion  \\
\rownumber & pigeon pea - pumpkin  \\
\rownumber & pigeon pea - eggplant  \\
\rownumber & soybeans - sesame  \\
\rownumber & soybeans - groundnuts  \\
\rownumber & soybeans - tomato  \\
\rownumber & soybeans - cabbage  \\
\rownumber & soybeans - onion  \\
\rownumber & soybeans - pumpkin  \\
\rownumber & soybeans - eggplant  \\
\rownumber & groundnuts - groundnuts  \\
\rownumber & groundnuts - tomato  \\
\rownumber & groundnuts - cabbage  \\
\rownumber & groundnuts - onion  \\
\rownumber & groundnuts - pumpkin  \\
\rownumber & groundnuts - eggplant  \\
\rownumber & sugarcane - sugarcane  \\
\rownumber & mango - mango  \\
\rownumber & banana - banana  \\
\rownumber & papaya - papaya  \\
\rownumber & cassava - cassava  \\
\rownumber & plantain - plantain  \\
\rownumber & grass - grass*  \\
\hline
\end{supertabular}
%https://tex.stackexchange.com/questions/159723/what-does-a-double-ampersand-mean-in-latex
\end{document}



