How to output esteemed value for propagator parameter

Hello everyone!!

Here is my first guess for the orbit:

estimated_orbit
Out: <KeplerianOrbit: Keplerian parameters: {a: 7109685.579058452; e: 0.05165954081218935; i: 82.87954617400177; pa: 164.5859763636075; raan: -19.65158612026566; v: -112.00811071522848;}>

Propagator builder using only SRP with reflection parameter driver

def InitiatePropagator(sat_orbit, sat_cs, sat_cr, sat_cd, sat_mass):
    minStep = 0.0001
    maxStep = 100.0
    pos_error = 10.0 
    estimator_position_scale = 200.0 

    ECI = FramesFactory.getGCRF()
    ECEF = FramesFactory.getITRF(IERSConventions.IERS_2010, True)
    
    integratorBuilder = DormandPrince853IntegratorBuilder(minStep, maxStep, pos_error)
    propagatorBuilder = NumericalPropagatorBuilder(sat_orbit, integratorBuilder, PositionAngle.TRUE, 
                                               estimator_position_scale)

    wgs84Ellipsoid = ReferenceEllipsoid.getWgs84(ECEF)
    nadirPointing = NadirPointing(ECI, wgs84Ellipsoid)
    
    propagatorBuilder.setMass(sat_mass)
    propagatorBuilder.setAttitudeProvider(nadirPointing)

    sun = CelestialBodyFactory.getSun()

    initial_value = 1.5
    scale_factor = 0.1
    lower_bound = 1.0
    upper_bound = 2.0
 
    isotropicRadiationSingleCoeff = IsotropicRadiationSingleCoefficient(float(sat_cs), initial_value)
    solarRadiationPressure = SolarRadiationPressure(sun, wgs84Ellipsoid.getEquatorialRadius(), isotropicRadiationSingleCoeff)

    reflection_param = solarRadiationPressure.getParametersDrivers().get(0)
    reflection_param.setMinValue(lower_bound)
    reflection_param.setMaxValue(upper_bound)
    reflection_param.setReferenceValue(initial_value)
    reflection_param.setScale(scale_factor)
    #solarRadiationPressure.getParametersDrivers().get(0).setValue(reflection_param_driver.getValue())
    reflection_param.setSelected(True)

    propagatorBuilder.addForceModel(solarRadiationPressure)

    return propagatorBuilder

The result:

  Keplerian parameters: {a: 7110719.016969134; e: 0.051659540569060816; i: 82.88066809996866; pa: 164.5920515366339; raan: -19.642713172640807; v: -112.00554767652018;}

If we will comment the line reflection_param.setSelected(True), assuming constant reflection parameter, we will get:

  Keplerian parameters: {a: 7110205.793738257; e: 0.0516595405681234; i: 82.88049050274775; pa: 164.66870483608807; raan: -19.643310027146203; v: -112.08254398956986;}

That can only mean that reflection parameter was esteemed by BatchLS method (everything else stayed unchanged in the script). But trying to get esteemed value, I only get empty List:

estimated_params = estimator.getPropagatorParametersDrivers(True)

estimated_params.getDrivers()
Out: <List: []>

Meanwhile

estimated_params = estimator.getPropagatorParametersDrivers(False)

estimated_params.getDrivers()
Out[61]: <List: [Moon attraction coefficient = 4.902800118457551E12, Sun attraction coefficient = 1.3271244004127946E20, central attraction coefficient = 3.986004415E14, drag coefficient = 1.0, reflection coefficient = 1.5]>

BatchLS thinks that reflection parameter wasn’t estimating. Any thoughts??

Is there only one estimation has to be for the whole measurements list or one for every measurement??

P.S. using the same script but with Kalman filter does not show differences between reflection_param.setSelected(True) and reflection_param.setSelected(False) cases. What may be the reason for that??

Hi @daiana,

That is weird, I can’t tell what’s happening.

If you look at the estimation tutorials, you will see that estimator.getPropagatorParametersDrivers(true) is indeed used to get the estimated propagation parameters and display their changes during the estimation process.
And it used to work… so maybe you found a bug but I’m not 100% sure.

For investigation purposes, could you please send us a self-contained runnable example exhibiting the problematic behavior?

Cheers,
Maxime

Sure!! Here is the full code:

BatchLSBug (15.0 KB)
new_20230823_10122_20744.RES (1.7 KB)

Thanks @daiana,

So I’ve run your code and placed two breakpoints in it:

  1. l.381, just before estimation
  2. l.383, just after estimation

For both I tested the command:

estimator.getPropagatorParametersDrivers(True).getDrivers().get(0)

And this gives me:

  1. <ParameterDriversList$DelegatingDriver: reflection coefficient = 1.5>
  2. <ParameterDriversList$DelegatingDriver: reflection coefficient = 1.0>

So the reflection coefficient is in the list of selected propagator drivers, it is estimated and its value has changed from 1.5 to 1.0.

I’m confused :sweat_smile:, wasn’t that what was supposed to “not” work in the first place?

Everything’s really working now. Apparently I just mixed up the runs, so I got an empty list for ParametersDrivers for the run when reflection parameter wasn’t really estimating.

Anyway thanks for the help!!

By the way, as a result, do we get the average estimated value for all measurements?? When estimating, we get only one orbit, this is clear, but shouldn’t this parameter be different for each individual measurement??

For a batch least-square no, you will get a single estimation of the parameter for the whole batch of measurements (with some special cases…).
For the Kalman yes, you will get one estimation of the parameter per measurement (or group of measurements)