PARA115.PDF, 1999 July 20-1999 July 23

Online content

Fullscreen
A Case of Interaction between Systems Dynamics and Linear
Programming: The Rapim-Pirenaica Model!

Silvio Martinez, Francisco Gordillo, Elena Lépez, and Ismael Alcala

The authors are, respectively, Professor at the Universidad a Distancia (UNED) and at
the Consejo Superior de Investigaciones Cientificas (CSIC), Associate Professor at the
University of Seville, Associate Professor at the University of Alcala and Research
Assistant at the University of Seville.

Postal Address: Instituto de Economia y Geografia. CSIC.
C/ Pinar 25. 28006 Madrid, Spain.
Telephone: (34) 91 4111098; Fax: (34) 91 5625567; e-mail: smartinez @ieg.csic.es.

Abstract

This objective of this paper is to reproduce the functioning of a farm which
mixes agriculture with livestock-raising. Furthermore, it attempts to integrate, within the
framework of a dynamic simulation model, the resolution of a problem of linear
programming that yields the optimum mix of crops and livestock that satisfies the given
set of restrictions. The aim of this exercise is to maximize the total value of the output
of a farm that produces 16 different economic goods. This exercise considers 10
constraints including, among others, the following: the initial herd size for each type of
animal; the amount of land devoted respectively to cultivation, forest, and pasture; the
average returns of each crop; the restrictions on crop rotation; and the available amount
of familial and extra-familial labor. The physical returns of the crops, the sale price of
each crop and each type of animal, and wages, are exogenous data. Since this model is
written in the program Vensim, the above-mentioned optimization model will be dealt
with utilizing Vensim’s external functions, calling for a function C of lineal
programming problems.

The objective of the Rapim-Pirenaica model is twofold. First, it tries to

reproduce the behavior and relations of the different variables that intervene in the
functioning of a farm that produces both crops and livestock. Second, it aims to specify
the optimum combination of crops and livestock (i.e. the combination that yields the
highest return) compatible with the socioeconomic characteristics and limitations of the
farm under study. The construction of such a model brings together systems dynamics
and linear programming techniques. It moreover requires information regarding the
following:
1. The physical characteristics of the farm, that is, the amount of land used for crop
production, land that is not used for crop production, initial size of the livestock herd,
and of the labor force (which presumably could include both family and non-family
labor);
2. Initial prices of the different types of economic activities and their evolution over

time;

and

3. Average productivities of the various economic activities, i.e. Kg/Ha. of the different
types of crops, liters of milk/head per annum, and so on.

The economic activities included are 16 (X1 to X16) and include the following:

[Type Productivity Units [Labor Req. [Price Grow

Initial Rate
x1 |= [Potatoes ICrop 17200 Kg/Ha |s0 [Ha |27,4 |ptas/kg_|1,07
x2 |= |Wheat ICrop 7800 KgJHa |4 Ha |21,9_|ptasJkg (1,025
x3 [= [Oats ICrop 7800 Kg JHa |4 Ha |19,6 [ptaskg (1,02
xa Straw Subp.wheat and oats [1800 (x2+x3) KgJHa |0,0007 [Kg |4,9  |ptaskg [1,03
x5 |= |Forrage crops [Crop 27000 Kg/Ha |6 Ha |7,1__ |[ptaskg_|1,07
x6 |= [Artificial meadow |Meadow 4900 KgJHa [2 Ha |7,1_|ptas/kg_|1,07
x7 Natural meadow |Meadow 3600 Kg JHa [2 Ha [8 ptas/kg|7,07
x8 Other crops ICrop 3300 Kg JHa |4 Ha |10 _|ptaskg_|7,07
x9 [= Fallow ICrop 800 KgJHa [2 Ha |i ptas/kg (1,05
X10|= |Forrestedland [Forrest T600 Kg/Ha fit [Ha |7,2 _[ptas/kg_|7,07
X11 [= |Lambs Livestock 7 Head [8 Head |5000 |ptas/head |1,02
X12 |= [Calves Livestock 7 Head [15 [Head |75000 |ptas/head |1,02
X13 |= [Sheep Livestock 7 Head |7 Head |3000__|ptas/head |7,07
X14 |= [Cattle Livestock 7 Head [9 Head |98000 |ptas/head 7,07
X15 [= [Milk Subproduct cattle [27° X14 Liters 0,007 |Liters |30 __|ptas/iitro [1,02
X16 [= _[Manure [Subproduct livestock [150°X13+300°X14 |Kgs. _|0,0005 |Kgs. [5.6 |ptas/kg._|1,07

The methodological scheme of the Rapim-Pirenaica model is illustrated by the
diagram below:

Methodological Scheme of the Rapim-Pirenaica Model

Modelling of the General Aspects of the Farm with SD Techniques

Optimum Distributio

n of Economie Activities

Estimates of the Profitability of the Different Economic Activities

‘imulations regarding alternative distributions of Economic Activities

In his attempt to maximize the economic returns of the farm under study, the farmer
runs into a number of restrictions, which are the following:
Cl: The production of potatoes, wheat, oats, forage and other crops, and fallow allows
some crop rotation. Thus, the sum of land under tillage every year can be up to 1.5 times
the amount of land available at any one time for production, thanks to crop rotation.

C2: The sum of prairies, both natural and artificial, and forested areas should be equal to
the amount of land not used for crop production.

C3: The requirements of labor needed to produce crops and livestock should not exceed
the amount of labor available at any given moment of time.

C4: The amount of straw that can be sold should be equal or less than the average
productivity multiplied by the number of hectares in wheat and oat.

C5: The amount of manure that can be sold should be equal or less than the average
productivity per cow and sheep multiplied by the number of cows and sheep.

C6: The number of lambs that can be sold should be equal or less than the growth rate of
lambs after substracting the replacement rate.

C7: The number of calves that can be sold cannot exceed the growth rate after
substracting the replacement rate.

C8: The number of cows to be sold cannot exceed the rate of growth.

C9: The number of sheep to be sold cannot exceed the rate of growth.

C10: Total amount of milk to be sold should be equal or less than the average
productivity per cow multiplied by the number of cows.

This attempt to maximize economic returns subject to linear constraints can be
formulated as a linear programming problem that can be solved by means of the well-
known Simplex method (Dantzig, 1963). In the present case, some implementation
difficulties appear due to the fact that the problem is defined inside a dynamic model.
These difficulties can be overcome using the external function capability of some
System Dynamics languages. The Rapim-Pirenaica model is written in Vensim which
allows the use of external functions. A new external function which implements the
Simplex method based on the version of (Press et al., 1992) has been programmed. In
this way a new function is added to the list of Vensim functions: the Simplex function
that can be called from any model to solve a linear programming problem in each time
step . Notice that this function is different from the Vensim MARKETP function and
that the problem can not be formulated by means of the optimization capabilities of
Vensim which cover the whole simulation.

The input data of the Simplex function is a matrix in which the first row contains the
coefficients of the objective function (in the present case, the sum of the profitability of
each economic activity R; = Productivity; * Price;) and the rest of rows contain the
coefficients of the constraints (C1-C10). The function returns a vector with the optimal
values of the unknowns (crops and stock., in the current problem).

The constraint block of the input matrix takes the following form:
RI R2 RS R4 R5 IR6 R7 R8 RO R10 (|R11 R12 |R13 [R14 [R15 [R16

C1 |S ft 1 1 10 1 10 lo 1 1 0 10 lo 10 10 lo 10
C2 |S — [0 O lO 10 iO 1 1 10 0 1 lO 0 10 10 Oo 10
C3 |— |50 4 4 10,0001 |6 2 2 4 2 1,1 8 15 7 9 0,001 |0,0005
C4 |S — ]0 0 10 1 Oo 10 lo 10 10 0 10 lo 10 10 lo 10
C5 |S — [0 O lO 10 iO 10 Oo 10 0 O lO 0 10 10 Oo 1
C6 |S — [0 0 10 lO iO 10 0 10 10 0 a 0 10 10 0 10
C7 |= |0 0 10 10 0 10 0 10 10 0 10 1 10 10 0 10
C8 |S — [0 O lO 10 iO 10 Oo 10 0 O lO 0 1 10 Oo 10
C9 |S — 0 0 10 lO iO 10 0 10 10 0 10 0 10 1 0 10
C1 /5— 0 0 10 10 0 10 io lO 10 0 10 iO 0 10 1 lO
ot = ]0 iO 10 10 0 10 Oo 10 10 iO 10 0 10 10 Oo 1
i

Where:

Ci =  1,5* extension of land for crop cultivation

c2 = Extension of non-cultivated or idle land

c3 = Available labor force

c4 = 1800*(wheat+oats)

C5 = 150*Sheep+ 300*Cattle

C6 = 1.2*Sheep

C7 = 0,85*Cattle

c8 = 0,2*Sheep

cg = 0,2*Cattle

c10 = 27*Cattle

Given the large number and complexity of the constraints considered, we do not
believe that the optimization problem could be adequately written directly into the SD
model. However, the linkage between the model and a linear programming library
identifies the distribution of crops and livestock herds that provides the maximum return
and introduces the optimum combination of economic activities into the model to
provide information on the evolution of the other variables considered. Furthermore,
this linkage guarantees automatic recalculation of the optimum distribution of economic
activities when simulating changes in the restrictions, size of labor force, sets of prices,

etc. The causal diagram below illustrates the steps to be followed in the construction of

such a combined model.

Causal Diagram of the main relations of the Rapim Pirenaica Model

a7?

Linear Programmi ag ]
+ n

‘Objetive fonction Constraints

Simplex
Matcix of the Problem

in cestricved form: Algorithm H

Solution matrix of the

Simplex Algockse

EXTERNAL DLL
1

For the purpose of this paper two different simulations have been run. The first
one considers the set of constraints, the productivities, and the prices of each activity as
illustrated above. The second simulation utilizes a different set of growth rates of some
prices. More specifically, the base and alternative (base 1) scenarios are the following:

Base Alternative
Scenario Scenario

x1 1,01 1
X2 = 1,025 1,16
X3 1,02 1,16
X4-——- 1,03 1,16
X5 1,01 1,01
X6 1,01 1,01
X7 1,01 1,01
X8 1,01 1,01
X9 1,05 1,05
X10 1,01 1,01
X11 1,02 1,02
X12 1,02 1,02
X13 1,01 1,01
X14 1,01 1,01
X15 1,02 1,02
X16 1,01 1,01

Thanks to the linkages between the LP library and the SD model, a new set of
results arises in just a few instances. The chart and diagrams that follow show the
optimum combination of economic activities under both sets of assumptions. As can
easily be seen, an increase in the rate of growth of the price of wheat, oats, and straw
coupled with a reduction in the rate of growth of the price of potatoes, yields a
rearrangement of the optimum production of the economic activities. The outcome in
this case will be fewer potatoes and other crops, and more wheat, oats, and their
subproduct, straw. Obviously, it is not the specificic results of this case study that
matter, but the fact that the linkage proves to be the best way to integrate the results of a
complex optimization problem into a System Dynamics model.

The table below summarizes the optimum output for each economic activity for
both the base and alternative simulations. The diagrams that follow illustrate the
evolution over time of the value of total output as well as that of the production of
wheat, the crop more acutely affected by the price changes.
Year | Tot.Produc. Potatoes | Wheat Oats Straw Forrage Art. Meadow | Nat. Meadow | Other crops
(Mill ptas.) | (Has.) (Has.) (Has.) (Kg.) (Has.) (Has.) (Has.) (Has.)

7983, 67.9 679| 37 37] 90 90 00 oOo] i170 110/ 19 #4119 40 £40 50 50! 37 37
1984] 388 389) 37 37/ 00  00/ 00 oof 167 167) 1.9 19) 127 127/ 00 oof 214 214
1985] 59.6 596 36 36 00 0.0/ 00 oof 00 oof 18 18] 105 105] 0.0 00] 209 209
1986] 638 637) 49 49] 00 00/ 00 oof 00 oof 24 24 116 116, 0.0 00] 288 288
1987| 84.1 841) 32 32) 00 0.0] 00 oof 00 00f 16 16] 11.0 11.0] 0.0 oof 183 183
1988] 116.4 1163) 34 34] 00 0.0] 00 oof 00 oof 17 17) 103 103) 0.0 oof 194 194
1989] 124.4 1246 37 37; 00  93/ 00 oof oo oof 19 19) 94 94/ 0.0 oof 218 126
1990] 141.7 1427) 47 47/ 00 00] 00 116] 00 175] 23 23] 128 128] 0.0 oof 272 15.6
i991] 144.2 1456 31 34/ 00  77/ 00 oof oo 229) 15 15 11.2 112] 0.0 oof 175 98
i992] 162.2 1639) 42 42] 00 105] 00 oof 00 147) 21 24] 95 95] 0.0 o0f 249 144
1993] 1726 1748) 4.0 40/ 00 99] 00 oof 00 212) 20 20] 133 133) 0.0 o0| 227 128
i904] 156.8 1595) 42 42| 00 105/ 00 oof oo 178) 21 24] 41.1 114] 00 oof 246 14.1
1995] 166.6 1701) 4.0 40; 00 100! 00 oof oo 193) 20 20) 11.1 114] 0.0 oof 235 135
1996] 177.2 1808] 33 33/ 00  82/ 00 oof oo 194 16 16] 11.5 115] 0.0 00f 188 105
i997| 188.8 1924) 31 314/ 00 00] 00 78 00 159) 16 16/ 104 1041 00 oof 179 10.1
i998] 191.5 1952) 23 23; 00 58] 00 oof 00 150) 12 12) 130 130| 00 oof 122 64
i999] 205.9 2104) 28 28] 00 69] 00 oof 00 106 14 14/ 125 125] 0.0 oof 152 83
2000] 2185 2264 45 45/ 00 11.2] 0.0 00] 00 126, 22 221 121 1211 00 oo] 262 15.0

Year | Fallow Forrest | Lambs Calves Sheep Cattle Milk Manure

(Has.) (Has.) (Heads) (Heads) (Heads) (Heads) (Liters) |(1000kg)

7983) «47 + ~ «#47, «30 + «430/00 oof 60 60/ 00 OOf 1.0 10] 230 230] 6148 6148
1984] 0.0 00/ 00 0.0| 278 278] 00 00 00 00] 16 16) 21.6 21.6] 3150 3150
1985] 0.0 00) 00 00| 102 102! 00 oof 00 00] 33 33) 439 43.9] 4875 4875
1986] 0.0 0.0/ 00 0.0| 254 254, 00 00 00 oof 1.3 1.3) 17.1 17.1] 5398 5398
1987] 0.0 00/ 00 00| 248 248 00 00 00 00] 25 25] 342 34.2] 7237 7237
1988] 0.0 00) 00 0.0| 256 256 00 00] 00 00] 26 26] 35.6 35.6 10237 10237
1989] 0.0 00) 00 00| 133 133] 00 00 00 00] 16 16] 21.5 21.5] 10946 10946
1990] 0.0 0.0/ 00 00| 253 25.3/ 00 00] 00 00] 32 32] 43.2 43.2] 12063 12063
i991] 0.0 00/ 00 0.0| 200 20.0/ 00 oof 00 00] o7 07| 94 9.4] 12603 12603
i992] 0.0 0.0/ 00 00| 298 298 00 00 00 00] 24 24] 327 327] 13707 13707
i993] 0.0 00) 00  00o| 74 74 00 00 0.0 00] 20 20| 268 26.8] 14481 14481
i994] 0.0 0.0) 00 00| 178 178 00 00 00 oof 1.7 17, 224 224] 13091 13091
1995] 0.0 00/ 00 00| 279 279 00 oof 00 oof 23 23] 31.2 31.2] 13817 13817
1996] 0.0 00) 00 00| 90 90/ 00 oof o0 oof 1.2 12) 15.9 15.9] 14625 14625
i997] 0.0 «0.0, «Ss .0Ssi0.0] «20.3 20.3 00s], sisi] Bs28]S_38.0 ~—-38.0] 15286 15286
1998] 0.0 00) 00 00] 123 123] 00 oof 00 00 05 05| 67 67] 15941 15941
1999] 0.0 0.0) «0.0 S0.0]s 81.2 = 3.2} 00s], sisi] S22] 30.2 += 30.2] 16607 16607
2000} 00 0.0 00 0.0| 203 203] 00 oof 00 oof 15 4.5/ 208 20.8) 17435 17435

Production of wheat

5

1983 1985 1987

1989

1991 1993 1995 1997
Time (Years)

1999

Total Production

230

150

1995 1996

Produccion Total : base

1997 1998 1999
Time (Years)

2000

Bibliography

Brandsma, Andries, S. Hallett, A. J. Hughes, & Nico van der Windt (1984). Optimal
Economic Policies and Uncertainty: The Case Against Policy Selection by Nonlinear
Programming. Computers & Operations Research 11, 179-197.

Camara, Antonio, Paula Antunes, Manuel Pinheiro, & Julia Seixas (1986). Linguistic
Dynamic Modelling Using Logic Programming. In J. Aracil, J. A. D., Machuca, & M.
Karsky (Ed.), System Dynamics: On the Move. The 1986 International Conference of
the Systems Dynamics Society. Sevilla, Spain.

Dantzig, G.B. (1983) Linear Programming and Extensions. Princeton University
Press.

Garcia Dory and S. Martinez. (1985). El Modelo Rapim-Pirenaica, Valle de Aezcoa.
Mimeographed by CSIC, Madrid, Spain. Copies can be obtained from the first author
of this paper at the postal address provided in the first page.

Garcia Dory, M.A. y Martinez Vicente, S. (1988) La ganaderia en Espajia
¢ Desarrollo integrado o dependencia? Alianza Editorial.

Meudt, M. (1999) Implementation of Environmental Indicators in Policy Information
Systems in Germany. In Brouwer F and Crabtree, B. (eds), Environmental Indicators
and Agricultural Policy,. CABI Publishing.

Mohapatra, Pratap K. J. (1995). Use of Dynamics Diagrammatic Tools as
Represenation Schemes for Linear Programming Models. In Toshiro

Shimada & Khalid Saeed (ed.) System Dynamics '95, 2. The 1995 International
Conference of the Systems Dynamic Society. Tokyo, Japan, (pp. 698-707).

Press, W.H., Teutolsky, A.A., Vetterlinmg, W.T. and Flanney, B.P. (1992), Numerical
Recipes in C. The Art of Scientific Computing. Cambridge University Press.

Swart, J. Y Herne, J.W. (1989) A Mathematical Model to analyze Predation and
Competition Problems in a Sheep-Farming Region. System Dynamic Review 5,1: 35-
50.

Toval, A., Requena, A., Martinez, S. Y Monreal, J.(1986). Murcia A/I. A mixed
System of Dynamics and Linear Programming Model for Regional Investment
Planning. In J. Aracil, J. A. D. Machuca, & M. Karsky (eds.), System Dynamics: On
the Move. The 1986 International Conference of the Systems Dynamics Society (pp.
415-436). Sevilla, Spain.

Zhen, Fang (1992). A Study of Energy Supply and Demand System on Village Level.
In Jac A. M. Vennix, Jan Faber, Wim J. Scheper, & Cees A. Th.Takkenberg (Ed.),
Proceedings of the 1992 International System Dynamics Conference of the System
Dynamics Society Utrecht, the Netherlands (pp. 857-861).
' This paper is based on a previous study by M.A. Garcia Dory and S. Martinez, titled EJ Modelo
Rapim-Pirenaica, Valle de Aezcoa. Mimeographed by CSIC, 1985, Madrid, Spain.

This paper was financed by CICYT, project number AMB97-1000-C02-01 titled Evaluacién de la
desertificacién en Espana

Metadata

Resource Type:
Document
Rights:
Image for license or rights statement.
CC BY-NC-SA 4.0
Date Uploaded:
December 19, 2019

Using these materials

Access:
The archives are open to the public and anyone is welcome to visit and view the collections.
Collection restrictions:
Access to this collection is unrestricted unless otherwide denoted.
Collection terms of access:
https://creativecommons.org/licenses/by/4.0/

Access options

Ask an Archivist

Ask a question or schedule an individualized meeting to discuss archival materials and potential research needs.

Schedule a Visit

Archival materials can be viewed in-person in our reading room. We recommend making an appointment to ensure materials are available when you arrive.