diff --git a/ThrustCurve.png b/ThrustCurve.png index ac42fec..f004877 100644 Binary files a/ThrustCurve.png and b/ThrustCurve.png differ diff --git a/readme.md b/readme.md index 9531269..6ae3d7c 100644 --- a/readme.md +++ b/readme.md @@ -1,8 +1,13 @@ # Air Prop Thrust -Total Impulse: 405.0 ± 39.0 N s + +Total Impulse: 405.0 ± 40.0 N s + +Burn TIme: 16.041999999996623 s ![Thrust Over Time](ThrustCurve.png) More Data: -

4 rows × 7 columns

variablemeanminmedianmaxnmissingeltype
SymbolQuantityQuantityQuantityQuantityInt64DataType
1Thrust69.0±6.7 N0.0±0.0 N86.7±9.2 N86.7±9.2 N0Quantity{Measurement{Float64}, 𝐋 𝐌 𝐓^-2, FreeUnits{(N,), 𝐋 𝐌 𝐓^-2, nothing}}
2Pressure1.21e7±2.0e6 Pa620000.0±440000.0 Pa1.12e7±2.8e6 Pa2.9e7±2.1e6 Pa0Quantity{Measurement{Float64}, 𝐌 𝐋^-1 𝐓^-2, FreeUnits{(Pa,), 𝐌 𝐋^-1 𝐓^-2, nothing}}
3Time2.9325 s0.0 s2.9325 s5.865 s0Quantity{Float64, 𝐓, FreeUnits{(s,), 𝐓, nothing}}
4Mass0.196±0.043 kg0.01±0.0077 kg0.181±0.054 kg0.468±0.053 kg0Quantity{Measurement{Float64}, 𝐌, FreeUnits{(kg,), 𝐌, nothing}}
+

4 rows × 7 columns

variablemeanminmedianmaxnmissingeltype
SymbolQuantityQuantityQuantityQuantityInt64DataType
1Thrust25.3±2.5 N0.0±0.0 N26.7±5.9 N26.7±5.9 N0Quantity{Measurement{Float64}, 𝐋 𝐌 𝐓^-2, FreeUnits{(N,), 𝐋 𝐌 𝐓^-2, nothing}}
2Pressure1.39e7±3.6e6 Pa300000.0±1.1e6 Pa1.38e7±3.9e6 Pa2.9e7±2.1e6 Pa0Quantity{Measurement{Float64}, 𝐌 𝐋^-1 𝐓^-2, FreeUnits{(Pa,), 𝐌 𝐋^-1 𝐓^-2, nothing}}
3Time8.021 s0.0 s8.021 s16.042 s0Quantity{Float64, 𝐓, FreeUnits{(s,), 𝐓, nothing}}
4Mass0.225±0.065 kg0.005±0.018 kg0.224±0.071 kg0.468±0.053 kg0Quantity{Measurement{Float64}, 𝐌, FreeUnits{(kg,), 𝐌, nothing}}
+ +`readme auto generated` diff --git a/thrust.jl b/thrust.jl index 6e5e423..7668d59 100644 --- a/thrust.jl +++ b/thrust.jl @@ -2,7 +2,6 @@ using Unitful using DataFrames using Plots using UnitfulRecipes -using Roots using CSV using Measurements using Printf @@ -12,14 +11,13 @@ using Printf V = (85 ± 5)u"inch^3" P0 = (4200.0 ± 300)u"psi" Wtank = (2.3 ± 0.2)u"lb" -Pmax = (800 ± 50)u"psi" +Pmax = (250 ± 50)u"psi" # Max Pressure that can come out the nozzle Wsolenoid = 1.5u"kg" # Params d_nozzle = ((1 // 16) ± 0.001)u"inch" a_nozzle = (pi / 4) * d_nozzle^2 -Poutmax = (800 ± 50)u"psi" # Universal Stuff P_amb = (1 ± 0.2)u"atm" @@ -34,7 +32,7 @@ M = V * (P / (R * T)) |> u"kg" ts = 1u"ms" df = DataFrame(Thrust = (0 ± 0)u"N", Pressure = P, Time = t, Mass = M) -while M > 0.01u"kg" +while M > 0.005u"kg" # while t < 30u"s" # Calculate what is leaving tank P = minimum([P, Pmax]) @@ -52,7 +50,7 @@ while M > 0.01u"kg" df_step = DataFrame(Thrust = Thrust, Pressure = P, Time = t, Mass = M) append!(df, df_step) end - +final_time = t |> u"s" impulse = sum(df.Thrust) * ts |> u"N*s" println("---------------------------\n\n\n\n") println("Total Impulse: ", impulse) @@ -63,7 +61,7 @@ println("Mass Total: ", Wtank + Wsolenoid + maximum(df.Mass)) print(describe(df)) -plot(df.Time[1:150:end], df.Thrust[1:150:end], title = "Thrust Over Time") +plot(df.Time[1:350:end], df.Thrust[1:350:end], title = "Thrust Over Time") ### Save data to readme.md @@ -77,13 +75,20 @@ table = String(take!(b)); # https://stackoverflow.com/a/60443621/8774114 readme = Printf.@sprintf """ # Air Prop Thrust + Total Impulse: %s +Burn TIme: %s + ![Thrust Over Time](ThrustCurve.png) More Data: %s -""" impulse table + +`readme auto generated` +""" impulse final_time table + +println(readme) write("readme.md", readme) \ No newline at end of file