Optimise mixture ratio¶
This how-to finds the oxidizer-to-fuel mixture ratio that gives the highest vacuum specific impulse for a fixed engine design point.
The example uses:
Parameter |
Value |
|---|---|
Fuel |
Methane |
Oxidizer |
Oxygen |
Chamber pressure |
100 bar |
Thrust |
100 kN |
Nozzle area ratio |
60 |
Characteristic length |
1.2 m |
Objective¶
The mixture ratio is defined as:
For each trial mixture ratio, Pyskyfire builds a new Aerothermodynamics object and reads the calculated vacuum specific impulse.
The optimisation problem is:
The script solves this by minimizing the negative specific impulse:
Run the optimisation¶
Run the full script at: examples/MR_optimisation/MR_opt.py
The central optimisation step is:
result = minimize_scalar(
objective,
bounds=(1.5, 6.0),
method="bounded",
options={"xatol": 1e-3},
)
MR_opt = result.x
aero_opt = make_aerothermodynamics(MR_opt)
Isp_opt = aero_opt.Isp_vac
The script uses scipy.optimize.minimize_scalar with bounded optimisation over the interval:
Optimisation curve¶
The curve below shows the vacuum specific impulse calculated over the mixture-ratio range. The marker shows the optimum found by the optimiser.
Optimised contour¶
As a curiosity, after finding the optimum mixture ratio, we can easily find and plot a corresponding contour.
xs, rs = psf.regen.contour.get_contour(
V_c=aero_opt.V_c,
AR_c=1.8,
r_t=aero_opt.r_t,
area_ratio=aero_opt.eps,
nozzle="rao",
R_1f=1,
R_2f=2,
R_3f=0.3,
)
contour = psf.regen.Contour(xs, rs, name="Optimised mixture-ratio contour")
plot = psf.viz.PlotContour(contour)
contour_fig = plot.fig
contour_fig.write_html(output_dir / "optimized-contour.html")
Yielding:
Interpretation¶
This optimisation only varies mixture ratio. Chamber pressure, thrust, area ratio, characteristic length, propellant choice, and inlet temperatures are fixed. The result is therefore the mixture ratio that maximises ideal vacuum performance for this design point.