STAR
Cal STAR — firmware, DAQ server, and engine design
Loading...
Searching...
No Matches
__init__.py
Go to the documentation of this file.
1"""Optimization layers for full engine design optimization.
2
3This package contains the modular layers of the optimization pipeline:
4
5Modules:
6- helpers.py: Pressure curve generation and variable conversion
7- layers/layer1_static_optimization.py: Layer 1 geometry optimization
8- layers/layer2_pressure.py: Layer 2 pressure curve optimization
9- layers/layer3_thermal_protection.py: Layer 3 thermal protection sizing
10- layers/layer4_flight_simulation.py: Layer 4 flight simulation
11- copv_flight_helpers.py: COPV and flight simulation utilities
12- utils.py: Parameter extraction and misc utilities
13
14Usage:
15 from engine.optimizer import (
16 # Pressure curve helpers
17 generate_segmented_pressure_curve,
18 segments_from_optimizer_vars,
19 optimizer_vars_from_segments,
20 # Layer functions
21 create_layer1_apply_x_to_config,
22 run_layer2_pressure,
23 run_layer3_thermal_protection,
24 run_layer4_flight_simulation,
25 # Utilities
26 extract_all_parameters,
27 calculate_copv_pressure_curve,
28 run_flight_simulation,
29 )
30"""
31
32# Helper functions - pressure curves
33from engine.optimizer.helpers import (
34 generate_segmented_pressure_curve,
35 segments_from_optimizer_vars,
36 optimizer_vars_from_segments,
37)
38
39# Layer 1: Static optimization
41 create_layer1_apply_x_to_config,
42)
43
44# Layer 2: Pressure curve optimization
46 run_layer2a_minimum_pressures,
47 run_layer2_pressure,
48)
49
50# Layer 3: Thermal protection optimization
52 run_layer3_thermal_protection,
53)
54
55# Layer 4: Flight simulation
57 run_layer4_flight_simulation,
58)
59
60# Display functions used to be re-exported here from display_results.py. That
61# import ran on any `from engine.optimizer... import`, which dragged Streamlit
62# into the FastAPI backend and its container. The Streamlit UI is retired --
63# see archive/streamlit-ui/.
64
65# COPV and flight helpers
67 calculate_copv_pressure_curve,
68 run_flight_simulation,
69)
70
71# Utilities
72from engine.optimizer.utils import (
73 extract_all_parameters,
74)
75
76# Main optimizer
78 run_full_engine_optimization_with_flight_sim,
79)
80
81__all__ = [
82 # Pressure curve helpers
83 'generate_segmented_pressure_curve',
84 'segments_from_optimizer_vars',
85 'optimizer_vars_from_segments',
86 # Layer 1
87 'create_layer1_apply_x_to_config',
88 # Layer 2
89 'run_layer2a_minimum_pressures',
90 'run_layer2_pressure',
91 # Layer 3
92 'run_layer3_thermal_protection',
93 # Layer 4
94 'run_layer4_flight_simulation',
95 # COPV and flight
96 'calculate_copv_pressure_curve',
97 'run_flight_simulation',
98 # Utilities
99 'extract_all_parameters',
100 # Main optimizer
101 'run_full_engine_optimization_with_flight_sim',
102]
103