import%20marimo%0A%0A__generated_with%20%3D%20%220.13.15%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%20Level%20Acceleration%0A%0A%20%20%20%20This%20notebook%20demonstrates%20the%20calculation%20of%20climb%20performance%20from%20a%20level%20acceleration%20test%20using%20the%20procedure%20as%20described%20by%20Nigel%20Speedy%20at%20-%20%5BUsing%20Level%20Accelerations%20to%20Determine%20Climb%20Performance%5D(https%3A%2F%2Fwww.kitplanes.com%2Fusing-level-accelerations-to-determine-climb-performance%2F).%0A%0A%20%20%20%20Load%20in%20the%20data%20recorded%20by%20iLevil%20based%20FTI%20system.%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_(np)%3A%0A%20%20%20%20data%20%3D%20np.genfromtxt('data%2FLevelAcceleration%2FTestPoint1-iLevil.csv'%2C%20delimiter%3D'%2C'%2C%20names%3DTrue)%0A%20%20%20%20return%20(data%2C)%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(mo)%3A%0A%20%20%20%20mo.md(r%22%22%22Generate%200%20based%20time%20values.%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell%0Adef%20_(data)%3A%0A%20%20%20%20time%20%3D%20data%5B'GPSSecondsToday'%5D%20-%20data%5B0%5D%5B'GPSSecondsToday'%5D%0A%20%20%20%20return%20(time%2C)%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(mo)%3A%0A%20%20%20%20mo.md(r%22%22%22Take%20a%20look%20at%20the%20IAS%20and%20altitude%20during%20the%20test%20point.%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell%0Adef%20_(data%2C%20plt%2C%20time)%3A%0A%20%20%20%20plt.figure()%0A%20%20%20%20plt.title(%22KIAS%20vs%20Time%22)%0A%20%20%20%20plt.plot(time%2C%20data%5B'IASkt'%5D)%0A%0A%20%20%20%20plt.figure()%0A%20%20%20%20plt.title(%22Altitude%20vs%20Time%22)%0A%20%20%20%20plt.plot(time%2C%20data%5B'Altitude'%5D)%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(r%22%22%22Calculate%20TAS%20from%20IAS%2C%20assuming%20ISA%20standard%20day%20and%20pressure%20altitude%20of%208000ft.%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell%0Adef%20_(data)%3A%0A%20%20%20%20TASData%20%3D%20data%5B%22IASkt%22%5D%20*%201.127%0A%20%20%20%20return%20(TASData%2C)%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(mo)%3A%0A%20%20%20%20mo.md(r%22%22%22Let's%20create%20a%204th%20order%20polynomial%20in%20order%20to%20smooth%20out%20the%20noise%20in%20the%20TAS%20data.%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell%0Adef%20_(TASData%2C%20np%2C%20time)%3A%0A%20%20%20%20TASPoly%20%3D%20np.polyfit(time%2C%20TASData%2C%204)%0A%20%20%20%20TASPoly%0A%20%20%20%20return%20(TASPoly%2C)%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(mo)%3A%0A%20%20%20%20mo.md(r%22%22%22Generate%20smoothed%20TAS%20data%20from%20the%20polynomial%20coefficients.%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell%0Adef%20_(TASPoly%2C%20time)%3A%0A%20%20%20%20TASSmoothedData%20%3D%20TASPoly%5B0%5D%20*%20time**4%20%2B%20TASPoly%5B1%5D%20*%20time**3%20%2B%20TASPoly%5B2%5D%20*%20time**2%20%2B%20TASPoly%5B3%5D%20*%20time%20%2B%20TASPoly%5B4%5D%0A%20%20%20%20return%20(TASSmoothedData%2C)%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(mo)%3A%0A%20%20%20%20mo.md(r%22%22%22Plot%20of%20the%20TAS%20data%20including%20the%20smoothed%20polynomial%20fit.%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell%0Adef%20_(TASData%2C%20TASSmoothedData%2C%20plt%2C%20time)%3A%0A%20%20%20%20plt.figure()%0A%20%20%20%20plt.title(%22KTAS%20vs%20Time%22)%0A%20%20%20%20plt.plot(time%2C%20TASData)%0A%20%20%20%20plt.plot(time%2C%20TASSmoothedData)%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(r%22%22%22Let's%20calculate%20%24dv%2Fdt%24%20derivative%20from%20the%20TAS%20polynomial.%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell%0Adef%20_(TASPoly)%3A%0A%20%20%20%20dvdtPolyCoefs%20%3D%20%5B%204*TASPoly%5B0%5D%2C%203*TASPoly%5B1%5D%2C%202*TASPoly%5B2%5D%2C%201*TASPoly%5B3%5D%20%5D%0A%20%20%20%20dvdtPolyCoefs%0A%20%20%20%20return%20(dvdtPolyCoefs%2C)%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(mo)%3A%0A%20%20%20%20mo.md(r%22%22%22Generate%20%24dv%2Fdt%24%20data%20and%20plot%20it.%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell%0Adef%20_(dvdtPolyCoefs%2C%20time)%3A%0A%20%20%20%20dvdtData%20%3D%20dvdtPolyCoefs%5B0%5D%20*%20time**3%20%2B%20dvdtPolyCoefs%5B1%5D%20*%20time**2%20%2B%20dvdtPolyCoefs%5B2%5D%20*%20time%20%2B%20dvdtPolyCoefs%5B3%5D%0A%20%20%20%20return%20(dvdtData%2C)%0A%0A%0A%40app.cell%0Adef%20_(dvdtData%2C%20plt%2C%20time)%3A%0A%20%20%20%20plt.figure()%0A%20%20%20%20plt.title(%22dv%2Fdt%20KTAS%20vs%20Time%22)%0A%20%20%20%20plt.plot(time%2C%20dvdtData)%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%20Now%20calculate%3A%0A%0A%20%20%20%20%24%5Cdfrac%7BdH%7D%7Bdt%7D%20%3D%20%5Cdfrac%7BV_t%7D%7Bg%7D%20%5Cdfrac%7BdV%7D%7Bdt%7D%24%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_(TASSmoothedData%2C%20dvdtData)%3A%0A%20%20%20%20g%20%3D%2032.2%20%20%20%20%20%20%20%20%20%20%20%23%20ft%2Fs%5E2%0A%20%20%20%20ktTofps%20%3D%201.68%20%20%20%20%20%23%20conversion%20from%20kt%20to%20ft%2Fs%0A%20%20%20%20fpsTofpm%20%3D%2060%20%20%20%20%20%20%23%20conversion%20from%20ft%2Fs%20to%20ft%2Fmin%0A%0A%20%20%20%20dHdtData%20%3D%20(((TASSmoothedData%20*%20ktTofps)%20%2F%20g)%20*%20dvdtData%20*%20ktTofps)%20*%20fpsTofpm%0A%20%20%20%20return%20(dHdtData%2C)%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(mo)%3A%0A%20%20%20%20mo.md(r%22%22%22Generate%20smoothed%20IAS%20data%20from%20the%20smoothed%20TAS%20data.%20Again%20assuming%20ISA%20standard%20day%20at%208000ft.%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell%0Adef%20_(TASSmoothedData)%3A%0A%20%20%20%20IASSmoothedData%20%3D%20TASSmoothedData%20%2F%201.127%0A%20%20%20%20return%20(IASSmoothedData%2C)%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(mo)%3A%0A%20%20%20%20mo.md(r%22%22%22Finally%20let's%20plot%20%24dH%2Fdt%24%20versus%20KIAS.%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell%0Adef%20_(IASSmoothedData%2C%20dHdtData%2C%20plt)%3A%0A%20%20%20%20plt.figure()%0A%20%20%20%20plt.title(%22ROC%20(fpm)%20vs%20KIAS%22)%0A%20%20%20%20plt.plot(IASSmoothedData%2C%20dHdtData)%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(r%22%22%22Now%20plot%20against%20unsmoothed%20KIAS.%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell%0Adef%20_(dHdtData%2C%20data%2C%20plt)%3A%0A%20%20%20%20plt.figure()%0A%20%20%20%20plt.title(%22ROC%20(fpm)%20vs%20Unsmoothed%20KIAS%22)%0A%20%20%20%20plt.plot(data%5B'IASkt'%5D%2C%20dHdtData)%0A%20%20%20%20plt.show()%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%20import%20matplotlib.pyplot%20as%20plt%0A%20%20%20%20return%20mo%2C%20np%2C%20plt%0A%0A%0A%40app.cell%0Adef%20_()%3A%0A%20%20%20%20return%0A%0A%0Aif%20__name__%20%3D%3D%20%22__main__%22%3A%0A%20%20%20%20app.run()%0A
0e87afa665614ac9085396a81998e7a2ef8bac8477c993c670da6360e53f5115