本文整理汇总了Java中org.apache.commons.math3.ode.nonstiff.DormandPrince853Integrator类的典型用法代码示例。如果您正苦于以下问题:Java DormandPrince853Integrator类的具体用法?Java DormandPrince853Integrator怎么用?Java DormandPrince853Integrator使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DormandPrince853Integrator类属于org.apache.commons.math3.ode.nonstiff包,在下文中一共展示了DormandPrince853Integrator类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: MultistepIntegrator
import org.apache.commons.math3.ode.nonstiff.DormandPrince853Integrator; //导入依赖的package包/类
/**
* Build a multistep integrator with the given stepsize bounds.
* <p>The default starter integrator is set to the {@link
* DormandPrince853Integrator Dormand-Prince 8(5,3)} integrator with
* some defaults settings.</p>
* <p>
* The default max growth factor is set to a quite low value: 2<sup>1/order</sup>.
* </p>
* @param name name of the method
* @param nSteps number of steps of the multistep method
* (excluding the one being computed)
* @param order order of the method
* @param minStep minimal step (must be positive even for backward
* integration), the last step can be smaller than this
* @param maxStep maximal step (must be positive even for backward
* integration)
* @param vecAbsoluteTolerance allowed absolute error
* @param vecRelativeTolerance allowed relative error
*/
protected MultistepIntegrator(final String name, final int nSteps,
final int order,
final double minStep, final double maxStep,
final double[] vecAbsoluteTolerance,
final double[] vecRelativeTolerance) {
super(name, minStep, maxStep, vecAbsoluteTolerance, vecRelativeTolerance);
starter = new DormandPrince853Integrator(minStep, maxStep,
vecAbsoluteTolerance,
vecRelativeTolerance);
this.nSteps = nSteps;
exp = -1.0 / order;
// set the default values of the algorithm control parameters
setSafety(0.9);
setMinReduction(0.2);
setMaxGrowth(FastMath.pow(2.0, -exp));
}
开发者ID:biocompibens,项目名称:SME,代码行数:39,代码来源:MultistepIntegrator.java
示例2: test
import org.apache.commons.math3.ode.nonstiff.DormandPrince853Integrator; //导入依赖的package包/类
public double test(int integratorType)
throws DimensionMismatchException, NumberIsTooSmallException,
MaxCountExceededException, NoBracketingException {
double e = 1e-15;
FirstOrderIntegrator integrator;
integrator = (integratorType == 1)
? new DormandPrince853Integrator(e, 100.0, 1e-7, 1e-7)
: new GraggBulirschStoerIntegrator(e, 100.0, 1e-7, 1e-7);
PegasusSolver rootSolver = new PegasusSolver(e, e);
integrator.addEventHandler(new Event(), 0.1, e, 1000, rootSolver);
double t0 = 6.0;
double tEnd = 10.0;
double[] y = {2.0, 2.0, 2.0, 4.0, 2.0, 7.0, 15.0};
return integrator.integrate(new Ode(), t0, y, tEnd, y);
}
开发者ID:Quanticol,项目名称:CARMA,代码行数:16,代码来源:ReappearingEventTest.java
示例3: createPropagator
import org.apache.commons.math3.ode.nonstiff.DormandPrince853Integrator; //导入依赖的package包/类
private Propagator createPropagator(BodyShape earth,
NormalizedSphericalHarmonicsProvider gravityField,
Orbit orbit)
throws OrekitException {
AttitudeProvider yawCompensation = new YawCompensation(orbit.getFrame(), new NadirPointing(orbit.getFrame(), earth));
SpacecraftState state = new SpacecraftState(orbit,
yawCompensation.getAttitude(orbit,
orbit.getDate(),
orbit.getFrame()),
1180.0);
// numerical model for improving orbit
OrbitType type = OrbitType.CIRCULAR;
double[][] tolerances = NumericalPropagator.tolerances(0.1, orbit, type);
DormandPrince853Integrator integrator =
new DormandPrince853Integrator(1.0e-4 * orbit.getKeplerianPeriod(),
1.0e-1 * orbit.getKeplerianPeriod(),
tolerances[0], tolerances[1]);
integrator.setInitialStepSize(1.0e-2 * orbit.getKeplerianPeriod());
NumericalPropagator numericalPropagator = new NumericalPropagator(integrator);
numericalPropagator.addForceModel(new HolmesFeatherstoneAttractionModel(earth.getBodyFrame(), gravityField));
numericalPropagator.addForceModel(new ThirdBodyAttraction(CelestialBodyFactory.getSun()));
numericalPropagator.addForceModel(new ThirdBodyAttraction(CelestialBodyFactory.getMoon()));
numericalPropagator.setOrbitType(type);
numericalPropagator.setInitialState(state);
numericalPropagator.setAttitudeProvider(yawCompensation);
return numericalPropagator;
}
开发者ID:CS-SI,项目名称:Rugged,代码行数:31,代码来源:RuggedBuilderTest.java
示例4: createPropagator
import org.apache.commons.math3.ode.nonstiff.DormandPrince853Integrator; //导入依赖的package包/类
private Propagator createPropagator(BodyShape earth,
NormalizedSphericalHarmonicsProvider gravityField,
Orbit orbit)
throws OrekitException {
AttitudeProvider yawCompensation = new YawCompensation(orbit.getFrame(), new NadirPointing(orbit.getFrame(), earth));
SpacecraftState state = new SpacecraftState(orbit,
yawCompensation.getAttitude(orbit,
orbit.getDate(),
orbit.getFrame()),
1180.0);
// numerical model for improving orbit
OrbitType type = OrbitType.CIRCULAR;
double[][] tolerances = NumericalPropagator.tolerances(0.1, orbit, type);
DormandPrince853Integrator integrator =
new DormandPrince853Integrator(1.0e-4 * orbit.getKeplerianPeriod(),
1.0e-1 * orbit.getKeplerianPeriod(),
tolerances[0], tolerances[1]);
integrator.setInitialStepSize(1.0e-2 * orbit.getKeplerianPeriod());
NumericalPropagator numericalPropagator = new NumericalPropagator(integrator);
numericalPropagator.addForceModel(new HolmesFeatherstoneAttractionModel(earth.getBodyFrame(), gravityField));
numericalPropagator.addForceModel(new ThirdBodyAttraction(CelestialBodyFactory.getSun()));
numericalPropagator.addForceModel(new ThirdBodyAttraction(CelestialBodyFactory.getMoon()));
numericalPropagator.setOrbitType(type);
numericalPropagator.setInitialState(state);
numericalPropagator.setAttitudeProvider(yawCompensation);
return numericalPropagator;
}
开发者ID:CS-SI,项目名称:Rugged,代码行数:31,代码来源:RoughVisibilityEstimatorTest.java
示例5: createPropagator
import org.apache.commons.math3.ode.nonstiff.DormandPrince853Integrator; //导入依赖的package包/类
public static Propagator createPropagator(BodyShape earth,
NormalizedSphericalHarmonicsProvider gravityField,
Orbit orbit)
throws OrekitException {
AttitudeProvider yawCompensation = new YawCompensation(orbit.getFrame(), new NadirPointing(orbit.getFrame(), earth));
SpacecraftState state = new SpacecraftState(orbit,
yawCompensation.getAttitude(orbit,
orbit.getDate(),
orbit.getFrame()),
1180.0);
// numerical model for improving orbit
OrbitType type = OrbitType.CIRCULAR;
double[][] tolerances = NumericalPropagator.tolerances(0.1, orbit, type);
DormandPrince853Integrator integrator =
new DormandPrince853Integrator(1.0e-4 * orbit.getKeplerianPeriod(),
1.0e-1 * orbit.getKeplerianPeriod(),
tolerances[0], tolerances[1]);
integrator.setInitialStepSize(1.0e-2 * orbit.getKeplerianPeriod());
NumericalPropagator numericalPropagator = new NumericalPropagator(integrator);
numericalPropagator.addForceModel(new HolmesFeatherstoneAttractionModel(earth.getBodyFrame(), gravityField));
numericalPropagator.addForceModel(new ThirdBodyAttraction(CelestialBodyFactory.getSun()));
numericalPropagator.addForceModel(new ThirdBodyAttraction(CelestialBodyFactory.getMoon()));
numericalPropagator.setOrbitType(type);
numericalPropagator.setInitialState(state);
numericalPropagator.setAttitudeProvider(yawCompensation);
return numericalPropagator;
}
开发者ID:CS-SI,项目名称:Rugged,代码行数:31,代码来源:TestUtils.java
示例6: test
import org.apache.commons.math3.ode.nonstiff.DormandPrince853Integrator; //导入依赖的package包/类
/** Test for events that occur at the exact same time, but due to numerical
* calculations occur very close together instead.
* @param eventType the type of events to use. See
* {@link org.apache.commons.math3.ode.events.EventHandler#g(double, double[])
* EventHandler.g(double, double[])}.
*/
public void test(int eventType)
throws DimensionMismatchException, NumberIsTooSmallException,
MaxCountExceededException, NoBracketingException {
double e = 1e-15;
FirstOrderIntegrator integrator = new DormandPrince853Integrator(e, 100.0, 1e-7, 1e-7);
BaseSecantSolver rootSolver = new PegasusSolver(e, e);
EventHandler evt1 = new Event(0, eventType);
EventHandler evt2 = new Event(1, eventType);
integrator.addEventHandler(evt1, 0.1, e, 999, rootSolver);
integrator.addEventHandler(evt2, 0.1, e, 999, rootSolver);
double t = 0.0;
double tEnd = 10.0;
double[] y = {0.0, 0.0};
List<Double> events1 = new ArrayList<Double>();
List<Double> events2 = new ArrayList<Double>();
while (t < tEnd) {
t = integrator.integrate(this, t, y, tEnd, y);
//System.out.println("t=" + t + ",\t\ty=[" + y[0] + "," + y[1] + "]");
if (y[0] >= 1.0) {
y[0] = 0.0;
events1.add(t);
//System.out.println("Event 1 @ t=" + t);
}
if (y[1] >= 1.0) {
y[1] = 0.0;
events2.add(t);
//System.out.println("Event 2 @ t=" + t);
}
}
Assert.assertEquals(EVENT_TIMES1.length, events1.size());
Assert.assertEquals(EVENT_TIMES2.length, events2.size());
for(int i = 0; i < EVENT_TIMES1.length; i++) {
Assert.assertEquals(EVENT_TIMES1[i], events1.get(i), 1e-7);
}
for(int i = 0; i < EVENT_TIMES2.length; i++) {
Assert.assertEquals(EVENT_TIMES2[i], events2.get(i), 1e-7);
}
//System.out.println();
}
开发者ID:Quanticol,项目名称:CARMA,代码行数:47,代码来源:OverlappingEventsTest.java
示例7: DormandPrince853Solver
import org.apache.commons.math3.ode.nonstiff.DormandPrince853Integrator; //导入依赖的package包/类
public DormandPrince853Solver(final double minStep, final double maxStep, final double scalAbsoluteTolerance,
final double scalRelativeTolerance, final GamaMap<String, IList<Double>> integrated_val) {
super((minStep + maxStep) / 2,
new DormandPrince853Integrator(minStep, maxStep, scalAbsoluteTolerance, scalRelativeTolerance),
integrated_val);
}
开发者ID:gama-platform,项目名称:gama,代码行数:7,代码来源:DormandPrince853Solver.java
注:本文中的org.apache.commons.math3.ode.nonstiff.DormandPrince853Integrator类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论