架构调整和敏感性分析代码附加

This commit is contained in:
ljz committed 2026-06-20 14:32:13 +08:00
1 parent 1d09599e8c
commit 469567c3db
5 files changed
+621 -429

No files matched your search

+16 -2
View File
@@ -1,7 +1,11 @@
# -*- coding: utf-8 -*-
"""Run an example recompression CO2 Brayton cycle sweep."""
from brayton_cycle import BraytonCycle
from brayton_cycle import (
BraytonCycle,
plot_sweep_optimization_results,
sweep_and_optimize_rc,
)
def run_rc_sweep():
@@ -42,7 +46,7 @@ def run_rc_sweep():
print(Q_input + Wc - (Q_output + Wt))
print((Wt - Wc) / Q_input)
x_vals, eff_vals, opt_vals = brayton.sweep_and_optimize(
x_vals, eff_vals, opt_vals, failures = sweep_and_optimize_rc(
fixed_params=fixed_var,
params=param,
sweep_var="T_low",
@@ -51,6 +55,16 @@ def run_rc_sweep():
opt_bounds=(0.1, 0.5),
num_points=30,
)
if failures:
print(f"Skipped {len(failures)} invalid sweep points.")
plot_sweep_optimization_results(
"T_low",
x_vals,
eff_vals,
"x",
opt_vals,
)
return brayton, x_vals, eff_vals, opt_vals