Optimization functions

This page documents all constraint and objective functions that form the mathematical core of the transport component model.

Overview

The optimization functions are organized into several categories:

  • Model Definition: Functions for creating the optimization model and defining decision variables
  • Constraints: Mathematical constraints that ensure feasible and realistic solutions, covering demand coverage, vehicle sizing, infrastructure limitations, and policy restrictions
  • Objective Function: The cost minimization function that drives the optimization
  • Workflow Runners: High-level functions that combine constraints and objectives for specific modeling scenarios

Each constraint function adds specific mathematical relationships to the optimization model, allowing users to build models of varying complexity depending on their analysis needs. The workflow runners provide pre-configured combinations of constraints for common use cases, from simple demand coverage to complex multi-modal infrastructure planning.

Model definition

TransComp.create_modelFunction
create_model(data_structures, case_name::String, optimizer)

Definition of JuMP.model and adding of variables.

Arguments

  • data_structures: dictionary with the input data and parsing of the input parameters
  • case_name::String: name of the case
  • optimizer: optimizer to use for the model

Returns

  • model::JuMP.Model: JuMP model with the variables added
  • data_structures::Dict: dictionary with the input data
source
TransComp.base_define_variablesFunction
base_define_variables(model::Model, data_structures::Dict)

Defines the variables for the model.

Arguments

  • model::Model: JuMP model
  • data_structures::Dict: dictionary with the input data
source

Constraints

TransComp.constraint_demand_coverageFunction
constraint_demand_coverage(model::JuMP.Model, data_structures::Dict)

Creates constraint for demand coverage.

Arguments

  • model::JuMP.Model: JuMP model
  • data_structures::Dict: dictionary with the input data
source
TransComp.constraint_vehicle_sizingFunction
constraint_vehicle_sizing(model::JuMP.Model, data_structures::Dict)

Creates constraint for vehicle sizing.

Arguments

  • model::JuMP.Model: JuMP model
  • data_structures::Dict: dictionary with the input data
source
TransComp.constraint_vehicle_agingFunction
constraint_vehicle_aging(model::JuMP.Model, data_structures::Dict)

Creates constraints for vehicle aging.

Arguments

  • model::JuMP.Model: JuMP model
  • data_structures::Dict: dictionary with the input data

Returns

  • model::JuMP.Model: JuMP model with the constraints added
source
TransComp.constraint_monetary_budgetFunction
constraint_vehicle_purchase(model::JuMP.Model, data_structures::Dict)

Creates constraints for monetary budget for vehicle purchase by route.

Arguments

  • model::JuMP.Model: JuMP model
  • data_structures::Dict: dictionary with the input data
source
TransComp.constraint_fueling_infrastructureFunction
constraint_vehicle_purchase(model::JuMP.Model, data_structures::Dict)

Constraints for the sizing of fueling infrastructure at nodes and edges.

Arguments

  • model::JuMP.Model: JuMP model
  • data_structures::Dict: dictionary with the input data
source
TransComp.constraint_supply_infrastructureFunction
constraint_supply_infrastructure(model::JuMP.Model, data_structures::Dict)

Constraints for sizing of supply infrastructure at nodes and edges.

Arguments

  • model::JuMP.Model: JuMP model
  • data_structures::Dict: dictionary with the input data
source
TransComp.constraint_mode_infrastructureFunction

constraintmodeinfrastructure(model::JuMP.Model, data_structures::Dict)

Constraints for sizing of mode infrastructure at nodes and edges.

Arguments

  • model::JuMP.Model: JuMP model
  • data_structures::Dict: dictionary with the input data
source
TransComp.constraint_fueling_demandFunction
constraint_fueling_demand(model::JuMP.Model, data_structures::Dict)

Constraints for fueling demand at nodes and edges.

Arguments

  • model::JuMP.Model: JuMP model
  • data_structures::Dict: dictionary with the input data
source
TransComp.constraint_vehicle_stock_shiftFunction
constraint_vehicle_stock_shift(model::JuMP.Model, data_structures::Dict)

Constraints for vehicle stock turnover.

Arguments

  • model::JuMP.Model: JuMP model
  • data_structures::Dict: dictionary with the input data
source
TransComp.constraint_mode_shiftFunction
constraint_mode_shift(model::JuMP.Model, data_structures::Dict)

Constraints for the rate of the mode shfit.

Arguments

  • model::JuMP.Model: JuMP model
  • data_structures::Dict: dictionary with the input data
source
TransComp.constraint_mode_shareFunction
constraint_mode_share(model::JuMP.Model, data_structures::Dict)

If share are given for specific modes, this function will create constraints for the share of the modes. When this constraint is active, it can be a source of infeasibility for the model as it may be not possible to reach certain mode shares due to restrictions in the shift of modes (see parametrization of parameters alphaf and betaf). Especially also when constraints for minimum/maximum mode shares are active.

Arguments

  • model::JuMP.Model: JuMP model
  • data_structures::Dict: dictionary with the input data
source
TransComp.constraint_max_mode_shareFunction
constraint_max_mode_share(model::JuMP.Model, data_structures::Dict)

If share are given for specific modes, this function will create constraints for the share of the modes. When this constraint is active, it can be a source of infeasibility for the model as it may be not possible to reach certain mode shares due to restrictions in the shift of modes (see parametrization of parameters alphaf and betaf). Or when multiple constraints for the mode share are active.

Arguments

  • model::JuMP.Model: JuMP model
  • data_structures::Dict: dictionary with the input data
source
TransComp.constraint_min_mode_shareFunction
constraint_min_mode_share(model::JuMP.Model, data_structures::Dict)

If share are given for specific modes, this function will create constraints for the share of the modes. When this constraint is active, it can be a source of infeasibility for the model as it may be not possible to reach certain mode shares due to restrictions in the shift of modes (see parametrization of parameters alphaf and betaf). Or when multiple constraints for the mode share are active.

Arguments

  • model::JuMP.Model: JuMP model
  • data_structures::Dict: dictionary with the input data
source
TransComp.constraint_market_shareFunction
constraint_market_share(model::JuMP.Model, data_structures::Dict)

If share are given for specific vehicle types, this function will create constraints for the newly bought vehicle share of vehicles the modes.

Arguments

  • model::JuMP.Model: JuMP model
  • data_structures::Dict: dictionary with the input data
source
TransComp.constraint_emissions_by_modeFunction
constraint_emissions_by_mode(model::JuMP.Model, data_structures::Dict)

Emissions given per mode for a specific year. Attention: This constraint may be a source for infeasibility if mode or technology shift cannot be achieved due to restrictions in the shift of modes (see parametrization of parameters alphaf and betaf), or due to the lifetimes of technologies as well as the lack of available low emission or zero emission technologies.

Arguments

  • model::JuMP.Model: JuMP model
  • data_structures::Dict: dictionary with the input data
source

Objective

TransComp.objectiveFunction
objective(model::Model, data_structures::Dict)

Definition of the objective function for the optimization model.

Arguments

  • model::Model: JuMP model
  • data_structures::Dict: dictionary with the input data
source

Workflow Runners

TransComp.run_minimum_viable_caseFunction
run_minimum_viable_case(data_structures::Dict, optimizer)

Runs the minimum viable case: creates the model, applies demand coverage constraint, and sets the objective.

Arguments

  • data_structures::Dict: dictionary with the input data
  • optimizer: JuMP optimizer

Returns

  • model::JuMP.Model: JuMP model with constraints and objective set
  • data_structures::Dict: dictionary with the input data
source
TransComp.run_vehicle_stock_sizingFunction
run_vehicle_stock_sizing(data_structures::Dict, optimizer)

Creates model, applies demand coverage and vehicle sizing constraints, and sets the objective. Output: Cost-optimal coverage of travel demand with sizing of required vehicle stock.

source
TransComp.run_vehicle_stock_agingFunction
run_vehicle_stock_aging(data_structures::Dict, optimizer)

Creates model, applies demand coverage, vehicle sizing, and vehicle aging constraints, and sets the objective. Output: Cost-optimal coverage of travel demand with sizing of required vehicle stock under the consideration of the age structure of the vehicles.

source
TransComp.run_constrained_technology_shiftFunction
run_constrained_technology_shift(data_structures::Dict, optimizer)

Creates model, applies demand coverage, vehicle sizing, vehicle aging, and vehicle stock shift constraints, and sets the objective. Output: Cost-optimal coverage of travel demand with sizing of required vehicle stock under the consideration of the age structure of the vehicles and limitations on the speed of vehicle stock shift.

source
TransComp.run_fueling_infrastructure_sizingFunction
run_fueling_infrastructure_sizing(data_structures::Dict, optimizer)

Creates model, applies demand coverage, vehicle sizing, fueling demand constraints, and sets the objective. Output: Cost-optimal coverage of travel demand with sizing of required vehicle stock and expansion of fueling infrastructure.

source
TransComp.run_constrained_mode_shiftFunction
run_constrained_mode_shift(data_structures::Dict, optimizer)

Creates model, applies demand coverage, vehicle sizing, mode shift constraints, and sets the objective. Output: Cost-optimal coverage of travel demand with sizing of required vehicle stock and constrained mode shift.

source
TransComp.run_mode_infrastructure_sizingFunction
run_mode_infrastructure_sizing(data_structures::Dict, optimizer)

Creates model, applies demand coverage, mode shift constraints, and sets the objective. Output: Cost-optimal coverage of travel demand under limitation of speed of shift.

source