Skip to content

Commit

Permalink
test of branching
Browse files Browse the repository at this point in the history
  • Loading branch information
karnapp2 committed Jan 27, 2022
1 parent 75696d8 commit b40ed62
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions Simulation/6dof_sim.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
#TODO: Remove Constants from main file while double checking values and make sure everything still works
#TODO: Double check moment of Inertia values

#Adding this comment to test branching

#* Importing RasAero Package
rasaero = pd.read_csv("Simulation/Lookup/RASAero.csv")
# extracting the columns of interest
Expand Down Expand Up @@ -118,11 +120,11 @@ def drag_from_csv(z, velocity_body):
[0]]) # X, Y, Z

or_f = np.array([[0],
[0],
[0]]) # Yaw, Pitch, Roll
[np.radians(1.291)],
[np.radians(-0.0030712)]]) # Yaw, Pitch, Roll

vel_f = np.array([[constants.vx],
[constants.lateral_velocity],
[0],
[0]]) # Vx, Vy, Vz

angvel_f = np.array([[constants.yaw_rate],
Expand Down Expand Up @@ -159,6 +161,8 @@ def drag_from_csv(z, velocity_body):
Cd_list = []
for t in time:

print()

#* Velocity Conversions
# Rotation from fixed to body frame, Velocity converstion to the body frame
R_fb = rotation.yaw(or_f[0][0]) @ rotation.pitch(or_f[1][0]) @ rotation.roll(or_f[2][0])
Expand All @@ -181,6 +185,8 @@ def drag_from_csv(z, velocity_body):
# Calculate the reference area of the rocket
Sref_a, beta = rocket.sref(vel_b, l_rocket, D)

print(beta)

# Varying density function imported
rho = atmosphere.density(pos_f[0][0])

Expand All @@ -189,6 +195,8 @@ def drag_from_csv(z, velocity_body):

# calculating the sum of aerodynamic forces on the rocket body
v_mag = np.linalg.norm(vel_a)

Sref_a = np.pi*((D/2)**2)

F_a = -((rho* (v_mag**2) * Sref_a * Cd_total) / 2) * (vel_a/v_mag)
accel_a = F_a/m
Expand Down

0 comments on commit b40ed62

Please sign in to comment.