Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upadded atmospheric drag + tests #343
Conversation
nikita-astronaut
added some commits
Apr 10, 2018
This comment has been minimized.
This comment has been minimized.
codecov
bot
commented
Apr 10, 2018
•
Codecov Report
@@ Coverage Diff @@
## master #343 +/- ##
==========================================
+ Coverage 81.55% 81.68% +0.13%
==========================================
Files 31 31
Lines 1496 1507 +11
Branches 115 115
==========================================
+ Hits 1220 1231 +11
Misses 248 248
Partials 28 28
Continue to review full report at Codecov.
|
Juanlu001
requested review from
Juanlu001
and
AunSiro
Apr 10, 2018
Juanlu001
requested changes
Apr 12, 2018
Overall this looks good, but I asked for more comments, your opinion on a minor API change, and some more details about the approximation. I didn't do the pen-and-paper myself, just looks like a big leap. |
|
||
# parameters of a circular orbit with h = 10 km | ||
h = 250 # km | ||
r0 = np.array([R + h, 0, 0]) # km |
This comment has been minimized.
This comment has been minimized.
k : float | ||
gravitational constant, (km^3/s^2) | ||
B: float | ||
ballistic coefficient B = C_D[] x A[m^2] / m[kg], (m^2 / kg) |
This comment has been minimized.
This comment has been minimized.
B: float | ||
ballistic coefficient B = C_D[] x A[m^2] / m[kg], (m^2 / kg) | ||
H0 : float | ||
the e-times density decay heigth, (km) |
This comment has been minimized.
This comment has been minimized.
Juanlu001
Apr 12, 2018
Member
Perhaps "atmospheric scale height" is more descriptive? (from utexas website)
C_D = 2.2 # dimentionless | ||
A = ((np.pi / 4.0) * (u.m**2)).to(u.km**2).value # km^2 | ||
m = 100 # kg | ||
B = C_D * A / m |
This comment has been minimized.
This comment has been minimized.
Juanlu001
Apr 12, 2018
Member
What do you think as having C_D and m as input instead of B? So we compute B inside the function
v0 = np.array([0, np.sqrt(k / (R + h)), 0]) # km/s | ||
|
||
# parameters of a body | ||
C_D = 2.2 # dimentionless |
This comment has been minimized.
This comment has been minimized.
Juanlu001
Apr 12, 2018
Member
Do these parameters matter for the test itself? Or any value would do?
This comment has been minimized.
This comment has been minimized.
orbit = Orbit.from_vectors(Earth, r0 * u.km, v0 * u.km / u.s) | ||
tof = 100000 # s | ||
|
||
dr_expected = -B * tof * rho0 * np.exp(-(norm(r0) - R) / H0) * np.sqrt(k * norm(r0)) |
This comment has been minimized.
This comment has been minimized.
Juanlu001
Apr 12, 2018
Member
This is related to the approximation trick you mention in the first comment I guess. Can we move that comment next to this line, and put * tof
at the end?
|
||
def test_atmospheric_drag(): | ||
# http://farside.ph.utexas.edu/teaching/celestial/Celestialhtml/node94.html#sair (10.148) | ||
# given the expression for \dot{a} / a, aproximate \Delta a \approx F_a * \Delta t |
This comment has been minimized.
This comment has been minimized.
nikita-astronaut
added some commits
Apr 12, 2018
Juanlu001
approved these changes
Apr 13, 2018
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Merged in 35a2c34. Thanks @nikita-astronaut! |
nikita-astronaut commentedApr 10, 2018
•
edited
Added atmospheric drag perturbation and tests. For links, see comments to the functions.