Battery 18650 T3b Netlist Explicit Opt#

Source: examples/optimization/battery_18650_t3b_netlist_explicit_opt.py

Introduction#

Inspect the T3B explicit-netlist 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_t3b_netlist_explicit_opt")
22        initial = problem.generate_initial_solution(seed=3)
23        components = problem.objective_components(initial)
24        provenance = problem.evaluation_provenance(initial)
25        result = problem.solve(maxiter=5)
26        print(problem.metadata.problem_id)
27        print("evaluation-mode", provenance.evaluation_mode)
28        print("metric-keys", ",".join(sorted(components)))
29        print("initial", " ".join(f"{key}={components[key]:.3f}" for key in COMMON_KEYS))
30        print("solve", result.message)
31    except MissingOptionalDependencyError as exc:
32        print(exc)
33
34
35if __name__ == "__main__":
36    main()

Expected Results#

Run Command

PYTHONPATH=src python3 examples/optimization/battery_18650_t3b_netlist_explicit_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.