Simple Trimcases

Simple Trimcases#

In this section a trim simulation is going to be present. The simulation set-up in Loads Kernel was already shown in detail in a previous notebook. Hence, the focus will be more in the results and post processing. The results obtained in Loads Kernel are discussed and compared with the MSC Nastran results.

Simulation Set-up#

As disucssed previously, three trim cases were analysed. The three trim cases were performed at True Airspeed (TAS) of 70 m/s and Flight Level FL000. The first case corresponds to a horizontal level flight, a Load Factor of nZ=1; the second one to a push-down maneuver, a Load Factor of nZ=-1; and the third one to a pull-up maneuver, a Load Factor of nZ=2.5. These load cases where chosen having in consideration the flight envelope that was obtained using the CS-25 [5].

In order to obtain the results the following ‘launch.py’ file is run. The results can be found in the folder ‘DC-3_results’.

from loadskernel import program_flow

# Here you launch the Loads Kernel with your job
k = program_flow.Kernel('jcl_dc3_trim', pre=True, main=True, post=True, test=False,
                        path_input='./DC3_model/JCLs',
                        path_output='./DC3_results')
k.run()
INFO: This is the log for process 0.
INFO: Starting Loads Kernel with job: jcl_dc3_trim
INFO: User carn_fr on schwalbe (Linux-4.18.0-513.24.1.el8_9.x86_64-x86_64-with-glibc2.28)
INFO: pre:  True
INFO: main: True
INFO: post: True
INFO: test: False
INFO: --> Reading parameters from JCL.
INFO: Generated list of 3 empty dicts.
INFO: --> Starting preprocessing.
INFO: Building structural model...
INFO: Read from file: /data/carn_fr/LoadsKernel/doc/tutorials/DC3_model/fem/structure_only.bdf
INFO: Found include(s):
INFO: Read from file: /data/carn_fr/LoadsKernel/doc/tutorials/DC3_model/fem/../fem/export_FUS.csv
INFO: Read from file: /data/carn_fr/LoadsKernel/doc/tutorials/DC3_model/fem/../fem/left-wing/left-wing.GRID_LREFAX_5400001
INFO: Read from file: /data/carn_fr/LoadsKernel/doc/tutorials/DC3_model/fem/../fem/left-wing/left-wing.RBE2_LREFAX_5400001
INFO: Read from file: /data/carn_fr/LoadsKernel/doc/tutorials/DC3_model/fem/../fem/left-wing/left-wing.CORD2R_LREFAX
INFO: Read from file: /data/carn_fr/LoadsKernel/doc/tutorials/DC3_model/fem/../fem/left-wing/left-wing.MAT_ZR
INFO: Read from file: /data/carn_fr/LoadsKernel/doc/tutorials/DC3_model/fem/../fem/left-wing/export_left-wing.csv
INFO: Read from file: /data/carn_fr/LoadsKernel/doc/tutorials/DC3_model/fem/../fem/right-wing/right-wing.GRID_LREFAX_6400001
INFO: Read from file: /data/carn_fr/LoadsKernel/doc/tutorials/DC3_model/fem/../fem/right-wing/right-wing.RBE2_LREFAX_6400001
INFO: Read from file: /data/carn_fr/LoadsKernel/doc/tutorials/DC3_model/fem/../fem/right-wing/right-wing.CORD2R_LREFAX
INFO: Read from file: /data/carn_fr/LoadsKernel/doc/tutorials/DC3_model/fem/../fem/right-wing/right-wing.MAT_ZR
INFO: Read from file: /data/carn_fr/LoadsKernel/doc/tutorials/DC3_model/fem/../fem/right-wing//export_right-wing.csv
INFO: Read from file: /data/carn_fr/LoadsKernel/doc/tutorials/DC3_model/fem/../fem/left-ht/left-ht.GRID_LREFAX_3330001
INFO: Read from file: /data/carn_fr/LoadsKernel/doc/tutorials/DC3_model/fem/../fem/left-ht/left-ht.RBE2_LREFAX_3330001
INFO: Read from file: /data/carn_fr/LoadsKernel/doc/tutorials/DC3_model/fem/../fem/left-ht/left-ht.CORD2R_LREFAX
INFO: Read from file: /data/carn_fr/LoadsKernel/doc/tutorials/DC3_model/fem/../fem/left-ht/left-ht.MAT_ZR
INFO: Read from file: /data/carn_fr/LoadsKernel/doc/tutorials/DC3_model/fem/../fem/left-ht/export_left-ht.csv
INFO: Read from file: /data/carn_fr/LoadsKernel/doc/tutorials/DC3_model/fem/../fem/right-ht/right-ht.GRID_LREFAX_3340001
INFO: Read from file: /data/carn_fr/LoadsKernel/doc/tutorials/DC3_model/fem/../fem/right-ht/right-ht.RBE2_LREFAX_3340001
INFO: Read from file: /data/carn_fr/LoadsKernel/doc/tutorials/DC3_model/fem/../fem/right-ht/right-ht.CORD2R_LREFAX
INFO: Read from file: /data/carn_fr/LoadsKernel/doc/tutorials/DC3_model/fem/../fem/right-ht/right-ht.MAT_ZR
INFO: Read from file: /data/carn_fr/LoadsKernel/doc/tutorials/DC3_model/fem/../fem/right-ht/export_right-ht.csv
INFO: Read from file: /data/carn_fr/LoadsKernel/doc/tutorials/DC3_model/fem/../fem/vt/vt.GRID_LREFAX_3320001
INFO: Read from file: /data/carn_fr/LoadsKernel/doc/tutorials/DC3_model/fem/../fem/vt/vt.RBE2_LREFAX_3320001
INFO: Read from file: /data/carn_fr/LoadsKernel/doc/tutorials/DC3_model/fem/../fem/vt/vt.CORD2R_LREFAX
INFO: Read from file: /data/carn_fr/LoadsKernel/doc/tutorials/DC3_model/fem/../fem/vt/vt.MAT_ZR
INFO: Read from file: /data/carn_fr/LoadsKernel/doc/tutorials/DC3_model/fem/../fem/vt/export_vt.csv
INFO: Read from file: /data/carn_fr/LoadsKernel/doc/tutorials/DC3_model/fem/../fem/export_left-nacell.csv
INFO: Read from file: /data/carn_fr/LoadsKernel/doc/tutorials/DC3_model/fem/../fem/export_right-nacell.csv
INFO: The structural model consists of 278 grid points (1668 DoFs) and 7 coordinate systems.
INFO: Reading Monitoring Stations from MONPNTs...
INFO: Read from file: /data/carn_fr/LoadsKernel/doc/tutorials/DC3_model/fem/export_monitoring-stations.csv
INFO: Splining (rigid body) of 1668 DOFs to 192 DOFs...
INFO: Building atmo model...
INFO: Building aero model...
INFO: Read from file: /data/carn_fr/LoadsKernel/doc/tutorials/DC3_model/aero/vt/vt.CAERO1
INFO: Read from file: /data/carn_fr/LoadsKernel/doc/tutorials/DC3_model/aero/left-ht/left-ht.CAERO1
INFO: Read from file: /data/carn_fr/LoadsKernel/doc/tutorials/DC3_model/aero/right-ht/right-ht.CAERO1
INFO: Read from file: /data/carn_fr/LoadsKernel/doc/tutorials/DC3_model/aero/left-wing/left-wing.CAERO1
INFO: Read from file: /data/carn_fr/LoadsKernel/doc/tutorials/DC3_model/aero/right-wing/right-wing.CAERO1
INFO: Constructing aero panels from CAERO cards
INFO:  - from corner points and aero panels, constructing aerogrid
INFO: Read W2GJ data from file: /data/carn_fr/LoadsKernel/doc/tutorials/DC3_model/fem/w2gj_list.DMI_merge
INFO: Splining (rigid body) of 6336 DOFs to 6336 DOFs...
INFO: Splining (rigid body) of 6336 DOFs to 6336 DOFs...
INFO: Splining (rigid body) of 6336 DOFs to 6 DOFs...
INFO: Read from file: /data/carn_fr/LoadsKernel/doc/tutorials/DC3_model/aero/vt/vt.AESURF
INFO: Read from file: /data/carn_fr/LoadsKernel/doc/tutorials/DC3_model/aero/left-ht/left-ht.AESURF
INFO: Read from file: /data/carn_fr/LoadsKernel/doc/tutorials/DC3_model/aero/right-ht/right-ht.AESURF
INFO: Read from file: /data/carn_fr/LoadsKernel/doc/tutorials/DC3_model/aero/left-wing/left-wing.AESURF
INFO: Read from file: /data/carn_fr/LoadsKernel/doc/tutorials/DC3_model/aero/right-wing/right-wing.AESURF
INFO: Read from file: /data/carn_fr/LoadsKernel/doc/tutorials/DC3_model/aero/vt/vt.AELIST
INFO: Read from file: /data/carn_fr/LoadsKernel/doc/tutorials/DC3_model/aero/left-ht/left-ht.AELIST
INFO: Read from file: /data/carn_fr/LoadsKernel/doc/tutorials/DC3_model/aero/right-ht/right-ht.AELIST
INFO: Read from file: /data/carn_fr/LoadsKernel/doc/tutorials/DC3_model/aero/left-wing/left-wing.AELIST
INFO: Read from file: /data/carn_fr/LoadsKernel/doc/tutorials/DC3_model/aero/right-wing/right-wing.AELIST
INFO: Splining (rigid body) of 6336 DOFs to 6 DOFs...
INFO: Splining (rigid body) of 6336 DOFs to 6 DOFs...
INFO: Splining (rigid body) of 6336 DOFs to 6 DOFs...
INFO: Splining (rigid body) of 6336 DOFs to 6 DOFs...
INFO: Splining (rigid body) of 6336 DOFs to 6 DOFs...
INFO: Calculating steady AIC matrices (1056 panels, k=0.0) for 2 Mach number(s)...
INFO: done in 0.81 [sec].
INFO: The aerodynamic model consists of 1056 panels and 5 control surfaces.
INFO: Coupling aerogrid directly. Doing cleanup/thin out of strcgrid to avoid singularities                     (safety first!)
INFO: The spline model consists of 272 grid points.
INFO: Searching nearest neighbour of 1056 dependent nodes in 272 independent nodes...
INFO: Splining (rigid body) of 6336 DOFs to 1668 DOFs...
INFO: Building stiffness and mass model...
INFO: Reading matrix KGG from /data/carn_fr/LoadsKernel/doc/tutorials/DC3_model/fem/SOL103_structure_only.mtx.h5
INFO: Reading matrix GM from /data/carn_fr/LoadsKernel/doc/tutorials/DC3_model/fem/SOL103_structure_only.mtx.h5
INFO: Read USET from OP2-file /data/carn_fr/LoadsKernel/doc/tutorials/DC3_model/fem/uset.op2 ...
Table  USET    , bytes =       6935 [         0 to       6936]
INFO: Extracting bit positions from USET to determine DoFs
INFO: Prepare stiffness matrices for independent and free DoFs (f-set)
INFO: Mass configuration 1 of 1: M3 
INFO: Reading matrix MGG from /data/carn_fr/LoadsKernel/doc/tutorials/DC3_model/fem/SOL103_M3.mtx.h5
INFO: Calculate center of gravity, mass and inertia (GRDPNT)...
INFO: Splining (rigid body) of 1668 DOFs to 6 DOFs...
INFO: Splining (rigid body) of 1668 DOFs to 6 DOFs...
INFO: Mass: 11883.983000000002
INFO: CG at: [8.62280419e+00 5.43474355e-08 3.11704131e-01]
INFO: Inertia: 
[[ 6.93201323e+04 -3.80956656e-04  1.17729353e+04]
 [-3.80956654e-04  1.40925492e+05 -1.74794555e-04]
 [ 1.17729353e+04 -1.74794555e-04  1.97104534e+05]]
INFO: Prepare mass matrices for independent and free DoFs (f-set)
INFO: Modal analysis for first 76 modes...
INFO: Found 76 modes with the following frequencies [Hz]:
INFO: [           nan            nan 1.05457802e-06 4.52538930e-06
 1.45457362e-05 3.39333114e-05 3.13716140e+00 4.68251648e+00
 7.20798842e+00 7.88159198e+00 8.33703334e+00 8.49130434e+00
 9.88499185e+00 1.25695152e+01 1.53520000e+01 1.70224904e+01
 1.71353125e+01 1.84415883e+01 2.53323405e+01 2.53529787e+01
 2.68433851e+01 2.81886245e+01 3.20724571e+01 3.24562324e+01
 3.51081211e+01 3.52877859e+01 3.71484020e+01 3.74387461e+01
 4.65087795e+01 4.66555395e+01 5.19704569e+01 5.31897897e+01
 5.59827047e+01 5.61588818e+01 5.79161872e+01 5.83859187e+01
 6.49254027e+01 6.49636994e+01 6.52953993e+01 6.55893563e+01
 6.76977070e+01 7.39272939e+01 7.40020584e+01 7.92493678e+01
 7.98448917e+01 8.44686963e+01 8.44977700e+01 8.89696420e+01
 8.90380160e+01 9.17266784e+01 9.27516791e+01 1.00718906e+02
 1.00742526e+02 1.05800840e+02 1.06520421e+02 1.09898735e+02
 1.10071029e+02 1.12603325e+02 1.12677121e+02 1.21628942e+02
 1.21633308e+02 1.25797288e+02 1.25826624e+02 1.30369009e+02
 1.30516978e+02 1.37566261e+02 1.37608584e+02 1.41676350e+02
 1.44303157e+02 1.44811563e+02 1.47038007e+02 1.47151873e+02
 1.55547154e+02 1.56081100e+02 1.56183006e+02 1.57181628e+02]
INFO: From these 76 modes, the following 70 modes are selected: [ 7  8  9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54
 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76]
INFO: Working on f-set
INFO: Damping: modal damping of 0.02
INFO: Working on h-set
INFO: Splining (rigid body) of 1668 DOFs to 6 DOFs...
INFO: Damping: modal damping of 0.02
INFO: Splining (rigid body) of 1668 DOFs to 6 DOFs...
INFO: Splining (rigid body) of 6 DOFs to 6 DOFs...
INFO: Splining (rigid body) of 6 DOFs to 6 DOFs...
INFO: Splining (rigid body) of 6 DOFs to 6 DOFs...
INFO: Splining (rigid body) of 6 DOFs to 6 DOFs...
INFO: --> Saving model data.
INFO: --> Done in 0:00:03 [h:mm:ss].
INFO: --> Starting Main in sequential mode for 3 trimcase(s).
INFO: 
INFO: ========================================
INFO: trimcase: CC.M3.OVCFL000.level
INFO: subcase: 1
INFO: (case 1 of 3)
INFO: ========================================
INFO: Setting trim conditions to "default"
INFO: Init model equations of type "Steady"
INFO: Init EFCS "efcs_dc3"
INFO: Running trim for 76 variables...
INFO: The solution converged.
INFO: calculating forces & moments on structural set (force summation method)...
INFO: apply euler angles...
INFO: calculating cutting forces & moments...
INFO: gathering information on monitoring stations from response(s)...
INFO: searching min/max in time data at 32 monitoring stations and gathering loads (dyn2stat)...
INFO: --> Saving response(s).
INFO: 
INFO: ========================================
INFO: trimcase: CC.M3.OVCFL000.pushdown
INFO: subcase: 2
INFO: (case 2 of 3)
INFO: ========================================
INFO: Setting trim conditions to "default"
INFO: Init model equations of type "Steady"
INFO: Init EFCS "efcs_dc3"
INFO: Running trim for 76 variables...
INFO: The solution converged.
INFO: calculating forces & moments on structural set (force summation method)...
INFO: apply euler angles...
INFO: calculating cutting forces & moments...
INFO: gathering information on monitoring stations from response(s)...
INFO: searching min/max in time data at 32 monitoring stations and gathering loads (dyn2stat)...
INFO: --> Saving response(s).
INFO: 
INFO: ========================================
INFO: trimcase: CC.M3.OVCFL000.pullup
INFO: subcase: 3
INFO: (case 3 of 3)
INFO: ========================================
INFO: Setting trim conditions to "default"
INFO: Init model equations of type "Steady"
INFO: Init EFCS "efcs_dc3"
INFO: Running trim for 76 variables...
INFO: The solution converged.
INFO: calculating forces & moments on structural set (force summation method)...
INFO: apply euler angles...
INFO: calculating cutting forces & moments...
INFO: gathering information on monitoring stations from response(s)...
INFO: searching min/max in time data at 32 monitoring stations and gathering loads (dyn2stat)...
INFO: --> Saving response(s).
INFO: --> Saving monstation(s).
INFO: --> Saving dyn2stat.
INFO: --> Done in 0:00:02 [h:mm:ss].
INFO: --> Opening response(s).
INFO: --> Loading monstations(s).
INFO: --> Loading dyn2stat.
INFO: --> Drawing some standard plots.
INFO: start potato-plotting...
INFO: start plotting cutting forces along wing...
INFO: plots saved as ./DC3_results/monstations_jcl_dc3_trim.pdf
INFO: --> Saving auxiliary output data.
INFO: writing trim results to: ./DC3_results/trim_results_jcl_dc3_trim.csv
INFO: writing successful trimcases cases to: ./DC3_results/successful_trimcases_jcl_dc3_trim.csv
INFO: writing failed trimcases cases to: ./DC3_results/failed_trimcases_jcl_dc3_trim.csv
INFO: writing critical trimcases cases to: ./DC3_results/crit_trimcases_jcl_dc3_trim.csv
INFO: saving critical nodal loads as Nastarn cards...
INFO: Loads Kernel finished.
INFO: 
INFO:        (  )
INFO:       (    )
INFO: 
INFO:               (   )
INFO:              (     )
INFO: 
INFO:          _|_
INFO:  ---------O---------
INFO: 
INFO:

Results#

In this section, the results of Loads Kernel are presented, for both the rigid and flexible versions. Moreover, these results are compared to the MSC Nastran results, obtained with SOL144. The purpose of this comparison is to prove the similarities of the outcome of both softwares.

One of the most interesting results from this simulation is the ‘trim_results_jcl_dc3_trim.csv’ file, where all the trim conditions for the different trim cases are discriminated. Upon examining the trim results, several notable conclusions emerge. the next table presents the αtrim outcomes for the final modified model, revealing values that comfortably align within the acceptable range for both the rigid and flexible versions across both software programs. Comparing the results between both software it can be seen that they match quiet well, having just very small differences. To understand the sources of these small differences is important to discuss the differences between both software. While the simulation performed in Loads Kernel is a modal analyses, the SOL144 performed in MSC Nastran it is not. Hence, for the Loads Kernel case a convergence study had to be performed. For that, the number of eigenmodes truncated were progressively increased until the trim results converged. At the end, it was concluded that a total number of 71 eigenmodes is enough to obtain convergence. On top of that, MSC Nastran considers the elastic deformation on the wing root to be null, while Loads Kernel allows the wing root to have elastic deformation. This makes the comparison not so direct in the flexible case. For instance, in order to compare the αtrim flexible results, in the Loads Kernel results for αtrim the ”elastic incidence angle” (basically, the wing root elastic twist deformation) was subtracted. Comparative analysis between the rigid and flexible aircraft configurations reveals evident disparities. Notably, when comparing the Loads Kernel αtrim results for horizontal level flight, a significant 26.6% difference emerges, underscoring the pronounced impact of aeroelasticity in aircraft design. This underscores the imperative of considering aeroelasticity into flight performance, stability, and control analyses.

DC3

Trim cases αtrim results for the final modified model, for M3.

Further elucidating the significance of aeroelasticity, the next table shows the CLf/CL (the percentage of the contribution of flexibility on the lift force) results obtained with Loads Kernel, highlighting the contribution of aircraft flexibility. For instance, in horizontal level flight, flexibility contributes a detrimental -5.22%. This negative contribution is explained analysing the elastic deformations of the main wing at these trim cases, as is going to be shown further on.

DC3

Trim cases αtrim results for the final modified model, for M3.

Additional information about these results can be consulted in [2]. To understand the influence of elasticity on aircraft performance, stability, and control, the main wing’s elastic deformations along the span is illustrated in the following figure across the different trim cases are analyzed.

DC3

Loads Kernel elastic deformation of the main wing at certain speed, M3 for the final modified aeroelastic model.

Elastic vertical displacement Uflex,Z along the wing span reveals upward bending during horizontal level flight and pull-up maneuvers, and downward bending during push-down maneuvers. This alignment is expected, as lift force in the former cases lifts the wing, while in the latter, it pushes it downward.

Notably, during pull-up maneuvers, the most pronounced vertical displacements occur, particularly at the wing tip, reaching Uflex,Z=1.55 m, equivalent to 10.7% of the half wing span. This displacement remains within the accepted range for linear elasticity assumptions applied in these analyses, typically valid until 12-15% of the tip’s vertical displacement relative to half the wing span.

Evaluating elastic twist Uflex,ry along the wing span, a nose-down torsional twist is observed during horizontal level flight and pull-up maneuvers in the outer wing section, indicating negative twist values. At the inner section a nose-up torsional twist is observed, but with very small values compared with the outer section. On the opposite, during push-down maneuvers, the opposite trend is evident. Notably, the most significant elastic twist occurs at the wing tip during pull-up maneuvers, with a value of Uflex,ry=−1.98 degrees. This substantial twist significantly influences lift distribution along the wing, hence affecting overall wing performance. To obtain this elastic deformation plots the file ‘plot_wing_defo_trim-cases.py’ can be found in the ‘scripts’ folder and it is presented below.

For additional information about the meanuver load results please refer to [2].

import h5py
import numpy as np
import matplotlib.pyplot as plt
import pathlib
import os
import IPython

notebook_path = IPython.get_ipython().run_line_magic('pwd','')
notebook_dir = pathlib.Path(notebook_path).resolve()
filename = path = os.path.join(notebook_dir, 'DC3_results', 'response_jcl_dc3_trim.hdf5')

# open HDF5 file
responses = h5py.File(filename, 'r')

# get response of first trim case
response = responses['0']
response2 = responses['1']
response3 = responses['2']
Ug_f = response['Ug_f'][:]
Ug_f2 = response2['Ug_f'][:]
Ug_f3 = response3['Ug_f'][:]

# extract ID, offset and set matrices
filename = path = os.path.join(notebook_dir, 'DC3_results', 'model_jcl_dc3_trim.hdf5')
model = h5py.File(filename, 'r')
strcgrid = model['strcgrid']
ID = strcgrid['ID'][:]
set = strcgrid['set'][:]
offset = strcgrid['offset'][:]

# IDs of the wing's LRA
ID_wings = np.array([54090001,54090002,54090003,54090004,54090005,54090006,54090007,54090008,54090009,54090010,54090011,54090012,54090013,54090014,54090015,54090016,54090017,54090018,54090019,54090020,54090021,54090022,54090023,54090024,54090025,54090026,54090027,54090028,54090029,54090030,54090031,64090001,64090002,64090003,64090004,64090005,64090006,64090007,64090008,64090009,64090010,64090011,64090012,64090013,64090014,64090015,64090016,64090017,64090018,64090019,64090020,64090021,64090022,64090023,64090024,64090025,64090026,64090027,64090028,64090029,64090030,64090031])

y = []
dz_pos = []
ry_pos = []
for i in range(len(ID_wings)):
    x = np.where(strcgrid['ID'][:]==ID_wings[i])
    dz_pos.append(strcgrid['set'][x[0], 2])
    ry_pos.append(strcgrid['set'][x[0], 4])
    y.append(strcgrid['offset'][x[0], 1][0])

dz= []
ry = []
for i in range(len(dz_pos)):
    dz.append(Ug_f[0, dz_pos[i]])
    ry.append(Ug_f[0, ry_pos[i]])

dz2= []
ry2 = []
for i in range(len(dz_pos)):
    dz2.append(Ug_f2[0, dz_pos[i]])
    ry2.append(Ug_f2[0, ry_pos[i]])

dz3= []
ry3 = []
for i in range(len(dz_pos)):
    dz3.append(Ug_f3[0, dz_pos[i]])
    ry3.append(Ug_f3[0, ry_pos[i]])

y_sorted_indices = np.argsort(y)
y_sorted = np.sort(y)
dz_sorted = [dz[i] for i in y_sorted_indices]
dz_sorted_sym = [-dz_sorted[i] for i in range(len(dz_sorted))]
ry_sorted = [ry[i] for i in y_sorted_indices]
dz2_sorted = [dz2[i] for i in y_sorted_indices]
dz2_sorted_sym = [-dz2_sorted[i] for i in range(len(dz2_sorted))]
ry2_sorted = [ry2[i] for i in y_sorted_indices]
dz3_sorted = [dz3[i] for i in y_sorted_indices]
dz3_sorted_sym = [-dz3_sorted[i] for i in range(len(dz3_sorted))]
ry3_sorted = [ry3[i] for i in y_sorted_indices]

ry_sorted = np.degrees(ry_sorted)
ry2_sorted = np.degrees(ry2_sorted)
ry3_sorted = np.degrees(ry3_sorted)

# Plots
fig, axs = plt.subplots(2, 1, figsize=(12, 6))
axs[0].plot(y_sorted, dz_sorted_sym, marker='o', linestyle='-', color='blue', label='Horizontal Level Flight (n$_Z$=1)')
axs[0].plot(y_sorted, dz2_sorted_sym, marker='o', linestyle='-', color='red', label='Push Down Maneuver (n$_Z$=-1)')
axs[0].plot(y_sorted, dz3_sorted_sym, marker='o', linestyle='-', color='green', label='Pull Up Maneuver (n$_Z$=2.5)')
axs[0].set_xlabel('Wing span [m]', fontsize='x-large')
axs[0].set_ylabel('U$_{flex,z}$  [m]', fontsize='x-large')
axs[0].grid(True)
axs[0].legend( fontsize='x-large')

axs[1].plot(y_sorted, ry_sorted, marker='o', linestyle='-', color='blue')
axs[1].plot(y_sorted, ry2_sorted, marker='o', linestyle='-', color='red')
axs[1].plot(y_sorted, ry3_sorted, marker='o', linestyle='-', color='green')
axs[1].set_xlabel('Wing span [m]', fontsize='x-large')
axs[1].set_ylabel('U$_{flex,ry}$  [deg]', fontsize='x-large')
axs[1].grid(True)
plt.tight_layout()
plt.show()
_images/ed1d72e1b47544e689e9f83b2197310661a6d406cea0aff3f0b27309f6602a28.png