1
0
mirror of https://gitlab.com/lander-team/plots.git synced 2025-07-23 06:41:24 +00:00

CDR plots

This commit is contained in:
2021-09-19 20:20:39 -07:00
parent 1d5ea865ff
commit fc785f7751
10 changed files with 53 additions and 835 deletions

43
ThrustDef.jl Normal file
View File

@@ -0,0 +1,43 @@
using Plots
using Unitful
using UnitfulRecipes
using NumericalIntegration
theme(:juno)
rate = 180u"°/s"
max_deflection = 15u"°"
dt = 0.001u"s"
time = 0u"s":dt:2u"s"
angle = [(t * rate) % max_deflection for t in time]
v = cos.(angle) .* u"N"
h = sin.(angle) .* u"N"
horizontal_impulse = let
vimp = integrate(time, v)
himp = integrate(time, h)
round(himp / (vimp + himp) * 100) |> Int
end
let
plot(time, v, label = "Vertical")
plot!(time, h, label = "Horizontal")
yticks!(0:0.25:1, string.(0:25:100) .* "%")
ylabel!("Percent of Thrust")
xticks!(0:0.5:2, string.(0:0.5:2) .* "s")
xlabel!("Time")
title!(
"Max Deflection: $(max_deflection)\n" *
"Vertical Impulse: $(100-horizontal_impulse)% | Horizontal Impulse: $(horizontal_impulse)%",
)
end
savefig("ThrustDef.png")