Moneymaker Hip Pump

Source: examples/optimization/moneymaker_hip_pump.py

Introduction

Inspect the MoneyMaker Hip Pump humanitarian water-lifting 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
 5
 6def main() -> None:
 7    """Print the packaged baseline design and the solved SciPy SLSQP design."""
 8    problem = derp.get_problem("moneymaker_hip_pump_cost_min")
 9    initial = problem.generate_initial_solution()
10    initial_components = problem.objective_components(initial)
11    result = problem.solve()
12    solved_components = problem.objective_components(result.x)
13
14    print("MoneyMaker Hip Pump humanitarian water-lifting benchmark")
15    print(problem.metadata.title)
16    print(
17        "initial",
18        f"flow_lps={initial_components['flow_rate_lps']:.3f}",
19        f"tank_m={initial_components['tank_height_m']:.1f}",
20        f"cost_usd={initial_components['cost_usd']:.2f}",
21    )
22    print("solve", result.message)
23    print(
24        "solved",
25        f"flow_lps={solved_components['flow_rate_lps']:.3f}",
26        f"tank_m={solved_components['tank_height_m']:.1f}",
27        f"cost_usd={solved_components['cost_usd']:.2f}",
28    )
29
30
31if __name__ == "__main__":
32    main()

Expected Results

Run Command

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