Battery 18650 T4 Thermal Hybrid Opt#

Source: examples/optimization/battery_18650_t4_thermal_hybrid_opt.py

Introduction#

Inspect the T4 thermal hybrid battery optimization benchmark.

Technical Implementation#

This page is generated from the top-of-file module docstring and the example source code. The full script is included below for direct inspection.

 1from __future__ import annotations
 2
 3import design_research_problems as derp
 4from design_research_problems import MissingOptionalDependencyError
 5
 6COMMON_KEYS = (
 7    "cell_count",
 8    "connection_count",
 9    "cost_usd",
10    "design_volume_mm3",
11    "max_temperature_c",
12    "voltage_v",
13    "capacity_ah",
14    "current_limit_a",
15    "min_clearance_mm",
16)
17
18
19def main() -> None:
20    try:
21        problem = derp.get_problem("battery_18650_t4_thermal_hybrid_opt")
22        initial = problem.generate_initial_solution(seed=4)
23        hybrid_components = problem.objective_components(initial)
24        hybrid_provenance = problem.evaluation_provenance(initial)
25        explicit_problem = type(problem)(
26            metadata=problem.metadata,
27            statement_markdown=problem.statement_markdown,
28            resource_bundle=problem.resource_bundle,
29            requirements=problem.requirements,
30            max_cell_count=problem.max_cell_count,
31            minimum_spacing_mm=problem.minimum_spacing_mm,
32            objective_weights=problem.objective_weights,
33            cooling_coefficient_bounds=problem.cooling_coefficient_bounds,
34            passive_cooling_bounds=problem.passive_cooling_bounds,
35            ambient_temperature_bounds=problem.ambient_temperature_bounds,
36            thermal_model=problem.thermal_model,
37            thermal_neighbor_clearance_mm=problem.thermal_neighbor_clearance_mm,
38            thermal_contact_decay_mm=problem.thermal_contact_decay_mm,
39            thermal_contact_resistance_k_per_w=problem.thermal_contact_resistance_k_per_w,
40            thermal_flow_shadowing_factor=problem.thermal_flow_shadowing_factor,
41            thermal_airflow_axis=problem.thermal_airflow_axis,
42            thermal_reference_soc=problem.thermal_reference_soc,
43            maximum_temperature_c=problem.maximum_temperature_c,
44            load_current_a=problem.load_current_a,
45            backend_config=problem.backend_config,
46            evaluation_mode="explicit_circuit",
47            imbalance_model=problem.imbalance_model.value,
48        )
49        explicit_components = explicit_problem.objective_components(initial)
50        print(problem.metadata.problem_id)
51        print("hybrid-mode", hybrid_provenance.evaluation_mode)
52        print("hybrid", " ".join(f"{key}={hybrid_components[key]:.3f}" for key in COMMON_KEYS))
53        print("explicit", " ".join(f"{key}={explicit_components[key]:.3f}" for key in COMMON_KEYS))
54    except MissingOptionalDependencyError as exc:
55        print(exc)
56
57
58if __name__ == "__main__":
59    main()

Expected Results#

Run Command

PYTHONPATH=src python3 examples/optimization/battery_18650_t4_thermal_hybrid_opt.py

Run the command shown below from repository root. Output should summarize the problem setup, a baseline solution, or diagnostic values relevant to this example.