Force depending on attitude

Hi guys, I couldn’t find similar examples, but really need some because of my low programming skills :), so there is probably a trivial question. What is the way to make some force model depending on current attitude? Or, in general, to make a custom force model which then can be added to a numerical propagator along other forcemodels? I hope not to bother much with such noob question, so just a reference to a similar example would be very appreciated! Specifically, the idea is to model nongravitational forces in a more compex way considering attitude (predefined, and a TabulatedProvider is already understood and realised). The satellite has a given box-like shape with known surface normals in a satellite frame. Facets have different (known) reflection properties. I know theoretical expressions which allow to calculate radiation force on such object depending on orientation. Also the area of cross-section for drag changes and can be calculated too. The only thing is to code that properly, and it would be very helpful to get directions how to start. Thank you for your time!

Just look at SolarRadiationPressure and DragForce for examples. The satellite model is defined using a RadiationSensitive interface for the first force model and a DragSensitive interface for the second force model. The most complete implementation of both interface is BoxAndSolarArraySpacecraft which considers any number of facets with different orientations (fixed or moving for solar arrays), different areas and different reflection and drag properties.

When SolarRadiationPressureandDragForceis used by the numerical propagator, it calls theiraccelerationmethod and provides aSpacecraftStateas the argument. ThisSpacecraftStatecontains the attitude so the force models knows how to compute the facts orientations with respect to incoming flux and compute the acceleration in the same inertial frame that was also embedded in theSpacecraftState`.

One additional note: the BoxAndSolarArraySpacecraft class has changed API between 11.X and the current development version. The previous versions used only one set of reflection/drag coefficients that applied to all facets. Per facet coefficients have been introduced a few weeks ago as part of implementing issue 989. This will be published with Orekit 12.0 which is currently under development.

Thank you @luc! Actually I have been looking at the BoxAndSolarArraySpacecraft class before and saw that all facets share the same reflection properties, and that was one of the main points of my interest. I’m glad to hear that you’ll be adding more generality into it! Another thing was that I didn’t realize the ability of the acceleration method to compute effective cross-section area at a given instant. As far as I understand now - the dependence on the attitude for the areas and orientation of the normal vectors are taken into account for drag and pressure computation? Then I have a couple of follow-up questions.

  1. When I set up Facet(Vector3D normal, double area),
    what is the proper declaration for that ‘normal’? Do I put it as it is in a satellite frame, and then the attitide provider will transform it whenever necessary?
  2. Meanwhile, if I want to implement different reflection and drag on different facets, would it be acceptable to define, for example, 3 BoxAndSolarArraySpacecraft objects with 2 facets each sharing the same reflection and drag, and then to construct 3 separate force models for them?
  3. If there are no solar panels - isn’t the most computationally effective constructor version is like
    BoxAndSolarArraySpacecraft(BoxAndSolarArraySpacecraft.Facet[] facets,
    PVCoordinatesProvider sun,
    double solarArrayArea = 0.0,
    Vector3D solarArrayAxis = Vector3D.ZERO,
    AbsoluteDate referenceDate,
    Vector3D referenceNormal = Vector3D.ZERO,
    double rotationRate = 0.0,
    double dragCoeff,
    double liftRatio,
    double absorptionCoeff,
    double reflectionCoeff)
    to avoid calculations of the solar panels orientation?
    Thank you very much for your time and help!


YEs, you should put it in spacecraft frame

I never thought about such a trick, but it should work as accelerations are additive

I am not sure you can avoid this computation (I don’t have the code on my screen right now), but anyway it is a simple computation, just a few vector operations, it is negligible with respect to other force models like Earth attraction.

Thank you @luc, that really helps! As for making a new custom force model (just to get more understanding how it works) please let me know if your remember an example of the code somewhere. Thanks again!

The existing force models are the proper examples.
When you build your own force model, from the numerical propagator point of view, it is not different from a force model provided by the library. You just have to implement the ForceModel interface, and you may decide to do this by extending the AbstractForceModel class. So just look at SolarRadiationPressure or DragForce

Okay, I see. Thanks again @luc!