import%20marimo%0A%0A__generated_with%20%3D%20%220.14.10%22%0Aapp%20%3D%20marimo.App(width%3D%22medium%22)%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(mo)%3A%0A%20%20%20%20mo.md(%0A%20%20%20%20%20%20%20%20r%22%22%22%0A%20%20%20%20%23%20A%20Generic%20Global%20Aerodynamic%20Model%20for%20Aircraft%0A%0A%20%20%20%20%5BGrauer%20and%20Morelli%5D(https%3A%2F%2Fntrs.nasa.gov%2Fapi%2Fcitations%2F20140011902%2Fdownloads%2F20140011902.pdf)%20from%20NASA%20took%20detailed%20wind%20tunnel%20databases%20for%20eight%20different%20aircraft%20to%20identify%20a%20generic%20global%20aerodynamic%20model%20structure%20that%20could%20be%20used%20for%20any%20of%20the%20aircraft.%20The%20structure%20they%20came%20up%20with%20includes%2045%20scalar%20model%20parameters%20%24%5Ctheta_1%24%20through%20%24%5Ctheta_%7B45%7D%24%2C%20used%20in%20conjunction%20with%20the%20following%3A%0A%0A%20%20%20%20%7C%20Category%20%7C%20Variables%20%7C%0A%20%20%20%20%7C%20--------%20%7C%20---------%20%7C%0A%20%20%20%20%7C%20Aerodynamic%20angles%20%7C%20%24%5Calpha%24%2C%20%24%5Cbeta%24%20%7C%0A%20%20%20%20%7C%20Angular%20rates%20%7C%20%24%5Ctilde%7Bp%7D%24%2C%20%24%5Ctilde%7Bq%7D%24%2C%20%24%5Ctilde%7Br%7D%24%20%7C%0A%20%20%20%20%7C%20Control%20surfaces%20%7C%20%24%5Cdelta_e%24%2C%20%24%5Cdelta_a%24%2C%20%24%5Cdelta_r%24%20%7C%0A%0A%20%20%20%20The%20angular%20rates%20are%20the%20standard%20nondimensional%20body-axis%20angular%20rates.%0A%0A%20%20%20%20%24%24%0A%20%20%20%20%5Cbegin%7Bbmatrix%7D%0A%20%20%20%20%5Ctilde%7Bp%7D%20%5C%5C%0A%20%20%20%20%5Ctilde%7Bq%7D%20%5C%5C%0A%20%20%20%20%5Ctilde%7Br%7D%0A%20%20%20%20%5Cend%7Bbmatrix%7D%0A%20%20%20%20%3D%0A%20%20%20%20%5Cfrac%7B1%7D%7B2V%7D%0A%20%20%20%20%5Cbegin%7Bbmatrix%7D%0A%20%20%20%20b%20%26%200%20%26%200%20%5C%5C%0A%20%20%20%200%20%26%20%5Cbar%7Bc%7D%20%26%200%20%5C%5C%0A%20%20%20%200%20%26%200%20%26%20b%0A%20%20%20%20%5Cend%7Bbmatrix%7D%0A%20%20%20%20%5Cbegin%7Bbmatrix%7D%0A%20%20%20%20p%20%5C%5C%0A%20%20%20%20q%20%5C%5C%0A%20%20%20%20r%0A%20%20%20%20%5Cend%7Bbmatrix%7D%0A%20%20%20%20%24%24%0A%20%20%20%20%22%22%22%0A%20%20%20%20)%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(mo)%3A%0A%20%20%20%20mo.md(%0A%20%20%20%20%20%20%20%20r%22%22%22%0A%20%20%20%20%23%23%20GGA%20Model%0A%0A%0A%20%20%20%20%24C_D%20%3D%20%20%20%20%20%20%20%5Ctheta_1%20%2B%20%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%5Ctheta_2%20%5Calpha%20%2B%20%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%5Ctheta_3%20%5Calpha%20%5Ctilde%7Bq%7D%20%2B%20%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%5Ctheta_4%20%5Calpha%20%5Cdelta_e%20%2B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%5Ctheta_5%20%5Calpha%5E2%20%2B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%5Ctheta_6%20%5Calpha%5E2%20%5Ctilde%7Bq%7D%20%2B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%5Ctheta_7%20%5Calpha%5E2%20%5Cdelta_e%20%2B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%5Ctheta_8%20%5Calpha%5E3%20%2B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%5Ctheta_9%20%5Calpha%5E3%20%5Ctilde%7Bq%7D%20%2B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%5Ctheta_%7B10%7D%20%5Calpha%5E4%24%0A%0A%20%20%20%20%24C_Y%20%3D%20%20%20%20%20%20%20%5Ctheta_%7B11%7D%20%5Cbeta%20%2B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%5Ctheta_%7B12%7D%20%5Ctilde%7Bp%7D%20%2B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%5Ctheta_%7B13%7D%20%5Ctilde%7Br%7D%20%2B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%5Ctheta_%7B14%7D%20%5Cdelta_a%20%2B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%5Ctheta_%7B15%7D%20%5Cdelta_r%24%0A%0A%20%20%20%20%24C_L%20%3D%20%20%20%20%20%20%20%5Ctheta_%7B16%7D%20%2B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%5Ctheta_%7B17%7D%20%5Calpha%20%2B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%5Ctheta_%7B18%7D%20%5Ctilde%7Bq%7D%20%2B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%5Ctheta_%7B19%7D%20%5Cdelta_e%20%2B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%5Ctheta_%7B20%7D%20%5Calpha%20%5Ctilde%7Bq%7D%20%2B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%5Ctheta_%7B21%7D%20%5Calpha%5E2%20%2B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%5Ctheta_%7B22%7D%20%5Calpha%5E3%20%2B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%5Ctheta_%7B23%7D%20%5Calpha%5E4%24%0A%0A%20%20%20%20%24%5Cspace%24%0A%0A%20%20%20%20%24C_l%20%3D%20%20%20%20%20%20%20%5Ctheta_%7B24%7D%20%5Cbeta%20%2B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%5Ctheta_%7B25%7D%20%5Ctilde%7Bp%7D%20%2B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%5Ctheta_%7B26%7D%20%5Ctilde%7Br%7D%20%2B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%5Ctheta_%7B27%7D%20%5Cdelta_a%20%2B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%5Ctheta_%7B28%7D%20%5Cdelta_r%24%0A%0A%20%20%20%20%24C_m%20%3D%20%20%20%20%20%20%20%5Ctheta_%7B29%7D%20%2B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%5Ctheta_%7B30%7D%20%5Calpha%20%2B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%5Ctheta_%7B31%7D%20%5Ctilde%7Bq%7D%20%2B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%5Ctheta_%7B32%7D%20%5Cdelta_e%20%2B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%5Ctheta_%7B33%7D%20%5Calpha%20%5Ctilde%7Bq%7D%20%2B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%5Ctheta_%7B34%7D%20%5Calpha%5E2%20%5Ctilde%7Bq%7D%20%2B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%5Ctheta_%7B35%7D%20%5Calpha%5E2%20%5Cdelta_e%20%2B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%5Ctheta_%7B36%7D%20%5Calpha%5E3%20%5Ctilde%7Bq%7D%20%2B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%5Ctheta_%7B37%7D%20%5Calpha%5E3%20%5Cdelta_e%20%2B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%5Ctheta_%7B38%7D%20%5Calpha%5E4%24%0A%0A%20%20%20%20%24C_n%20%3D%20%20%20%20%20%20%20%5Ctheta_%7B39%7D%20%5Cbeta%20%2B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%5Ctheta_%7B40%7D%20%5Ctilde%7Bp%7D%20%2B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%5Ctheta_%7B41%7D%20%5Ctilde%7Br%7D%20%2B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%5Ctheta_%7B42%7D%20%5Cdelta_a%20%2B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%5Ctheta_%7B43%7D%20%5Cdelta_r%20%2B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%5Ctheta_%7B44%7D%20%5Cbeta%5E2%20%2B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%5Ctheta_%7B45%7D%20%5Cbeta%5E3%24%0A%20%20%20%20%22%22%22%0A%20%20%20%20)%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(mo)%3A%0A%20%20%20%20mo.md(%0A%20%20%20%20%20%20%20%20r%22%22%22%0A%20%20%20%20Forces%20are%20in%20the%20stability%20frame%20and%20the%20moments%20are%20in%20the%20body%20frame.%0A%0A%20%20%20%20Mach%20effects%20are%20not%20modelled%20and%20only%20a%20single%20configuration%20is%20modelled%2C%20i.e.%20changes%20with%20respect%20to%20flaps%2C%20gear%20etc.%20are%20not%20modelled.%0A%0A%20%20%20%20Nonlinear%20flight%20simulations%20were%20used%20to%20demonstrate%20that%20the%20GGA%20model%20accurately%20reproduces%20trim%20solutions%2C%20local%20dynamic%20behavior%2C%20and%20global%20dynamic%20behavior%20under%20large-amplitude%20excitation.%0A%20%20%20%20%22%22%22%0A%20%20%20%20)%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(mo)%3A%0A%20%20%20%20mo.md(%0A%20%20%20%20%20%20%20%20r%22%22%22%0A%20%20%20%20%23%23%23%20Drag%0A%0A%20%20%20%20%23%23%23%23%20Drag%20vs%20Alpha%0A%0A%20%20%20%20%7C%20Model%20Parameter%20%7C%20Standard%20Equivalent%20%7C%0A%20%20%20%20%7C%20---------------%20%7C%20-------------------%20%7C%0A%20%20%20%20%7C%20%24%5Ctheta_1%24%20%20%20%20%20%20%7C%20%24C_%7BD_0%7D%24%20%20%20%20%20%20%20%20%20%20%20%7C%0A%20%20%20%20%7C%20%24%5Ctheta_2%24%20%20%20%20%20%20%7C%20%24C_%7BD_%7B%5Calpha%7D%7D%24%20%20%20%20%7C%0A%20%20%20%20%7C%20%24%5Ctheta_5%24%20%20%20%20%20%20%7C%20%24C_%7BD_%7B%5Calpha%5E2%7D%7D%24%20%20%7C%0A%0A%20%20%20%20%24%5Ctheta_1%24%2C%20%24%5Ctheta_2%24%2C%20%24%5Ctheta_5%24%2C%20%24%5Ctheta_8%24%20and%20%24%5Ctheta_%7B10%7D%24%20are%20used%20to%20model%20%24C_D%24%20versus%20%24%5Calpha%24%2C%20making%20use%20of%20%24%5Calpha%24%20from%200th%20to%204th%20order.%20%20%0A%0A%20%20%20%20%23%23%23%23%20Drag%20vs%20Elevator%0A%20%20%20%20%24%5Ctheta_4%24%20and%20%24%5Ctheta_7%24%20are%20used%20to%20model%20%24C_D%24%20versus%20elevator%20deflection%2C%20in%20conjunction%20with%201st%20and%202nd%20order%20%24%5Calpha%24.%20Often%20drag%20versus%20elevator%20deflection%2C%20%24C_%7BD_%7B%5Cdelta_e%7D%7D%24%20is%20modelled%20independently%20of%20%24%5Calpha%24.%0A%0A%20%20%20%20%23%23%23%23%20Drag%20vs%20Pitch%20Rate%0A%20%20%20%20%24%5Ctheta_3%24%2C%20%24%5Ctheta_6%24%20and%20%24%5Ctheta_9%24%20are%20used%20to%20model%20%24C_D%24%20versus%20normalized%20pitch%20rate.%0A%0A%20%20%20%20TODO%20-%20Is%20drag%20vs%20pitch%20rate%20a%20common%20term%3F%0A%0A%20%20%20%20%23%23%23%23%20Summary%0A%0A%20%20%20%20%7C%20Effect%20%20%20%20%20%7C%20Model%20Parameters%20%7C%20Model%20Terms%20%7C%0A%20%20%20%20%7C%20----------%20%7C%20----------------%20%7C%20-----------%20%7C%0A%20%20%20%20%7C%20Alpha%20%20%20%20%20%20%7C%20%24%5Ctheta_1%24%2C%20%24%5Ctheta_2%24%2C%20%24%5Ctheta_5%24%2C%20%24%5Ctheta_8%24%2C%20%24%5Ctheta_%7B10%7D%24%20%7C%20%24%5Ctheta_1%20%2B%20%5Ctheta_2%20%5Calpha%20%2B%20%5Ctheta_5%20%5Calpha%5E2%20%2B%20%5Ctheta_8%20%5Calpha%5E3%20%2B%20%5Ctheta_%7B10%7D%20%5Calpha%5E4%24%20%7C%0A%20%20%20%20%7C%20Elevator%20%20%20%7C%20%24%5Ctheta_4%24%2C%20%24%5Ctheta_7%24%20%7C%20%24%5Ctheta_4%20%5Calpha%20%5Cdelta_e%20%2B%20%5Ctheta_7%20%5Calpha%5E2%20%5Cdelta_e%24%20%7C%0A%20%20%20%20%7C%20Pitch%20Rate%20%7C%20%24%5Ctheta_3%24%2C%20%24%5Ctheta_6%24%2C%20%24%5Ctheta_9%24%20%7C%20%24%5Ctheta_3%20%5Calpha%20%5Ctilde%7Bq%7D%20%2B%20%5Ctheta_6%20%5Calpha%5E2%20%5Ctilde%7Bq%7D%20%2B%20%5Ctheta_9%20%5Calpha%5E3%20%5Ctilde%7Bq%7D%24%20%7C%0A%0A%20%20%20%20TODO%20-%20Any%20standard%20drag%20terms%20missing%3F%0A%20%20%20%20%22%22%22%0A%20%20%20%20)%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(mo)%3A%0A%20%20%20%20mo.md(%0A%20%20%20%20%20%20%20%20r%22%22%22%0A%20%20%20%20%23%23%23%20Side%20Force%0A%0A%20%20%20%20%23%23%23%23%20Side%20Force%20v%20Beta%0A%0A%20%20%20%20%7C%20Model%20Parameter%20%7C%20Standard%20Equivalent%20%7C%0A%20%20%20%20%7C%20---------------%20%7C%20-------------------%20%7C%0A%20%20%20%20%7C%20%24%5Ctheta_%7B11%7D%24%20%20%20%7C%20%24C_%7BY_%5Cbeta%7D%24%20%20%20%20%20%20%20%7C%0A%20%20%20%20%22%22%22%0A%20%20%20%20)%0A%20%20%20%20return%0A%0A%0A%40app.cell%0Adef%20_()%3A%0A%20%20%20%20t_f16%20%3D%20%5B%20%0A%20%20%20%20%20%20%20%200.034%2C%20-0.005%2C%2020.77%2C%200.177%2C%201.285%2C%20-19.97%2C%200.756%2C%205.887%2C%2055.59%2C%20-5.155%2C%0A%20%20%20%20%20%20%20%20-1.146%2C%20-0.188%2C%200.876%2C%200.060%2C%200.164%2C%0A%20%20%20%20%20%20%20%200.074%2C%204.458%2C%2029.90%2C%200.412%2C%20-5.538%2C%20-2.477%2C%20-1.101%2C%201.906%2C%20%0A%20%20%20%20%20%20%20%20-0.071%2C%20-0.445%2C%200.058%2C%20-0.143%2C%200.023%2C%0A%20%20%20%20%20%20%20%20-0.024%2C%20-0.288%2C%20-8267%2C%20-0.563%2C%20-5.513%2C%209.793%2C%20-1.057%2C%20-2.018%2C%201.897%2C%20-0.094%2C%0A%20%20%20%20%20%20%20%200.234%2C%200.056%2C%20-0.418%2C%200.034%2C%20-0.085%2C%200.372%2C%20-0.725%0A%20%20%20%20%5D%0A%20%20%20%20return%20(t_f16%2C)%0A%0A%0A%40app.cell%0Adef%20_(math%2C%20np%2C%20t_f16)%3A%0A%20%20%20%20alpha_rad%20%3D%20np.linspace(math.radians(-4)%2C%20math.radians(30)%2C%20100)%0A%20%20%20%20CL%20%3D%20t_f16%5B15%5D%20%2B%20t_f16%5B16%5D*alpha_rad%20%2B%20t_f16%5B20%5D*(alpha_rad**2)%20%2B%20t_f16%5B21%5D*(alpha_rad**3)%20%2B%20t_f16%5B22%5D*(alpha_rad**4)%0A%20%20%20%20CD%20%3D%20t_f16%5B0%5D%20%2B%20t_f16%5B1%5D*alpha_rad%20%2B%20t_f16%5B4%5D*(alpha_rad**2)%20%2B%20t_f16%5B7%5D*(alpha_rad**3)%20%2B%20t_f16%5B9%5D*(alpha_rad**4)%0A%20%20%20%20Cm%20%3D%20t_f16%5B28%5D%20%2B%20t_f16%5B29%5D*alpha_rad%20%2B%20t_f16%5B39%5D*(alpha_rad**4)%0A%20%20%20%20return%20CD%2C%20CL%2C%20Cm%2C%20alpha_rad%0A%0A%0A%40app.cell%0Adef%20_(CD%2C%20CL%2C%20Cm%2C%20alpha_rad%2C%20plt)%3A%0A%20%20%20%20plt.figure()%0A%20%20%20%20plt.plot(alpha_rad%20*%2057.29578%2C%20CL%2C%20label%3D'%24C_L%24')%0A%20%20%20%20plt.plot(alpha_rad%20*%2057.29578%2C%20CD%2C%20label%3D'%24C_D%24')%0A%20%20%20%20plt.plot(alpha_rad%20*%2057.29578%2C%20Cm%2C%20label%3D'%24C_m%24')%0A%20%20%20%20plt.legend()%0A%20%20%20%20plt.show()%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(mo)%3A%0A%20%20%20%20mo.md(%0A%20%20%20%20%20%20%20%20r%22%22%22%0A%20%20%20%20%23%23%20References%0A%0A%20%20%20%20%5BA%20Generic%20Nonlinear%20Aerodynamic%20Model%20for%20Aircraft%5D(https%3A%2F%2Fntrs.nasa.gov%2Fapi%2Fcitations%2F20140011902%2Fdownloads%2F20140011902.pdf)%20-%20J.%20Grauer%2C%20E.%20Morelli%0A%20%20%20%20%22%22%22%0A%20%20%20%20)%0A%20%20%20%20return%0A%0A%0A%40app.cell%0Adef%20_()%3A%0A%20%20%20%20import%20marimo%20as%20mo%0A%0A%20%20%20%20import%20numpy%20as%20np%0A%20%20%20%20from%20matplotlib%20import%20pyplot%20as%20plt%0A%20%20%20%20import%20math%0A%20%20%20%20return%20math%2C%20mo%2C%20np%2C%20plt%0A%0A%0Aif%20__name__%20%3D%3D%20%22__main__%22%3A%0A%20%20%20%20app.run()%0A
ca390db41c9c9dfbcda9f74aade4510d2df41ca936d9bf35727afe541eefe1bc