Skip to content
Snippets Groups Projects
Commit e180262d authored by Christopher Rabotin's avatar Christopher Rabotin
Browse files

Merge branch '206-compare-nyx-eclipse-model-to-bsk' into 'master'

One minus fraction slightly decreases SRP error

Closes #206

See merge request !126
parents 2fea8cf4 5e76f593
No related branches found
No related tags found
1 merge request!126One minus fraction slightly decreases SRP error
Pipeline #315843829 passed
......@@ -16,9 +16,10 @@
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
pub use super::{Cosm, Frame, LTCorr, Orbit, Spacecraft};
pub use super::{Bodies, Cosm, Frame, LTCorr, Orbit, Spacecraft};
use crate::md::EventEvaluator;
use crate::time::{Duration, TimeUnit};
use crate::TimeTagged;
use std::cmp::{Eq, Ord, Ordering, PartialOrd};
use std::fmt;
use std::sync::Arc;
......@@ -335,7 +336,7 @@ pub fn eclipse_state(
// Compute the nominal area of the light source
let nominal_area = std::f64::consts::PI * r_ls_prime.powi(2);
// And return the percentage (between 0 and 1) of the eclipse.
EclipseState::Penumbra((nominal_area - shadow_area) / nominal_area)
EclipseState::Penumbra(1.0 - shadow_area / nominal_area)
} else {
// Annular eclipse.
// If r_eb_prime is very small, then the fraction is very small: however, we note a penumbra close to 1.0 as near full light source visibility, so let's subtract one from this.
......
......@@ -48,7 +48,7 @@ fn srp_earth_full_vis() {
let (err_r, err_v) = rss_orbit_vec_errors(&final_state.orbit.to_cartesian_vec(), &rslt);
println!(
"Error accumulated in full sunlight over {} : {:.3} m \t{:.3} m/s",
"Error accumulated in full sunlight over {} : {:.6} m \t{:.6} m/s",
prop_time,
err_r * 1e3,
err_v * 1e3
......@@ -58,7 +58,7 @@ fn srp_earth_full_vis() {
}
#[test]
fn srp_earth_penumbra() {
fn srp_earth_leo() {
let cosm = Cosm::de438_gmat();
let eme2k = cosm.frame("EME2000");
......@@ -98,7 +98,7 @@ fn srp_earth_penumbra() {
let (err_r, err_v) = rss_orbit_vec_errors(&final_state.orbit.to_cartesian_vec(), &rslt);
println!(
"Error accumulated in circular equatorial LEO (with penumbras) over {} : {:.3} m \t{:.3} m/s",
"Error accumulated in circular equatorial LEO (with penumbras) over {} : {:.6} m \t{:.6} m/s",
prop_time,
err_r * 1e3,
err_v * 1e3
......@@ -148,7 +148,7 @@ fn srp_earth_meo_ecc_inc() {
let (err_r, err_v) = rss_orbit_vec_errors(&final_state.orbit.to_cartesian_vec(), &rslt);
println!(
"Error accumulated in ecc+inc MEO (with penumbras) over {} : {:.3} m \t{:.3} m/s",
"Error accumulated in ecc+inc MEO (with penumbras) over {} : {:.6} m \t{:.6} m/s",
prop_time,
err_r * 1e3,
err_v * 1e3
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment