aero_fileplot#
Generates interactive 3-D surface plots of an AeroDatabase. Three functions, each returning a dict[str, plotly.Figure]:
plot_totals: total coefficients vs. \(\alpha\)/\(\beta\) (stability) and \(\alpha\)/\(\delta\) (per control surface)plot_stab_derivs: stability derivatives \(\partial C/\partial(\alpha, \beta, p', q', r')\), one figure per perturbation variableplot_ctrl_derivs: control derivatives \(\partial C/\partial\delta_\text{surface}\), one figure per control surface
Plot AeroDatabase tables as interactive 3-D plotly surface figures.
- avl_aero_tables.aero_fileplot.plot_ctrl_derivs(aero)[source]#
Plot control-derivative tables from an AeroDatabase.
Returns one figure per control surface. Each figure contains six 3-D surface subplots — one per coefficient (CL, CY, CD, Cl, Cm, Cn) — showing how the linearised control derivative ∂C/∂δ_surface varies with alpha and beta.
- Parameters:
aero (AeroDatabase) – AeroDatabase built by aero_filewrite().
- Returns:
Keys are control surface names (e.g.
"flap","elevator"). Surfaces whose derivatives are all absent are skipped. Empty database returns{}. Save withfig.write_html("out.html").- Return type:
dict[str, plotly.graph_objects.Figure]
Example
>>> import tempfile >>> from avl_aero_tables import avl_sweep >>> from avl_aero_tables.aero_filewrite import aero_filewrite >>> from avl_aero_tables.aero_fileplot import plot_ctrl_derivs >>> with tempfile.TemporaryDirectory() as tmp: ... results = avl_sweep( ... "examples/bd/bd.avl", ... alpha=[-5, 0, 5, 10], ... beta=[-5, 0, 5], ... out_dir=tmp, ... ) >>> db = aero_filewrite(results) >>> figs = plot_ctrl_derivs(db) >>> len(figs) 4 >>> "Control Derivatives" in figs["flap"].layout.title.text True >>> "Flap" in figs["flap"].layout.title.text True
- avl_aero_tables.aero_fileplot.plot_stab_derivs(aero)[source]#
Plot stability-axis derivative tables from an AeroDatabase.
Returns one figure per perturbation variable (α, β, p’, q’, r’). Each figure contains six 3-D surface subplots — one per force/moment coefficient (CL, CY, CD, Cl, Cm, Cn) — showing how the linearised derivative varies with alpha and beta at neutral controls.
- Parameters:
aero (AeroDatabase) – AeroDatabase built by aero_filewrite().
- Returns:
Keys:
"alpha","beta","p","q","r"— only groups whose derivatives are present inaero.stab_derivare included. Empty database returns{}. Save withfig.write_html("out.html").- Return type:
dict[str, plotly.graph_objects.Figure]
Example
>>> import tempfile >>> from avl_aero_tables import avl_sweep >>> from avl_aero_tables.aero_filewrite import aero_filewrite >>> from avl_aero_tables.aero_fileplot import plot_stab_derivs >>> with tempfile.TemporaryDirectory() as tmp: ... results = avl_sweep( ... "examples/bd/bd.avl", ... alpha=[-5, 0, 5, 10], ... beta=[-5, 0, 5], ... out_dir=tmp, ... ) >>> db = aero_filewrite(results) >>> figs = plot_stab_derivs(db) >>> len(figs) 5 >>> "Stability Derivatives" in figs["alpha"].layout.title.text True
- avl_aero_tables.aero_fileplot.plot_totals(aero, beta_ref=0.0)[source]#
Plot stability and control coefficient tables from an AeroDatabase.
Produces two sets of interactive figures:
Baseline aero figure (key
"stab") — grid of 3-D surface plots showing each of the six total-force coefficients (CLtot, CYtot, CDtot, Cltot, Cmtot, Cntot) vs. alpha and beta at neutral controls.Control surface figures (keys
"ctrl_CL"…"ctrl_Cn") — one figure per coefficient, each containing one subplot per control surface. Shows how the total coefficient varies with alpha and deflection angle at beta_ref. These are discrete coefficient values, not derivatives.
- Parameters:
aero (AeroDatabase) – AeroDatabase built by aero_filewrite().
beta_ref (float) – Sideslip angle (deg) at which control-surface subplots are sliced. The nearest available beta breakpoint is used.
- Returns:
Keys:
"stab", then"ctrl_lift","ctrl_side","ctrl_drag","ctrl_roll","ctrl_pitch","ctrl_yaw"(control keys present only whenaero.total_ctrlis non-empty). Empty database returns{}. Save withfig.write_html("out.html").- Return type:
dict[str, plotly.graph_objects.Figure]
Example
>>> import tempfile >>> from avl_aero_tables import avl_sweep >>> from avl_aero_tables.aero_filewrite import aero_filewrite >>> from avl_aero_tables.aero_fileplot import plot_totals >>> with tempfile.TemporaryDirectory() as tmp: ... results = avl_sweep( ... "examples/bd/bd.avl", ... alpha=[-5, 0, 5, 10], ... beta=[-5, 0, 5], ... ctrl_sweeps={"elevator": [-10, 0, 10]}, ... out_dir=tmp, ... ) >>> db = aero_filewrite(results) >>> figs = plot_totals(db) >>> len(figs) 7 >>> figs["stab"].layout.title.text 'Aerodynamic Coefficients — Neutral Controls' >>> "Lift" in figs["ctrl_lift"].layout.title.text True