Is there a bug in PartialDerivativesEquations?


#1

In this source code of PartialDerivativesEquations,
https://www.orekit.org/projects/orekit/repository/revisions/c06ccf483b2e8beee2df832ce805a51e70e75899/entry/src/main/java/org/orekit/propagation/numerical/PartialDerivativesEquations.java

On line 334,
final Vector3D velocity = s.getPVCoordinates().getPosition();

I think it should be
final Vector3D velocity = s.getPVCoordinates().getVelocity();

Please let me know if I’m misunderstanding this.


#2

Hi @moonshot,

It does indeed look like a bug.
However it is an old version of the code of class PartialDerivativesEquations (the commit dates back to 2013).
The code is different now, and validated, see PartialDerivativesEquation class on develop branch.
The last version of Orekit (9.2) does not have the bug you are referring to.
Note that the Orekit forge is now on gitlab. The old redmine forge will be taken down soon.
Out of curiosity, which version of Orekit are you using ?

Have a good day,
Maxime


#3

Hi @MaximeJ,

Thank you for the prompt reply and your kind information.
I’m using 9.2 with Python Wrapper, and trying to figure out how to add additional equations to a numerical propagator on Python.
That’s why I’m looking into the PartialDerivativesEquation class.

Have a good day.
Yongjun


#4

That’s weird.
I had to go back to version 6.1 to find the bug you mentioned.
And it was fixed in version 7…

You should be good with version 9.2.
Maybe you just happened to run on this old version while searching on the web no ?

There is already a topic linked with additional equations and state transition matrix computation with the Python wrapper. See: Implementing a state transition matrix (STM) in python

Hope this helps.

Cheers,
Maxime


#5

Oh sorry for confusing you.
I was trying to check the algorithm used in the class, and happened to refer to the old one.

Thank you for helping me out.
I already saw that topic, and it was really helpful to understand how all this works, but what I want is to add user-defined equations to the propagator.

Yongjun


#6

Ok.
Then you’ll have to implement the interface AdditionalEquations in your code.

I’m not sure how to do that in Python though.
I’ve seen on the wrapper code here that some Orekit interfaces are implemented by Abstract classes in Java before the wrapping happens.
But I haven’t seen the AdditionalEquation equivalent Abstract class in here.
I wonder if we should not add it.

Hope someone more proficient in Python can help you on the forum!

Maxime


#7

Hi Maxime,

Im the maintainer of the Python wrapper and yes, there are today only a few classes that have Python “counterparts”, basically based of what I have needed/thought was useful so far :slight_smile: These are needed when you want to subclass java classes in python. I guess that the Additional Equations is such case and we should include it, it is not included today.

I will have a look.

Best Regards
/Petrus


#8

Thank you both @MaximeJ and @petrus.hyvonen for your kind help.

To Petrus:
Can you tell me when the Python “counterpart” of AdditonalEquations can be included?
Would it be the next release?
I desperately need it :joy:

Happy new year.
Yongjun


#9

Hi Yongjun,

I have AdditionalEquations working in a development version now, the test case from java is rewritten for python and works. My plan is to include it in next release (9.3).

If you need it before maybe I can give you a pre-release, are you using conda and in that case which platform?

Regards
/Petrus


#10

Hi @petrus.hyvonen,

Thank you for your help. I really appreciate it.
i’m using conda on Windows10.

Best regards,
Yongjun