dust-sctoolbox 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of dust-sctoolbox might be problematic. Click here for more details.

@@ -0,0 +1,281 @@
1
+ Metadata-Version: 2.4
2
+ Name: dust_sctoolbox
3
+ Version: 0.1.0
4
+ Summary: DUST stability and control analysis tools
5
+ License-Expression: MIT
6
+ Requires-Python: >=3.10
7
+ Description-Content-Type: text/markdown
8
+ Requires-Dist: numpy
9
+ Requires-Dist: PyYAML
10
+ Requires-Dist: matplotlib
11
+ Requires-Dist: h5py
12
+
13
+ # SCtoolbox
14
+
15
+ SCtoolbox - Modules and Input Guide
16
+ ===================================
17
+
18
+ This file describes the framework's Python scripts, the functions defined in
19
+ each module, and the settings available in input.yml.
20
+
21
+ ## Install and run
22
+
23
+ Install the package:
24
+
25
+ python -m pip install dust-sctoolbox
26
+
27
+ From the directory containing input.yml, run:
28
+
29
+ sctoolbox
30
+
31
+ The DUST model path in input.yml is relative to that directory. DUST must be
32
+ installed separately, with dust_pre, dust, and dust_post available on PATH.
33
+ When running from a source checkout, use `python main.py` from the case
34
+ directory.
35
+
36
+
37
+ ## 1. CONFIGURABLE INPUTS IN input.yml
38
+ ===================================
39
+
40
+ The file contains three sections: sim_data, analysis_data, and post_data.
41
+ Model and component paths are relative to sim_data.dust_path unless stated
42
+ otherwise.
43
+
44
+
45
+ sim_data
46
+ --------
47
+ - dust_path [required]: base directory containing the DUST model. May be an
48
+ absolute path or a path relative to the directory containing input.yml.
49
+ - model_folder [required]: DUST model directory under dust_path. Must be a
50
+ relative path.
51
+ - reference_file [required]: model's DUST reference file, for example
52
+ references.in.
53
+ - body_reference [conditional]: reference_tag of the body receiving the
54
+ prescribed dynamic motion. Required for dynamic analyses.
55
+ - u_inf [conditional]: list of freestream speeds [m/s] used for dynamic cases.
56
+ Each value creates a case; the DUST input defines the direction along x.
57
+ For zero_attitude and static/differential analyses, the baseline velocity is
58
+ read from the model's dust.in.
59
+ - alpha_0 [optional]: initial mean angle of attack [degrees] for dynamic cases.
60
+ A scalar or list is accepted; each value is combined with each other dynamic
61
+ sweep value. Default: 0.0.
62
+ - beta_0 [optional]: initial mean sideslip angle [degrees] for dynamic cases.
63
+ A scalar or list is accepted; each value is combined with each other dynamic
64
+ sweep value. Default: 0.0.
65
+ - dt [required]: simulation and DUST output time step [s].
66
+ - tend [required]: requested simulation end time [s]. The simulation stops at
67
+ this time even when it is not an integer multiple of the period.
68
+ - rho [required]: fluid density [kg/m^3].
69
+
70
+
71
+ analysis_data
72
+ -------------
73
+ - analysis_type [required]: analysis mode. Supported values:
74
+ - zero_attitude
75
+ - static_alpha
76
+ - static_beta
77
+ - static_v
78
+ - control_blade_pitch
79
+ - control_omega
80
+ - control_surface
81
+ - rolling
82
+ - pitching
83
+ - yawing
84
+ - plunging
85
+ - lateral
86
+ - phugoid
87
+ - lateral_phugoid
88
+ - ampl [conditional]: motion amplitude or increment applied in the perturbed
89
+ case. Accepts a scalar or vector for static and dynamic analyses. Each
90
+ static amplitude runs as an independent baseline/perturbed pair; dynamic
91
+ analyses run every amplitude/frequency combination. Units and use depend on
92
+ analysis_type:
93
+ - static_alpha, static_beta: angular perturbation [rad].
94
+ - static_v: freestream-speed increment [m/s].
95
+ - control_blade_pitch: Collective increment [degrees].
96
+ - control_omega: rot_rate increment [rad/s].
97
+ - control_surface: hinge amplitude increment, in the units expected by the
98
+ DUST component file.
99
+ - rolling, pitching, yawing: angular amplitude [rad].
100
+ - plunging, lateral, phugoid, lateral_phugoid: translation amplitude [m].
101
+ For differential modes, ampl must be non-zero and is added to the baseline
102
+ value in the perturbed case. Not required for zero_attitude.
103
+ - omega [conditional]: angular frequency [rad/s]. Required for dynamic
104
+ analyses; accepts a scalar or vector. Every amplitude/frequency combination
105
+ runs as a separate case. Not required for static or control analyses.
106
+ - pole_offset [optional]: three coordinates [m] defining the dynamic-motion
107
+ pole offset, for example [0.0, 0.0, 0.0]. Defaults to zero when omitted.
108
+ - rotor_reference [conditional]: reference_tag of the rotor to perturb.
109
+ Required for control_blade_pitch and control_omega; the reference must have
110
+ a multiplicity block of type rotor. control_blade_pitch changes Collective
111
+ in the Pitch degree of freedom; control_omega changes rot_rate.
112
+ - component_path [conditional]: path to the component .in file containing the
113
+ hinge, relative to model_folder, for example Geometry/wing.in. Required for
114
+ control_surface and must remain inside the model directory.
115
+ - hinge_tag [conditional]: hinge_Tag of the hinge to perturb in component_path.
116
+ It must identify exactly one hinge with a hinge_rotation_function block
117
+ containing exactly one amplitude assignment.
118
+
119
+
120
+ post_data
121
+ ---------
122
+ - component [required]: component name or selector supported by DUST for load
123
+ extraction, for example all.
124
+ - reference_tag [required]: DUST reference used to calculate loads and moments.
125
+ - reference_area [required]: reference area [m^2]; must be positive.
126
+ - reference_length [required]: reference length [m]; must be positive.
127
+
128
+
129
+
130
+
131
+ ## 2. RUNNING THE FRAMEWORK AND OUTPUTS
132
+ ====================================
133
+
134
+ Run the installed command from the directory containing input.yml:
135
+
136
+ sctoolbox
137
+
138
+ From a source checkout, run:
139
+
140
+ python main.py
141
+
142
+ The framework creates a model copy with the suffix _SC_N and an Output_SC_N
143
+ directory for analysis results.
144
+
145
+ Each dynamic sweep condition is run from its own model copy and has its own
146
+ Output_SC_N directory. Dynamic analysis saves the derivative report and plot
147
+ to the corresponding output directory, without saving a coefficient history
148
+ file or displaying the plot interactively. Derivative results for different
149
+ cases are separated by a blank line in the console. Output files are named
150
+ "<model>_loads_hysteresis.png", "<model>_stability_derivatives.dat", and
151
+ "<model>_stability_derivatives.h5". The HDF5 file contains a single
152
+ derivatives dataset and corresponding derivative_names, with case settings
153
+ and derivative metadata in its attributes; it can be read from Python with h5py
154
+ and from MATLAB with h5read/h5info.
155
+ When ampl is a vector for a static or control analysis, each amplitude is run
156
+ as an independent baseline/perturbed pair, with its own model copy and
157
+ Output_SC_N directory.
158
+ Static and control analysis plots are named "<model>_loads.png".
159
+
160
+ Differential analyses (static_alpha, static_beta, static_v,
161
+ control_blade_pitch, control_omega, and control_surface) run two simulations:
162
+ baseline and perturbed. DUST post-processing averages the loads over the final
163
+ 10 time steps using average = T; the averaged file does not contain a time
164
+ column. The derivative is calculated as the coefficient difference divided by
165
+ the actual parameter difference.
166
+
167
+ For dynamic analyses, post-processing selects the last complete period ending
168
+ at or before tend, counting periods from the time origin t=0. Any remaining
169
+ fraction of the simulation is excluded from the analysis.
170
+
171
+ Outputs include coefficient and derivative files and, for dynamic and
172
+ differential analyses, plots saved in the generated directories.
173
+
174
+ For development from a source checkout, install the Python dependencies with:
175
+
176
+ python -m pip install -r requirements.txt
177
+
178
+ ## Publishing updates
179
+
180
+ Add a masked and protected GitLab CI/CD variable named `PYPI_API_TOKEN` with
181
+ your PyPI API token. Each time you update the version in `pyproject.toml`, push
182
+ the commit and a matching version tag, for example:
183
+
184
+ git tag v0.1.1
185
+ git push origin v0.1.1
186
+
187
+ The tag pipeline builds, checks, and publishes the package. Every release must
188
+ use a new version.
189
+
190
+
191
+
192
+ # 3. PYTHON libraries
193
+ =================
194
+
195
+ main.py
196
+ -------
197
+ Thin entry point that delegates to dust_sctoolbox.run_sctoolbox.main().
198
+
199
+ Functions:
200
+ - main(): calls dust_sctoolbox.run_sctoolbox.main().
201
+
202
+
203
+ dust_sctoolbox/parsing.py
204
+ -------------------------
205
+ Contains the shared YAML, DUST input, and integral-load readers, plus helpers
206
+ for scanning DUST blocks, references, assignments, and numeric sweeps.
207
+
208
+
209
+ dust_sctoolbox/write_dust.py
210
+ ----------------------------
211
+ Updates DUST configuration files for simulations and post-processing, and
212
+ applies requested perturbations to references, rotors, and hinges.
213
+
214
+ Functions:
215
+ - default(reference_file): stores the DUST input filenames used by the framework.
216
+ - copy_model_for_run(dust_path, model_folder, runs_dir): creates a unique
217
+ working copy of the DUST model and a results directory.
218
+ - make_static_velocity_cases(analysis_type, baseline_velocity, ampl): builds
219
+ baseline and perturbed flow cases for static analyses.
220
+ - resolve_last_complete_period_end(...): selects the final complete dynamic
221
+ period measured from time zero.
222
+ - prepare_run_plan(script_dir): loads configuration, prepares the model copy,
223
+ validates analysis settings, and creates the run-case list.
224
+ - write_case(plan, case): writes the manipulated model, dust.in, and
225
+ dust_post_sc.in for one case and returns its loads-file path.
226
+ - write_dust(u_inf, dt, tend, output_str, path2dust, default, rho): updates
227
+ dust.in with freestream velocity, time step, end time, density, and output
228
+ name.
229
+ - write_dust_post(...): creates the load post-processing file. Supports
230
+ averaging the final time steps for differential cases.
231
+ - perturb_rotor_pitch_collective(...): changes Collective in the Pitch degree
232
+ of freedom of the rotor identified by reference_tag.
233
+ - perturb_rotor_rate(...): changes rot_rate in the multiplicity block of the
234
+ rotor selected by reference_tag.
235
+ - perturb_control_surface_amplitude(...): changes amplitude in the rotation
236
+ function of the hinge identified by hinge_tag in the component file.
237
+ - write_dust_ref(...): inserts the prescribed motion into the selected DUST
238
+ reference and applies the initial alpha_0/beta_0 orientation and pole offset.
239
+ dust_vector formats a DUST vector.
240
+
241
+
242
+ dust_sctoolbox/run_dust.py
243
+ --------------------------
244
+ Runs the external DUST executables in the model directory.
245
+
246
+ Functions:
247
+ - run_dust_pre(path2dust, default): runs dust_pre.
248
+ - run_dust(path2dust, default): runs dust.
249
+ - run_dust_post(path2dust, default): runs dust_post.
250
+ - run_case(plan, loads_file): runs dust_pre, dust, and dust_post for the current
251
+ case, and verifies that post-processing created a non-empty loads file.
252
+
253
+
254
+ dust_sctoolbox/SCanalysis.py
255
+ ----------------------------
256
+ Calculates aerodynamic coefficients and derivatives, and produces analysis
257
+ reports and plots. DUST load parsing is provided by
258
+ dust_sctoolbox/parsing.py.
259
+
260
+ Functions:
261
+ - compute_motion_angle(time, analysis_type, ampl, omega, u_inf, alpha_0, beta_0):
262
+ calculates the aerodynamic-angle history including the initial mean angles.
263
+ - motion_amplitude_rad(analysis_type, ampl, omega, u_inf): converts the motion
264
+ amplitude to its equivalent angular amplitude in radians.
265
+ - motion_derivative_name(analysis_type): maps an analysis type to its derivative
266
+ variable, such as p, q, r, alpha_dot, or beta_dot.
267
+ - calculate_stability_derivatives(...): calculates dynamic derivatives using
268
+ loads interpolated at the oscillation's center crossings. Its nested
269
+ interpolate_coefficients function interpolates coefficients at an exact time.
270
+ - write_stability_derivatives(history, derivatives_file, metadata): writes
271
+ dynamic derivatives and run metadata to a human-readable DAT file.
272
+ - write_stability_derivatives_hdf5(history, derivatives_file, metadata): writes
273
+ the six dynamic derivatives, their names, and run metadata to an HDF5 file.
274
+ - run_static_analysis(...): calculates finite-difference derivatives from two
275
+ static cases, writes coefficient summaries, and saves a plot.
276
+ - run_zero_attitude_analysis(...): calculates and saves coefficients for a
277
+ single zero_attitude case.
278
+ - run_SC_analysis(...): performs dynamic analysis, writes text and HDF5
279
+ derivatives, and saves the hysteresis plot.
280
+ - analyze_run(plan, loads_files): dispatches the prepared results to zero-
281
+ attitude, static finite-difference, or dynamic stability analysis.
@@ -0,0 +1,269 @@
1
+ # SCtoolbox
2
+
3
+ SCtoolbox - Modules and Input Guide
4
+ ===================================
5
+
6
+ This file describes the framework's Python scripts, the functions defined in
7
+ each module, and the settings available in input.yml.
8
+
9
+ ## Install and run
10
+
11
+ Install the package:
12
+
13
+ python -m pip install dust-sctoolbox
14
+
15
+ From the directory containing input.yml, run:
16
+
17
+ sctoolbox
18
+
19
+ The DUST model path in input.yml is relative to that directory. DUST must be
20
+ installed separately, with dust_pre, dust, and dust_post available on PATH.
21
+ When running from a source checkout, use `python main.py` from the case
22
+ directory.
23
+
24
+
25
+ ## 1. CONFIGURABLE INPUTS IN input.yml
26
+ ===================================
27
+
28
+ The file contains three sections: sim_data, analysis_data, and post_data.
29
+ Model and component paths are relative to sim_data.dust_path unless stated
30
+ otherwise.
31
+
32
+
33
+ sim_data
34
+ --------
35
+ - dust_path [required]: base directory containing the DUST model. May be an
36
+ absolute path or a path relative to the directory containing input.yml.
37
+ - model_folder [required]: DUST model directory under dust_path. Must be a
38
+ relative path.
39
+ - reference_file [required]: model's DUST reference file, for example
40
+ references.in.
41
+ - body_reference [conditional]: reference_tag of the body receiving the
42
+ prescribed dynamic motion. Required for dynamic analyses.
43
+ - u_inf [conditional]: list of freestream speeds [m/s] used for dynamic cases.
44
+ Each value creates a case; the DUST input defines the direction along x.
45
+ For zero_attitude and static/differential analyses, the baseline velocity is
46
+ read from the model's dust.in.
47
+ - alpha_0 [optional]: initial mean angle of attack [degrees] for dynamic cases.
48
+ A scalar or list is accepted; each value is combined with each other dynamic
49
+ sweep value. Default: 0.0.
50
+ - beta_0 [optional]: initial mean sideslip angle [degrees] for dynamic cases.
51
+ A scalar or list is accepted; each value is combined with each other dynamic
52
+ sweep value. Default: 0.0.
53
+ - dt [required]: simulation and DUST output time step [s].
54
+ - tend [required]: requested simulation end time [s]. The simulation stops at
55
+ this time even when it is not an integer multiple of the period.
56
+ - rho [required]: fluid density [kg/m^3].
57
+
58
+
59
+ analysis_data
60
+ -------------
61
+ - analysis_type [required]: analysis mode. Supported values:
62
+ - zero_attitude
63
+ - static_alpha
64
+ - static_beta
65
+ - static_v
66
+ - control_blade_pitch
67
+ - control_omega
68
+ - control_surface
69
+ - rolling
70
+ - pitching
71
+ - yawing
72
+ - plunging
73
+ - lateral
74
+ - phugoid
75
+ - lateral_phugoid
76
+ - ampl [conditional]: motion amplitude or increment applied in the perturbed
77
+ case. Accepts a scalar or vector for static and dynamic analyses. Each
78
+ static amplitude runs as an independent baseline/perturbed pair; dynamic
79
+ analyses run every amplitude/frequency combination. Units and use depend on
80
+ analysis_type:
81
+ - static_alpha, static_beta: angular perturbation [rad].
82
+ - static_v: freestream-speed increment [m/s].
83
+ - control_blade_pitch: Collective increment [degrees].
84
+ - control_omega: rot_rate increment [rad/s].
85
+ - control_surface: hinge amplitude increment, in the units expected by the
86
+ DUST component file.
87
+ - rolling, pitching, yawing: angular amplitude [rad].
88
+ - plunging, lateral, phugoid, lateral_phugoid: translation amplitude [m].
89
+ For differential modes, ampl must be non-zero and is added to the baseline
90
+ value in the perturbed case. Not required for zero_attitude.
91
+ - omega [conditional]: angular frequency [rad/s]. Required for dynamic
92
+ analyses; accepts a scalar or vector. Every amplitude/frequency combination
93
+ runs as a separate case. Not required for static or control analyses.
94
+ - pole_offset [optional]: three coordinates [m] defining the dynamic-motion
95
+ pole offset, for example [0.0, 0.0, 0.0]. Defaults to zero when omitted.
96
+ - rotor_reference [conditional]: reference_tag of the rotor to perturb.
97
+ Required for control_blade_pitch and control_omega; the reference must have
98
+ a multiplicity block of type rotor. control_blade_pitch changes Collective
99
+ in the Pitch degree of freedom; control_omega changes rot_rate.
100
+ - component_path [conditional]: path to the component .in file containing the
101
+ hinge, relative to model_folder, for example Geometry/wing.in. Required for
102
+ control_surface and must remain inside the model directory.
103
+ - hinge_tag [conditional]: hinge_Tag of the hinge to perturb in component_path.
104
+ It must identify exactly one hinge with a hinge_rotation_function block
105
+ containing exactly one amplitude assignment.
106
+
107
+
108
+ post_data
109
+ ---------
110
+ - component [required]: component name or selector supported by DUST for load
111
+ extraction, for example all.
112
+ - reference_tag [required]: DUST reference used to calculate loads and moments.
113
+ - reference_area [required]: reference area [m^2]; must be positive.
114
+ - reference_length [required]: reference length [m]; must be positive.
115
+
116
+
117
+
118
+
119
+ ## 2. RUNNING THE FRAMEWORK AND OUTPUTS
120
+ ====================================
121
+
122
+ Run the installed command from the directory containing input.yml:
123
+
124
+ sctoolbox
125
+
126
+ From a source checkout, run:
127
+
128
+ python main.py
129
+
130
+ The framework creates a model copy with the suffix _SC_N and an Output_SC_N
131
+ directory for analysis results.
132
+
133
+ Each dynamic sweep condition is run from its own model copy and has its own
134
+ Output_SC_N directory. Dynamic analysis saves the derivative report and plot
135
+ to the corresponding output directory, without saving a coefficient history
136
+ file or displaying the plot interactively. Derivative results for different
137
+ cases are separated by a blank line in the console. Output files are named
138
+ "<model>_loads_hysteresis.png", "<model>_stability_derivatives.dat", and
139
+ "<model>_stability_derivatives.h5". The HDF5 file contains a single
140
+ derivatives dataset and corresponding derivative_names, with case settings
141
+ and derivative metadata in its attributes; it can be read from Python with h5py
142
+ and from MATLAB with h5read/h5info.
143
+ When ampl is a vector for a static or control analysis, each amplitude is run
144
+ as an independent baseline/perturbed pair, with its own model copy and
145
+ Output_SC_N directory.
146
+ Static and control analysis plots are named "<model>_loads.png".
147
+
148
+ Differential analyses (static_alpha, static_beta, static_v,
149
+ control_blade_pitch, control_omega, and control_surface) run two simulations:
150
+ baseline and perturbed. DUST post-processing averages the loads over the final
151
+ 10 time steps using average = T; the averaged file does not contain a time
152
+ column. The derivative is calculated as the coefficient difference divided by
153
+ the actual parameter difference.
154
+
155
+ For dynamic analyses, post-processing selects the last complete period ending
156
+ at or before tend, counting periods from the time origin t=0. Any remaining
157
+ fraction of the simulation is excluded from the analysis.
158
+
159
+ Outputs include coefficient and derivative files and, for dynamic and
160
+ differential analyses, plots saved in the generated directories.
161
+
162
+ For development from a source checkout, install the Python dependencies with:
163
+
164
+ python -m pip install -r requirements.txt
165
+
166
+ ## Publishing updates
167
+
168
+ Add a masked and protected GitLab CI/CD variable named `PYPI_API_TOKEN` with
169
+ your PyPI API token. Each time you update the version in `pyproject.toml`, push
170
+ the commit and a matching version tag, for example:
171
+
172
+ git tag v0.1.1
173
+ git push origin v0.1.1
174
+
175
+ The tag pipeline builds, checks, and publishes the package. Every release must
176
+ use a new version.
177
+
178
+
179
+
180
+ # 3. PYTHON libraries
181
+ =================
182
+
183
+ main.py
184
+ -------
185
+ Thin entry point that delegates to dust_sctoolbox.run_sctoolbox.main().
186
+
187
+ Functions:
188
+ - main(): calls dust_sctoolbox.run_sctoolbox.main().
189
+
190
+
191
+ dust_sctoolbox/parsing.py
192
+ -------------------------
193
+ Contains the shared YAML, DUST input, and integral-load readers, plus helpers
194
+ for scanning DUST blocks, references, assignments, and numeric sweeps.
195
+
196
+
197
+ dust_sctoolbox/write_dust.py
198
+ ----------------------------
199
+ Updates DUST configuration files for simulations and post-processing, and
200
+ applies requested perturbations to references, rotors, and hinges.
201
+
202
+ Functions:
203
+ - default(reference_file): stores the DUST input filenames used by the framework.
204
+ - copy_model_for_run(dust_path, model_folder, runs_dir): creates a unique
205
+ working copy of the DUST model and a results directory.
206
+ - make_static_velocity_cases(analysis_type, baseline_velocity, ampl): builds
207
+ baseline and perturbed flow cases for static analyses.
208
+ - resolve_last_complete_period_end(...): selects the final complete dynamic
209
+ period measured from time zero.
210
+ - prepare_run_plan(script_dir): loads configuration, prepares the model copy,
211
+ validates analysis settings, and creates the run-case list.
212
+ - write_case(plan, case): writes the manipulated model, dust.in, and
213
+ dust_post_sc.in for one case and returns its loads-file path.
214
+ - write_dust(u_inf, dt, tend, output_str, path2dust, default, rho): updates
215
+ dust.in with freestream velocity, time step, end time, density, and output
216
+ name.
217
+ - write_dust_post(...): creates the load post-processing file. Supports
218
+ averaging the final time steps for differential cases.
219
+ - perturb_rotor_pitch_collective(...): changes Collective in the Pitch degree
220
+ of freedom of the rotor identified by reference_tag.
221
+ - perturb_rotor_rate(...): changes rot_rate in the multiplicity block of the
222
+ rotor selected by reference_tag.
223
+ - perturb_control_surface_amplitude(...): changes amplitude in the rotation
224
+ function of the hinge identified by hinge_tag in the component file.
225
+ - write_dust_ref(...): inserts the prescribed motion into the selected DUST
226
+ reference and applies the initial alpha_0/beta_0 orientation and pole offset.
227
+ dust_vector formats a DUST vector.
228
+
229
+
230
+ dust_sctoolbox/run_dust.py
231
+ --------------------------
232
+ Runs the external DUST executables in the model directory.
233
+
234
+ Functions:
235
+ - run_dust_pre(path2dust, default): runs dust_pre.
236
+ - run_dust(path2dust, default): runs dust.
237
+ - run_dust_post(path2dust, default): runs dust_post.
238
+ - run_case(plan, loads_file): runs dust_pre, dust, and dust_post for the current
239
+ case, and verifies that post-processing created a non-empty loads file.
240
+
241
+
242
+ dust_sctoolbox/SCanalysis.py
243
+ ----------------------------
244
+ Calculates aerodynamic coefficients and derivatives, and produces analysis
245
+ reports and plots. DUST load parsing is provided by
246
+ dust_sctoolbox/parsing.py.
247
+
248
+ Functions:
249
+ - compute_motion_angle(time, analysis_type, ampl, omega, u_inf, alpha_0, beta_0):
250
+ calculates the aerodynamic-angle history including the initial mean angles.
251
+ - motion_amplitude_rad(analysis_type, ampl, omega, u_inf): converts the motion
252
+ amplitude to its equivalent angular amplitude in radians.
253
+ - motion_derivative_name(analysis_type): maps an analysis type to its derivative
254
+ variable, such as p, q, r, alpha_dot, or beta_dot.
255
+ - calculate_stability_derivatives(...): calculates dynamic derivatives using
256
+ loads interpolated at the oscillation's center crossings. Its nested
257
+ interpolate_coefficients function interpolates coefficients at an exact time.
258
+ - write_stability_derivatives(history, derivatives_file, metadata): writes
259
+ dynamic derivatives and run metadata to a human-readable DAT file.
260
+ - write_stability_derivatives_hdf5(history, derivatives_file, metadata): writes
261
+ the six dynamic derivatives, their names, and run metadata to an HDF5 file.
262
+ - run_static_analysis(...): calculates finite-difference derivatives from two
263
+ static cases, writes coefficient summaries, and saves a plot.
264
+ - run_zero_attitude_analysis(...): calculates and saves coefficients for a
265
+ single zero_attitude case.
266
+ - run_SC_analysis(...): performs dynamic analysis, writes text and HDF5
267
+ derivatives, and saves the hysteresis plot.
268
+ - analyze_run(plan, loads_files): dispatches the prepared results to zero-
269
+ attitude, static finite-difference, or dynamic stability analysis.