You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is there a units problem in the equations for calculating drag force (e.g. code)?
From looking at other force calculations in the repo that use the same ForceModel trait, I can see that they are returning 10^-3 * Newtons. E.g. for solar pressure it looks like the equation has (10^-3 * m^2 * N * m^-2)
Similarly for the gravitational acceleration if we multiply by mass (I suppose kg, as that seems conventional to other parts of the repo), we derive the units (kg * km * s^-2) => (kg * 10^-3 * m * s^-2) => (10^-3 * N).
For the aforementioned drag equation though, it looks like the units of the equation in existing code are (kg * m^-3 * m^2 * km^2 * s^-2), which resolves to ((kg * km^2 * s^-2) / m^1), which doesn't equal the others. It seems like it might be appropriate to multiply the equation out by 10^3 here, which would give ((kg * km^2 * s^-2) / (m^1 * 10^-3)) => (kg * km * s^-2) => (10^-3 * N), which is consistent with the other forces.
Thoughts? Happy to open a PR to change this.
The text was updated successfully, but these errors were encountered:
I think you're absolutely correct. The drag models have not been validated as the other models have, in part because I have worked only on cislunar missions for 7-8 years now, but also because these models are much simpler than the ones I could find in other trustworthy software. If you have a verification case you could add, that would be even better, but if you don't , I totally understand.
Yes, please open a PR with the unit changes. I expect that you'll need to update the associated regression test. Ticket #86 still needs quite some work, so I'll be sure to update that branch to whatever is on master before merging. That branch adds a lot of breaking changes though, and I'll be happy to guide you through updating your code base once it's merged.
Hello there,
Is there a units problem in the equations for calculating drag force (e.g. code)?
From looking at other force calculations in the repo that use the same
ForceModel
trait, I can see that they are returning10^-3 * Newtons
. E.g. for solar pressure it looks like the equation has (10^-3 * m^2 * N * m^-2
)Similarly for the gravitational acceleration if we multiply by mass (I suppose
kg
, as that seems conventional to other parts of the repo), we derive the units(kg * km * s^-2) => (kg * 10^-3 * m * s^-2) => (10^-3 * N)
.For the aforementioned drag equation though, it looks like the units of the equation in existing code are
(kg * m^-3 * m^2 * km^2 * s^-2)
, which resolves to((kg * km^2 * s^-2) / m^1)
, which doesn't equal the others. It seems like it might be appropriate to multiply the equation out by10^3
here, which would give((kg * km^2 * s^-2) / (m^1 * 10^-3)) => (kg * km * s^-2) => (10^-3 * N)
, which is consistent with the other forces.Thoughts? Happy to open a PR to change this.
The text was updated successfully, but these errors were encountered: