134{
136
137
138
140 b31 = 3.0/40.0, b32 = 9.0/40.0 ,
141
142 b41 = 44.0/45.0, b42 = -56.0/15.0, b43 = 32.0/9.0,
143
144 b51 = 19372.0/6561.0, b52 = -25360.0/2187.0,
145 b53 = 64448.0/6561.0, b54 = -212.0/729.0 ,
146
147 b61 = 9017.0/3168.0 , b62 = -355.0/33.0,
148 b63 = 46732.0/5247.0 , b64 = 49.0/176.0 ,
149 b65 = -5103.0/18656.0 ,
150
151 b71 = 35.0/384.0, b72 = 0.,
152 b73 = 500.0/1113.0, b74 = 125.0/192.0,
153 b75 = -2187.0/6784.0, b76 = 11.0/84.0,
154
155
156
157
158
159
160 dc1 = b71 - 5179.0/57600.0,
161 dc2 = b72 - .0,
162 dc3 = b73 - 7571.0/16695.0,
163 dc4 = b74 - 393.0/640.0,
164 dc5 = b75 + 92097.0/339200.0,
165 dc6 = b76 - 187.0/2100.0,
166 dc7 = - 1.0/40.0 ;
167
169
170
171
172
173 for(i=0; i<numberOfVariables; ++i)
174 {
175 yIn[i] = yInput[i];
176 fInitialDyDx[i] = dydx[i];
177 }
178
179
180 yOut[7] = yTemp[7] = yInput[7];
181
182
183 for(i=0; i<numberOfVariables; ++i)
184 {
185 yTemp[i] = yIn[i] + b21*Step*fInitialDyDx[i] ;
186 }
188
189 for(i=0; i<numberOfVariables; ++i)
190 {
191 yTemp[i] = yIn[i] + Step*(b31*fInitialDyDx[i] + b32*ak2[i]) ;
192 }
194
195 for(i=0; i<numberOfVariables; ++i)
196 {
197 yTemp[i] = yIn[i] + Step*(b41*fInitialDyDx[i]
198 + b42*ak2[i] + b43*ak3[i]) ;
199 }
201
202 for(i=0; i<numberOfVariables; ++i)
203 {
204 yTemp[i] = yIn[i] + Step*(b51*fInitialDyDx[i]
205 + b52*ak2[i] + b53*ak3[i] + b54*ak4[i]) ;
206 }
208
209 for(i=0; i<numberOfVariables; ++i)
210 {
211 yTemp[i] = yIn[i] + Step*(b61*fInitialDyDx[i] + b62*ak2[i]
212 + b63*ak3[i] + b64*ak4[i] + b65*ak5[i]) ;
213 }
215
216 for(i=0; i<numberOfVariables; ++i)
217 {
218 yOut[i] = yIn[i] + Step*(b71*fInitialDyDx[i] + b72*ak2[i] + b73*ak3[i]
219 + b74*ak4[i] + b75*ak5[i] + b76*ak6[i]);
220 }
222
223 for(i=0; i<numberOfVariables; ++i)
224 {
225
226 yErr[i] = Step*(dc1*fInitialDyDx[i] + dc2*ak2[i] + dc3*ak3[i]
227 + dc4*ak4[i] + dc5*ak5[i] + dc6*ak6[i] + dc7*ak7[i] ) ;
228
229
230
231 fLastInitialVector[i] = yIn[i] ;
232 fLastFinalVector[i] = yOut[i];
233 fLastDyDx[i] = fInitialDyDx[i];
234 nextDydx[i] = ak7[i];
235 }
236 fLastStepLength = Step;
237
238 return ;
239}