@@ -6,15 +6,15 @@ describe('rungeKuttaStep', () => {
66 rungeKuttaStep ( 0 , 0.1 , 1 , function ( x , y ) {
77 return Math . sin ( x ) + y ;
88 } )
9- ) . toBeCloseTo ( 1.10517 , 5 ) ;
9+ ) . toBeCloseTo ( 1.10517 , 4 ) ;
1010 } ) ;
1111
1212 it ( 'should calculate the next y value correctly for exponential function' , ( ) => {
1313 expect (
1414 rungeKuttaStep ( 0.5 , 0.1 , 1 , function ( x , y ) {
1515 return Math . exp ( x ) - y ;
1616 } )
17- ) . toBeCloseTo ( 1.15233 , 5 ) ;
17+ ) . toBeCloseTo ( 1.15233 , 4 ) ;
1818 } ) ;
1919} ) ;
2020
@@ -25,12 +25,12 @@ describe('rungeKuttaFull', () => {
2525 return Math . sin ( x ) + y ;
2626 } )
2727 ) . toEqual ( [
28- { x : 0 , y : 1 } ,
29- { x : 0.2 , y : 1.22140 } ,
30- { x : 0.4 , y : 1.53659 } ,
31- { x : 0.6 , y : 1.95837 } ,
32- { x : 0.8 , y : 2.50487 } ,
33- { x : 1.0 , y : 3.20155 }
28+ { x : 0 , y : 1 } ,
29+ { x : 0.2 , y : 1.24273 } ,
30+ { x : 0.4 , y : 1.58248 } ,
31+ { x : 0.6 , y : 2.03817 } ,
32+ { x : 0.8 , y : 2.63124 } ,
33+ { x : 1.0 , y : 3.38648 }
3434 ] ) ;
3535 } ) ;
3636
@@ -40,11 +40,11 @@ describe('rungeKuttaFull', () => {
4040 return Math . exp ( - x ) * y ;
4141 } )
4242 ) . toEqual ( [
43- { x : 0 , y : 1 } ,
44- { x : 0.25 , y : 1.24238 } ,
45- { x : 0.5 , y : 1.51460 } ,
46- { x : 0.75 , y : 1.82186 } ,
47- { x : 1.0 , y : 2.16955 }
43+ { x : 0 , y : 1 } ,
44+ { x : 0.25 , y : 1.24757 } ,
45+ { x : 0.5 , y : 1.48211 } ,
46+ { x : 0.75 , y : 1.69491 } ,
47+ { x : 1 , y : 1.88159 }
4848 ] ) ;
4949 } ) ;
5050} ) ;
0 commit comments