View Javadoc
1   /*
2    * Licensed to the Hipparchus project under one or more
3    * contributor license agreements.  See the NOTICE file distributed with
4    * this work for additional information regarding copyright ownership.
5    * The Hipparchus project licenses this file to You under the Apache License, Version 2.0
6    * (the "License"); you may not use this file except in compliance with
7    * the License.  You may obtain a copy of the License at
8    *
9    *      https://www.apache.org/licenses/LICENSE-2.0
10   *
11   * Unless required by applicable law or agreed to in writing, software
12   * distributed under the License is distributed on an "AS IS" BASIS,
13   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14   * See the License for the specific language governing permissions and
15   * limitations under the License.
16   */
17  
18  package org.hipparchus.ode.nonstiff;
19  
20  import org.junit.jupiter.api.Test;
21  
22  class ClassicalRungeKuttaIntegratorTest extends RungeKuttaIntegratorAbstractTest {
23  
24      protected FixedStepRungeKuttaIntegrator createIntegrator(double step) {
25          return new ClassicalRungeKuttaIntegrator(step);
26      }
27  
28      @Override
29      @Test
30      public void testMissedEndEvent() {
31          doTestMissedEndEvent(5.0e-6, 1.0e-9);
32      }
33  
34      @Override
35      @Test
36      public void testSanityChecks() {
37          doTestSanityChecks();
38      }
39  
40      @Override
41      @Test
42      public void testDecreasingSteps() {
43          doTestDecreasingSteps(1.0, 1.0, 1.0e-10);
44      }
45  
46      @Override
47      @Test
48      public void testSmallStep() {
49          doTestSmallStep(2.0e-13, 4.0e-12, 1.0e-12, "classical Runge-Kutta");
50      }
51  
52      @Override
53      @Test
54      public void testBigStep() {
55          doTestBigStep(0.0004, 0.005, 1.0e-12, "classical Runge-Kutta");
56  
57      }
58  
59      @Override
60      @Test
61      public void testBackward() {
62          doTestBackward(5.0e-10, 7.0e-10, 1.0e-12, "classical Runge-Kutta");
63      }
64  
65      @Override
66      @Test
67      public void testKepler() {
68          doTestKepler(5.82e-3, 1.0e-5);
69      }
70  
71      @Override
72      @Test
73      public void testStepSize() {
74          doTestStepSize(1.0e-12);
75      }
76  
77      @Override
78      @Test
79      public void testSingleStep() {
80          doTestSingleStep(9.3e-9);
81      }
82  
83      @Override
84      @Test
85      public void testTooLargeFirstStep() {
86          doTestTooLargeFirstStep();
87      }
88  
89      @Override
90      @Test
91      public void testUnstableDerivative() {
92          doTestUnstableDerivative(1.0e-12);
93      }
94  
95      @Override
96      @Test
97      public void testDerivativesConsistency() {
98          doTestDerivativesConsistency(1.0e-10);
99      }
100 
101     @Override
102     @Test
103     public void testSerialization() {
104         doTestSerialization(1017892, 5.5e-3);
105     }
106 
107     @Test
108     public void testSecondaryEquations() {
109         doTestSecondaryEquations(1.1e-12, 5.6e-13);
110     }
111 
112 }