Can't get Orekit to work in Matlab

Hi,

You could try something like

import java.util.ArrayList;
forces = ArrayList;
forces.add(zonal);
forces.add(tesseral);

If you want to add these force models to the propagator, I recommend you to use directly .addForceModel(...) method of the propagator.

propagator.addForceModel(zonal);
propagator.addForceModel(tesseral);

Bryan

Well,this answer is very useful for me. :laughing:

I had trouble piecing together everything and getting it updated to current Orekit (12.0.1), so I’ve created Set up Orekit in Matlab ($3643444) · Snippets · GitLab, which I hope will help others coming to this thread.

1 Like

Hi all,

I am new to working with Orekit using Matlab and I am encountering some issues that I am not able to solve, even with the explanations provided above.

I am attempting to execute the first example provided in Orekit’s API (Orekit Tutorials – Propagation), but Matlab is encountering errors that I do not understand. I believe that the locations of the Java and Orekit files are correct on my computer.

Having said that, one of the errors that Matlab is encountering is in the following lines:

’ import org.orekit.time.TimeScalesFactory
utc = TimeScalesFactory.getUTC();’

The error is:

'Error using orbita_basica_propagacion (line 19)
Java exception occurred:
org.orekit.errors.OrekitException: Historical IERSD UTC-TAI
data not loaded
at
org.orekit.time.LazyLoadedTimeScales.getUTC(LazyLoadedTimeScales.java:188)

at
org.orekit.time.TimeScalesFactory.getUTC(TimeScalesFactory.java:130)’

I appreciate your assistance with this.

Juanlu"

Hi @Juan_Luis

You have this error because the orekit-data were not loaded.
Did you downloaded the orekit-data? (Orekit / Orekit Data · GitLab)

Also, the tutorial doesn’t explain how to initialize them. Could you try to add the following lines:

DM=org.orekit.data.DataContext.getDefault().getDataProvidersManager(); %Works for v11.1
crawler = org.orekit.data.DirectoryCrawler(File(['c:\Your\Path\To\The\Unzipped\orekit-data-master\']));
DM.clearProviders()
DM.addProvider(crawler)