<jupyter_start><jupyter_text>Example 4- Creating a system and finding the equilibrium point  Import International Standard Atmosphere (ISA) model<jupyter_code>from pyaat.atmosphere import atmosISA
atm = atmosISA()<jupyter_output><empty_output><jupyter_text>atmosphere class implements a series of models to provide air density $\rho$, air pressure and air temperature as a function of altitude and temperature at sea level. If no information about seal level temperature is provided 15⁰C is considered.  Import Newton gravity model<jupyter_code>from pyaat.gravity import NewtonGravity
grav = NewtonGravity()<jupyter_output><empty_output><jupyter_text>gravity class provides the matrix form of the vector of the gravitational field. It can be deppendend of the altitude, latitude and longitude, varying with the complexity of the adopted model. Newton's gravity is only function of the altitude.  Import Aircraft<jupyter_code>from pyaat.aircraft import Aircraft
airc = Aircraft()<jupyter_output><empty_output><jupyter_text>aircraft class contains all relevant information about aerodynamics, geometry and inertia of the aircraft. It also contains embeeded methods to compute the net aerodynamic forces and moments acting over the body.  Import propulsion<jupyter_code>from pyaat.propulsion import SimpleModel
prop = SimpleModel()<jupyter_output><empty_output><jupyter_text>Propulsion system is the only system capable to input mechanical energy on the system. A propulsion system can be composed by several heterogeneous motors, pointing at diferent directions.In this example one use a simple turbo-fan model aligned within the body.  Building a system<jupyter_code>from pyaat.system import system
System = system(atmosphere = atm, propulsion = prop, aircraft = airc, gravity = grav)<jupyter_output><empty_output><jupyter_text>We now have a system containing atmosphere, gravity, aircraft and a propulsive system. Note that the minimal information needed to a system is atmosphere, gravity and aircraft. Additional infromation are 'control', 'propulsion', 'wind' and 'perturbation'. These will be introduced in a further example.  Trimmer system class has a series of embeeded methods, being the trimmer one of them. The trimmer returns the equilibrium states and control action to achieve steady state at a given condition for one instant of time. The minimal required information are 'condition', the equilibrium altitude 'HE' and the equilibrium aerodynamic velocity 'VE'.  Trimmer at cruize condition<jupyter_code>Xe, Ue = System.trimmer(condition='cruize', HE = 5000., VE = 150)<jupyter_output><empty_output><jupyter_text>At cruize condition we only shall specify the desired altitude and velocity. If one of these information is mission the method will raise an exception informing the user.<jupyter_code>#Xe, Ue = System.trimmer(condition='cruize', VE = 150)
#Xe, Ue = System.trimmer(condition='cruize', HE = '5000.', VE = 150)
#Xe, Ue = System.trimmer(condition='cruize', HE = -5000., VE = 150)<jupyter_output><empty_output><jupyter_text>Printing results<jupyter_code>from pyaat.tools import printInfo<jupyter_output><empty_output><jupyter_text>Printing the states at trimmed condition.<jupyter_code>printInfo(Xe, Ue, frame ='aero')<jupyter_output>--------------------------------
------------ STATES ------------
------------- AERO -------------
--------------------------------
V
150.0
-------------
alpha
1.6597554096325493
-------------
beta
2.375768068926139e-19
-------------
phi
0.0
-------------
theta
1.6597554099391152
-------------
psi
0.0
-------------
p
1.3266044413004475e-19
-------------
q
1.0147587630717015e-09
-------------
r
8.54763150691195e-20
-------------
x0
0.0
-------------
y0
0.0
-------------
H
5000.0<jupyter_text>Note that the states are expressed on aerodynamic frame. For printing the information on body frame one shall specify `frame ='body'` Printing the controls at trimmed condition.<jupyter_code>printInfo(Xe, Ue, frame='controls')<jupyter_output>--------------------------------
----------- CONTROLS -----------
--------------------------------
delta_p
22.11806941801808
-------------
delta_e
-1.1124961240047553
-------------
delta_a
-1.75382760267014e-19
-------------
delta_r
2.338808759712513e-19<jupyter_text>Other trimmed conditions include climb, Pull-Up maneuver and turn maneuver. To trimm the aricraft under these conditions we must provide some aditional information, as follows: Trimmer at climb conditionWe shall provide the climb rate `dH` $\dot{H}$ in $m/s$, as follows:<jupyter_code>Xe, Ue = System.trimmer(condition='climb', HE =5000., VE= 150, dH =5.)
printInfo(Xe,Ue, frame ='body')<jupyter_output>--------------------------------
------------ STATES ------------
------------- BODY -------------
--------------------------------
x
0.0
-------------
y
0.0
-------------
z
-5000.0
-------------
u
149.93912021742563
-------------
v
-4.3354024570837254e-23
-------------
w
4.273198851491462
-------------
phi
0.0
-------------
theta
3.542675759017864
-------------
psi
0.0
-------------
p
-1.9424065571623405e-21
-------------
q
7.150014864357985e-17
-------------
r
-7.83751693941996e-23<jupyter_text>Note that the states are printed on body frame.If a value $dH \leq 0$ is provided it implies a descent flight.<jupyter_code>printInfo(Xe,Ue, frame='controls')<jupyter_output>--------------------------------
----------- CONTROLS -----------
--------------------------------
delta_p
35.45504955327019
-------------
delta_e
-0.7926439175150326
-------------
delta_a
6.787487148821011e-22
-------------
delta_r
3.077534798411521e-22<jupyter_text>Trimmer at Pull-Up maneuverWe shall provide the pitch rate `dTH` $\dot{\theta}$ in $deg/s$, as follows:<jupyter_code>Xe, Ue = System.trimmer(condition='pullUp', HE =5000., VE= 150, dTH = 10.)<jupyter_output><empty_output><jupyter_text>Trimmer for turn maneuverIn this case we shall provide the slidingside angle `beta` ($\beta$) in $deg$ and the yaw rate `dPS` $\dot{\psi}$ in $deg/s$. Note that $\beta = 0$  implies in a coordenated turn meneuver.<jupyter_code>Xe, Ue = System.trimmer(condition='turn', HE =5000., VE= 150, dPS= 2., BTA =2.)<jupyter_output><empty_output><jupyter_text>For any trimming condition, if a needed infromation is not provided an exception will raise.<jupyter_code>Xe, Ue = System.trimmer(condition='turn', HE =5000., VE= 150, dPS= 2.)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.1925, 'fraction_numerical': 0.07203125, 'mean_word_length': 3.0359394703656997, 'pattern_counts': {'":': 0, '<': 57, '<?xml version=': 0, '>': 57, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '15', 'dir': 'jupyter-structured-clean-dedup', 'id': '406625', 'license': 'MIT', 'n_tokens_mistral': 2212, 'n_tokens_neox': 1882, 'n_words': 622, 'path': 'examples/system_example.ipynb', 'repo_name': 'KenedyMatiasso/PyAAT', 'size': '6400'}