• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java DormandPrince853Integrator类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了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;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java InstanceQuery类代码示例发布时间:2022-05-23
下一篇:
Java PackagingElementResolvingContext类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap