156{
158
159
160
162 b31 = 2.0/27.0 , b32 = 4.0/27.0,
163
164 b41 = 183.0/1372.0 , b42 = -162.0/343.0, b43 = 1053.0/1372.0,
165
166 b51 = 68.0/297.0, b52 = -4.0/11.0,
167 b53 = 42.0/143.0, b54 = 1960.0/3861.0,
168
169 b61 = 597.0/22528.0, b62 = 81.0/352.0,
170 b63 = 63099.0/585728.0, b64 = 58653.0/366080.0,
171 b65 = 4617.0/20480.0,
172
173 b71 = 174197.0/959244.0, b72 = -30942.0/79937.0,
174 b73 = 8152137.0/19744439.0, b74 = 666106.0/1039181.0,
175 b75 = -29421.0/29068.0, b76 = 482048.0/414219.0,
176
177 b81 = 587.0/8064.0, b82 = 0.0,
178 b83 = 4440339.0/15491840.0, b84 = 24353.0/124800.0,
179 b85 = 387.0/44800.0, b86 = 2152.0/5985.0,
180 b87 = 7267.0/94080.0,
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197 dc1 = b81 - 2479.0/34992.0 ,
198 dc2 = 0.0,
199 dc3 = b83 - 123.0/416.0 ,
200 dc4 = b84 - 612941.0/3411720.0,
201 dc5 = b85 - 43.0/1440.0,
202 dc6 = b86 - 2272.0/6561.0,
203 dc7 = b87 - 79937.0/1113912.0,
204 dc8 = -3293.0/556956.0;
205
207
208
209
210 yOut[7] = yTemp[7] = yIn[7];
211
212
213
214 for(i=0; i<numberOfVariables; ++i)
215 {
216 yIn[i]=yInput[i];
217 DyDx[i] = dydx[i];
218 }
219
220
221 for(i=0; i<numberOfVariables; ++i)
222 {
223 yTemp[i] = yIn[i] + b21*Step*DyDx[i] ;
224 }
226
227 for(i=0; i<numberOfVariables; ++i)
228 {
229 yTemp[i] = yIn[i] + Step*(b31*DyDx[i] + b32*ak2[i]) ;
230 }
232
233 for(i=0; i<numberOfVariables; ++i)
234 {
235 yTemp[i] = yIn[i] + Step*(b41*DyDx[i] + b42*ak2[i] + b43*ak3[i]) ;
236 }
238
239 for(i=0; i<numberOfVariables; ++i)
240 {
241 yTemp[i] = yIn[i] + Step*(b51*DyDx[i] + b52*ak2[i] + b53*ak3[i] +
242 b54*ak4[i]) ;
243 }
245
246 for(i=0; i<numberOfVariables; ++i)
247 {
248 yTemp[i] = yIn[i] + Step*(b61*DyDx[i] + b62*ak2[i] + b63*ak3[i] +
249 b64*ak4[i] + b65*ak5[i]) ;
250 }
252
253 for(i=0; i<numberOfVariables; ++i)
254 {
255 yTemp[i] = yIn[i] + Step*(b71*DyDx[i] + b72*ak2[i] + b73*ak3[i] +
256 b74*ak4[i] + b75*ak5[i] + b76*ak6[i]);
257 }
259
260 for(i=0; i<numberOfVariables; ++i)
261 {
262 yOut[i] = yIn[i] + Step*(b81*DyDx[i] + b82*ak2[i] + b83*ak3[i] +
263 b84*ak4[i] + b85*ak5[i] + b86*ak6[i] +
264 b87*ak7[i]);
265 }
267
268
269 for(i=0; i<numberOfVariables; ++i)
270 {
271
272 yErr[i] = Step*(dc1*DyDx[i] + dc2*ak2[i] + dc3*ak3[i] + dc4*ak4[i] +
273 dc5*ak5[i] + dc6*ak6[i] + dc7*ak7[i] + dc8*ak8[i]) ;
274
275
276
277
278 nextDydx[i] = ak8[i];
279
280
281
282 fLastInitialVector[i] = yIn[i] ;
283 fLastFinalVector[i] = yOut[i];
284 fLastDyDx[i] = DyDx[i];
285 }
286 fLastStepLength = Step;
287
288 return;
289}