Problems adding forces to numerical propagator

Hi everyony,

I’m trying to set up a numerical propagator in python to propagate the position of one of the Swarm satellites. I want to add a gravity perturbation and a simple exponential atmosphere. I’ve been following the example given for the python wrapper however the forces seem to have no effect on the resultant position. I’m wondering if I’ve added them correctly.

I’ve attached two snippets of my code where I add the forces.

Gravity:
ae = Constants.WGS84_EARTH_EQUATORIAL_RADIUS
f = Constants.WGS84_EARTH_FLATTENING

propagator_num = NumericalPropagator(integrator)
propagator_num.setOrbitType(orbitType)
propagator_num.setInitialState(initialState)

International Terrestrial Reference Frame, earth fixed

Earth = OneAxisEllipsoid(ae, f, EarthFrame)
gravityProvider = GravityFieldFactory.getNormalizedProvider(8, 8)
propagator_num.addForceModel(HolmesFeatherstoneAttractionModel(Earth.getBodyFrame(), gravityProvider))

Atmosphere:
refAlt = 400e3
density = 2e-12 # 1430.
hScale = .05
atmosphere = SimpleExponentialAtmosphere(Earth, refAlt, density, hScale)

dragForce = DRAG.DragForce(atmosphere, shape)
propagator_num.addForceModel(dragForce)

Thanks

Hi @elzbth,

Is it possible to know the initial orbit you are using for the propagation ?

Bryan

Hi,

I’m using a state vector to set the initial orbit.
Position = ( -3062.934930, -600.852230, -6097.336830)
Velocity = ( -65150.750000, -18314.650000, 34557.140000)

The position is given in km and the velocity in dm/s, which I’m converting into m and m/s respectively.
The state vector is also given in ITRF so I’ve converted into GCRF for the propagation.

Elizabeth

I plotted your orbit and the forces shall influence the resultant position. Your code looks good so it is difficult to find a problem. Is it possible to send us an executable code to do some tests ?

Thanks,
Bryan

Thank you for looking. I’ve realised the reason the gravity field was appearing to have no effect was a plotting issue rather than anything in the code.

I’m still not seeing a difference from adding the atmosphere but will check for more plotting errors before sharing the code.

Thank you

Hi @elzbth,

I think your error comes from your hScale in the exponential atmosphere model that is too low.

With hScale = 0.05, h0 = 400e3 and your initial orbit with an altitude h of about 472e3 m you get an atmospheric density of: rho = rho0 * exp((h0 - h) / hScale) = 0, because (h0 - h) / hScale ~ -1433751 and exp(-1433751) is very close to 0…
(See how the density is computed in SimpleExponentialAtmopshere).

So I suggest you put your scale to say 10000 (10km) to have a significant density and see some changes in your orbit.

Maxime

I agree with Maxime’s answer.

If you want an example on values to initialize the SimpleExponentialAtmosphere model you can have a look on the test class of this model.

Bryan

Thank you, I hadn’t thought to look at the scale height.

I’ll have a play around to see how it changes.