.getJacobianWrtCartesian() works in MATLAB api?

I want to get the Jacobian of the transformation Cartesian->Equinoctial , I guess the method that I should use is .getJacobianWrtCartesian(,) from the Orbit class, but as far as I know how to use the MATLAB api this doesn’t seem to work.

I create the matrix P as:
P = zeros(6,6);
Then I do:
orbitNF.getJacobianWrtCartesian(PositionAngle.MEAN,P)
Where orbitNF is an orbit created before. After runing this line I don’t get errors, but the matrix P does not change, so this is not how to use it in MATLAB right? I don’t know about java, but my guess is that this method is suppose to work with a java array to change it inside the method, and this does not work for MATLAB arrays…

Am I doing it wrong?

Thanks in advance.

Hi @astror

You can create java arrays in Matlab using javaArray method.
Please find more information in the following link: Construct Java array object - MATLAB javaArray

If orbitNF is an EquinoctialOrbit, the method getJacobianWrtCartesian will give you the derivatives of the equinoctial elements wrt to the cartesian elements.
If orbitNF is a CartesianOrbit, the previous method will give you an identity matrix. To obtain the derivatives of the cartesian elements wrt to the equinoctial elements, you shall use getJacobianWrtParameter method. But in this case orbitNF shall be an EquinoctialOrbit.

Best regards,
Bryan

Thank you for the reply. I was aware of the JavaArray in Matlab, but for some reason that doesn’t seem to work:


I get an incorrect argument error…

The orbit is indeed Equinoctial, and the first argument is correct (I think).

Thanks again for the help.

Hi @astror

Your parameters look good. I don’t understand why Matlab throw an error…
Could you check the type of orbitNF?
Also, the method expects a double[][] array, not a Double[][]. In Java I don’t think it is a problem, in Matlab maybe. Could you also check it?

Regards,
Bryan