Skip to content

Commit

Permalink
admm jobs on cpu
Browse files Browse the repository at this point in the history
  • Loading branch information
degleris1 committed Jan 11, 2025
1 parent e791c6b commit 5b5c790
Show file tree
Hide file tree
Showing 2 changed files with 170 additions and 0 deletions.
84 changes: 84 additions & 0 deletions experiments/solve/config/scaling_cont_v06cpu.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
---

system:
threads: 128
runtime: 240
memory: auto

data:
name: pypsa
case: load_medium
start_hour: peak_hybrid_day
num_nodes: 500
num_hours: 120 # Total number of hourds in the dataset
add_ground: true
use_batteries: true
use_extra_components: false
dont_expand: [hydro, coal, biomass]
scale_by_hours: false
args:
power_unit: 1000.0 # 1e3 = GW
cost_unit: 10.0 # $ / MWh
marginal_load_value: 500.0 # $ / MWh
scale_load: [expand, 0.5, 0.6, 0.7]
scale_generator_capacity_factor: 0.7
scale_line_capacity_factor: 0.7
carbon_tax: 0.0 # $ / ton CO2
generator_cost_perturbation: 1.0 # MW
load_cost_perturbation: 10.0 # MW
drop_empty_generators: false
expand_empty_generators: 0.5 # MW
battery_discharge_cost: 1.0 # $ / MWh
battery_init_soc: 0.0
battery_final_soc: 0.0

parameters:
parameter_types: [generator, dc_line, ac_line, battery]
hours_per_scenario: 24 # Hours in one "batch"
capacities: [base] # base, 1.5, base_v07/000/model_00500

solver: admm # admm, cvxpy

battery_window: 24 # Hours for battery time horizon
num_contingencies: [expand, 0, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100]

cvxpy_args:
solver: MOSEK
solver_kwargs:
verbose: true
accept_unknown: true
mosek_params:
MSK_IPAR_NUM_THREADS: 16
# MSK_DPAR_INTPNT_TOL_REL_GAP: 1.0e-3
# MSK_DPAR_INTPNT_TOL_DFEAS: 1.0e-3
# MSK_DPAR_INTPNT_TOL_PFEAS: 1.0e-3

admm_args:
# Machine settings
machine: cpu
dtype: float32
resid_norm: 2
safe_mode: false
scale_dual_residuals: true
relative_rho_angle: false
verbose: false

# Duration and tolerance
num_iterations: 10000
minimum_iterations: 10000
atol: 1.0e-3

# Step size
rho_power: 1.0
rho_angle: 1.0
alpha: 1.0 # Over-relaxation

# Adaptation
adaptive_rho: true
adaptation_frequency: 10
adaptation_tolerance: 2.0
tau: 1.1

# Battery prox operator parameters
battery_inner_iterations: 10
battery_inner_weight: 1.0
86 changes: 86 additions & 0 deletions experiments/solve/config/scaling_hours_v04cpu.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
# Changed battery window to 0
# so we just run a single problem (no batches) with varying time horizon

---

system:
threads: 128
runtime: 240 # minutes
memory: auto

data:
name: pypsa
case: load_medium
start_hour: peak_hybrid_day
num_nodes: 500
num_hours: 768 # Total number of hourds in the dataset
add_ground: true
use_batteries: true
use_extra_components: false
dont_expand: [hydro, coal, biomass]
scale_by_hours: false
args:
power_unit: 1000.0 # 1e3 = GW
cost_unit: 100.0 # $ / MWh
marginal_load_value: 500.0 # $ / MWh
scale_load: [expand, 0.5, 0.6, 0.7]
scale_generator_capacity_factor: 0.7
scale_line_capacity_factor: 0.7
carbon_tax: 0.0 # $ / ton CO2
generator_cost_perturbation: 1.0 # MW
load_cost_perturbation: 10.0 # MW
drop_empty_generators: false
expand_empty_generators: 0.5 # MW
battery_discharge_cost: 1.0 # $ / MWh
battery_init_soc: 0.0
battery_final_soc: 0.0

parameters:
parameter_types: [generator, dc_line, ac_line, battery]
hours_per_scenario: [expand, 24, 48, 96, 192, 384, 768] # Hours in one "batch"
capacities: [base] # base, 1.5, base_v07/000/model_00500

solver: admm # admm, cvxpy

battery_window: 0 # Hours for battery time horizon

cvxpy_args:
solver: MOSEK
solver_kwargs:
verbose: true
accept_unknown: true
mosek_params:
MSK_IPAR_NUM_THREADS: 16
# MSK_DPAR_INTPNT_TOL_REL_GAP: 1.0e-3
# MSK_DPAR_INTPNT_TOL_DFEAS: 1.0e-3
# MSK_DPAR_INTPNT_TOL_PFEAS: 1.0e-3

admm_args:
# Machine settings
machine: cpu
dtype: float32
resid_norm: 2
safe_mode: false
scale_dual_residuals: true
relative_rho_angle: false
verbose: false

# Duration and tolerance
num_iterations: 5000
minimum_iterations: 5000
atol: 1.0e-3

# Step size
rho_power: 1.0
rho_angle: 1.0
alpha: [sweep, 1.0, 1.5] # Over-relaxation

# Adaptation
adaptive_rho: true
adaptation_frequency: 10
adaptation_tolerance: 2.0
tau: 1.1

# Battery prox operator parameters
battery_inner_iterations: 10
battery_inner_weight: 1.0

0 comments on commit 5b5c790

Please sign in to comment.