[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Orekit Users] Use DSST in orekit-7.0 from Matlab
- To: "orekit-users@orekit.org" <orekit-users@orekit.org>
- Subject: Re: [Orekit Users] Use DSST in orekit-7.0 from Matlab
- From: Christophe Le Bris <chris.lebris@gmail.com>
- Date: Wed, 4 Feb 2015 10:12:25 +0100
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=HNK+isBd5c1JjNDbG1qxWPO3kE707OHENM+b/bnnLt8=; b=Yq3j8WZxN+RZHbuqPtflwTGh2erZS+s7aFrcfw03iAFvS1IZ1Ay6avprbCibPzskW1 WLxvGBBBXfDsletX2qCFIWXoXqKGGv8O0qqqrN4UiEjHlWrSUEh6igCllIar6BxrHyQt 8fAfFI18IaCAAWvrbWTrVaExpARVPj1mFNe9WVkCu1enq95TW0slPy2MgarYwkEYuxSy qb8khkXXGGEcA6r1Hfqzfs/fKF633l2d8ZqyVcz1ggByjpZXAC3BdMJc7eyJl5ZoFlJu BTnUPpwT833WFDv5rSzzfNdyP1XCGo20Y2SOpMbNT9DKRtk5PHNr73+f06mG00wwEKEs +AJw==
- In-reply-to: <4261c190.kqhkiG.14b53db2e64@gmail.com>
- References: <4261c190.kqhkiG.14b53db2e64@gmail.com>
Sorry, the attachment was missing...
function testDSST()
% do the imports
import org.orekit.bodies.*
import org.orekit.forces.gravity.*
import org.orekit.forces.gravity.potential.*
import org.orekit.frames.*
import org.orekit.orbits.*
import org.orekit.propagation.conversion.*
import org.orekit.propagation.semianalytical.dsst.*
import org.orekit.propagation.semianalytical.dsst.forces.*
import org.orekit.propagation.SpacecraftState
import org.orekit.data.*
import org.orekit.time.*
import org.orekit.utils.Constants
initialOrbit = [ 7152e3, 0.00126, 86.4*pi/180, pi/2, 0, 0 ];
%% Configure Orekit
DM = DataProvidersManager.getInstance();
crawler = ZipJarCrawler('orekit-data.zip');
DM.clearProviders();
DM.addProvider(crawler);
%% configure propagator
% Set frames
inertialFrame = FramesFactory.getEME2000();
rotatingFrame = CelestialBodyFactory.getEarth().getBodyOrientedFrame();
% prepare gravity force model
GravityFieldFactory.clearPotentialCoefficientsReaders();
GravityFieldFactory.addPotentialCoefficientsReader(ICGEMFormatReader('eigen-6s.gfc', true));
gravityProvider = GravityFieldFactory.getUnnormalizedProvider(30, 30);
sun = CelestialBodyFactory.getSun();
moon = CelestialBodyFactory.getMoon();
% Build orbit
epoch = AbsoluteDate(2014, 1, 1, 14, 10, 00, TimeScalesFactory.getUTC());
orbit = KeplerianOrbit(initialOrbit(1), initialOrbit(2), initialOrbit(3), ...
initialOrbit(5), initialOrbit(4), initialOrbit(6), ...
PositionAngle.MEAN, inertialFrame, epoch, gravityProvider.getMu());
% Build propagator
minStep = orbit.getKeplerianPeriod() * 0.1;
maxStep = orbit.getKeplerianPeriod() * 10.0;
integBuilder = DormandPrince853IntegratorBuilder(minStep, maxStep, 0.001);
integrator = integBuilder.buildIntegrator(EquinoctialOrbit(orbit));
integrator.setInitialStepSize(orbit.getKeplerianPeriod() * 1.0);
prop = DSSTPropagator(integrator, false); % osculating output orbit
prop.setMu(gravityProvider.getMu())
% add needed force models
prop.addForceModel(DSSTCentralBody(rotatingFrame, Constants.WGS84_EARTH_ANGULAR_VELOCITY, gravityProvider));
% sun
prop.addForceModel(DSSTThirdBody(sun));
% moon
prop.addForceModel(DSSTThirdBody(moon));
prop.setInitialState(SpacecraftState(orbit), false); % initial orbit is mean elements
finalState = prop.propagate(epoch.shiftedBy(86400 * 10));
fprintf('epoch : %s\n', char(finalState.getOrbit().getDate().toString()));
fprintf('orbital parameters:\n%s\n', char(finalState.getOrbit().toString()));
end