Battery 18650 T1 Rectangular Surrogate Opt#

Source: examples/optimization/battery_18650_t1_rectangular_surrogate_opt.py

Introduction#

Inspect the T1 rectangular surrogate 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
 4
 5COMMON_KEYS = (
 6    "cell_count",
 7    "connection_count",
 8    "cost_usd",
 9    "design_volume_mm3",
10    "max_temperature_c",
11    "voltage_v",
12    "capacity_ah",
13    "current_limit_a",
14    "min_clearance_mm",
15)
16
17
18def main() -> None:
19    problem = derp.get_problem("battery_18650_t1_rectangular_surrogate_opt")
20    initial = problem.generate_initial_solution(seed=1)
21    components = problem.objective_components(initial)
22    result = problem.solve(maxiter=20)
23    solved = problem.objective_components(result.x)
24    print(problem.metadata.problem_id)
25    print("default-evaluation-mode", problem.metadata.benchmark_card.default_evaluation_mode)
26    print("metric-keys", ",".join(sorted(components)))
27    print("initial", " ".join(f"{key}={components[key]:.3f}" for key in COMMON_KEYS))
28    print("solve", result.message)
29    print("solved", " ".join(f"{key}={solved[key]:.3f}" for key in COMMON_KEYS))
30
31
32if __name__ == "__main__":
33    main()

Expected Results#

Run Command

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