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  
21  import org.hipparchus.CalculusFieldElement;
22  import org.hipparchus.Field;
23  import org.hipparchus.exception.MathIllegalArgumentException;
24  import org.hipparchus.exception.MathIllegalStateException;
25  import org.hipparchus.util.Binary64Field;
26  import org.junit.jupiter.api.Test;
27  
28  class LutherFieldIntegratorTest extends RungeKuttaFieldIntegratorAbstractTest {
29  
30      protected <T extends CalculusFieldElement<T>> FixedStepRungeKuttaFieldIntegrator<T>
31      createIntegrator(Field<T> field, T step) {
32          return new LutherFieldIntegrator<T>(field, step);
33      }
34  
35      @Override
36      @Test
37      public void testNonFieldIntegratorConsistency() {
38          doTestNonFieldIntegratorConsistency(Binary64Field.getInstance());
39      }
40  
41      @Override
42      @Test
43      public void testMissedEndEvent()
44          throws MathIllegalArgumentException, MathIllegalStateException {
45          doTestMissedEndEvent(Binary64Field.getInstance(), 1.0e-15, 1.0e-15);
46      }
47  
48      @Override
49      @Test
50      public void testSanityChecks()
51          throws MathIllegalArgumentException, MathIllegalStateException {
52          doTestSanityChecks(Binary64Field.getInstance());
53      }
54  
55      @Override
56      @Test
57      public void testDecreasingSteps()
58          throws MathIllegalArgumentException, MathIllegalStateException {
59          doTestDecreasingSteps(Binary64Field.getInstance(), 3.6, 1.0, 1.0e-10);
60      }
61  
62      @Override
63      @Test
64      public void testSmallStep()
65          throws MathIllegalArgumentException, MathIllegalStateException {
66          doTestSmallStep(Binary64Field.getInstance(), 8.7e-17, 3.6e-15, 1.0e-12, "Luther");
67      }
68  
69      @Override
70      @Test
71      public void testBigStep()
72          throws MathIllegalArgumentException, MathIllegalStateException {
73          doTestBigStep(Binary64Field.getInstance(), 2.7e-5, 1.7e-3, 1.0e-12, "Luther");
74      }
75  
76      @Override
77      @Test
78      public void testBackward()
79          throws MathIllegalArgumentException, MathIllegalStateException {
80          doTestBackward(Binary64Field.getInstance(), 2.4e-13, 4.3e-13, 1.0e-12, "Luther");
81      }
82  
83      @Override
84      @Test
85      public void testKepler()
86          throws MathIllegalArgumentException, MathIllegalStateException {
87          doTestKepler(Binary64Field.getInstance(), 2.18e-7, 4.0e-10);
88      }
89  
90      @Override
91      @Test
92      public void testStepSize()
93          throws MathIllegalArgumentException, MathIllegalStateException {
94          doTestStepSize(Binary64Field.getInstance(), 1.0e-22);
95      }
96  
97      @Override
98      @Test
99      public void testSingleStep() {
100         doTestSingleStep(Binary64Field.getInstance(), 6.0e-12);
101     }
102 
103     @Override
104     @Test
105     public void testTooLargeFirstStep() {
106         doTestTooLargeFirstStep(Binary64Field.getInstance());
107     }
108 
109     @Override
110     @Test
111     public void testUnstableDerivative() {
112         doTestUnstableDerivative(Binary64Field.getInstance(), 4.0e-15);
113     }
114 
115     @Override
116     @Test
117     public void testDerivativesConsistency() {
118         doTestDerivativesConsistency(Binary64Field.getInstance(), 1.0e-20);
119     }
120 
121     @Override
122     @Test
123     public void testPartialDerivatives() {
124         doTestPartialDerivatives(4.4e-13, new double[] { 2.3e-12, 5.6e-13, 9.5e-14, 9.5e-14, 5.6e-13 });
125     }
126 
127     @Test
128     public void testSecondaryEquations() {
129         doTestSecondaryEquations(Binary64Field.getInstance(), 1.0e-12, 5.6e-13);
130     }
131 
132 }