Skip to content

TargetEcon Model — Overview

Model file: TargetEcon 2026.gms Type: Mixed-Integer Programming (MIP) optimization in GAMS Solver: MIP solver (CPLEX or similar), via solve catchment using mip minimizing yy Last model version read: 2026-04-04


What the model does

TargetEcon finds the minimum-cost combination of environmental measures that meets legally- or politically-mandated reduction targets for nitrogen (N) and phosphorus (P) in Danish water bodies, subject to a rich set of constraints about what can be implemented where.

It is spatially explicit to the individual agricultural field level (~hundreds of thousands of fields across Denmark), with biophysical parameterization of costs, effects, and implementation potential for each field–measure combination. Decisions are binary: a measure is either implemented on a field or not.


The optimization problem

Objective: Minimize total annual cost (DKK/yr) across all measures and all spatial units:

minimize:  y  =  Σ_k Total_cost_k(k)

including costs from: - Field-level agricultural measures (opportunity costs + implementation costs) - Mini-wetlands (fixed construction cost + land opportunity cost) - Wastewater treatment plant upgrades - Stream engineering measures (re-meandering, raising, ochre/sand traps, trees) - Overflow treatment

A large penalty term (Penalty1 = 9.999×10¹² DKK per ton N; Penalty2 = 9.999×10¹³ DKK per kg P) is added for any unmet target (exceed(k), exceed_p(lakecatch)), making target violation a last resort.

Subject to: - N reduction targets at coastal catchment (k) level: Total_reduction_k(k) ≥ var_N × N_Targets(k) - P reduction targets at lake catchment level: P_Red_aft_ret(lakecatch) ≥ var_P × P_targets(lakecatch) - Tripartite Agreement area floors (when active) - Mutual exclusion constraints (at most one measure per field from most groups) - VP2 legacy constraints (already-implemented measures block re-use) - Physical constraints (P wetland vs. stream measure linkage)

Scenarios are controlled by switching scalars: | Scalar | Default | Meaning | |---|---|---| | var_N | 1 | N targets active (1) or off (0) | | var_P | 1 | P targets active (1) or off (0) | | var_B | 0 | Biodiversity targets (not yet fully implemented) | | var_C | 0 | Climate targets (not yet fully implemented) |


Spatial structure

Individual fields (i)
        ↓  [grouped by location]
ID15 sub-catchments (ret)     ← N retention applied here; MW indexed here
        ↓  [N routed to coast]
Coastal catchments (k)        ← N TARGETS defined here

Individual fields (i)
        ↓  [grouped by location]
Upstream lake catchments (up_lakecatch)  ← P reduction computed here
        ↓  [P transported via p_transp_matrix]
Lake catchments (lakecatch)              ← P TARGETS defined here
        ↓  [further chain routing]
Coastal catchments (k)        ← P also aggregated here via lakechain_k

See Spatial Hierarchy for full detail.


Measure categories

Category Codes Decision variable Indexed by
N field measures CCS, CCW, EC, IC, EW, N10, N20, SA, FO, LRl, LRh, BZ10, BZ20, WL x(i,j) binary Field i
P field measures PPC, NPB10, NPB20, OT, PWET, IBZ x(i,j) binary Field i
Combined N+P PPC_NPB10/20, NPB10/20_OT, NPB10/20_BZ10/20 x(i,j) binary Field i
Mini-wetlands MW1, MW2, MW3 (20/50/100 ha catchment) MW1x/2x/3x binary MW location
WWT upgrades MBN, MBNDK, MBNDKF, MBNDKFe WWTx(p,j) binary Plant p
Stream measures ochre, sand, re_meandering, raising v_w(w,w_m) binary Watercourse w
Erosion strip trees v_str(ero_stretch,str_m) binary Erosion stretch
Overflow overflow treatment OFx(pp) binary Overflow point pp

Total: ~35 measure types across field, sub-catchment, plant, and watercourse levels.


Key field-level parameters

Each field i carries: - IniPotV(i) — physical area (ha) - soil(i) — JB soil class (<5 = sandy, ≥5 = clay/loam) - livestock(i) — livestock density (DE/ha; threshold at 0.8) - oeko(i) — organic farming (0=conventional, 1=organic) - lav(i) — fraction of field that is low-lying (lavbund) - leaching(i) — N leaching (kg N/ha/yr) — basis for land-retirement N effects - Nhan(i) — N application norm (kg N/ha/yr) - TotRet(i) — total N retention fraction (%) - SurfRet(i) — surface-flow N retention fraction (%) - MarkAccess(i,cy) — crop code by crop year (5 years: 2014–2018) - erosion_field(i), macropore_field(i), matrix_ha(i) — P loss parameters - BZ10Pot(i), BZ20Pot(i) — buffer zone potential (fraction of field) - Vaadomrpot(i) — wetland potential (fraction of field) - IBZ_pot(i) — IBZ potential (fraction of field)


Data architecture

The model is driven by a large set of .inc files (>60) loaded via $include statements. These contain: - Set definitions (which fields belong to which catchment, etc.) - Biophysical parameters (retention, leaching, P loss, potentials) - Cost parameters (gross margins by crop, soil, livestock, organic status) - Effect parameters (some hard-coded in the .gms, some from files) - Policy targets (N and P target levels)

The VP2 results (prior water action plan) are loaded from a GDX file: VP2_OCT2021_Raphael_collective_measures. These fix which fields already have permanent measures implemented.

See Data / .inc files overview for the full inventory.


Version history highlights

Date Change
2026-01-20 WL N effect changed to flat 90 kg/ha/yr (was soil-differentiated: 190/120)
2024-12 Mini-wetland costs updated to include gross margin of the MW area
2024-12 MW surface retention (SurfRet_ID15) applied to MW N reduction
2024-12 N targets updated (file: N_targets_DEC2024.inc)
2024-12 P targets updated (file: P_targets_Dec2024.inc)
2023-11 WL P effect set to 0 (previously PotV × 1.9 kg P/ha)
2021-11 Added 200 DKK/ha/yr surcharge for livestock fields (WL, SA, FO, LRl, LRh)
2021-07 Removed sandy-soil restriction for EC measure
2021-06 Added −12 correction to BZ N effects
2021 Model extended from pure N to include full P module