229 b31 = 3.0 / 40.0, b32 = 9.0 / 40.0,
230 b41 = 44.0 / 45.0, b42 = -56.0 / 15.0, b43 = 32.0/9.0,
232 b51 = 19372.0 / 6561.0, b52 = -25360.0 / 2187.0, b53 = 64448.0 / 6561.0,
233 b54 = -212.0 / 729.0,
235 b61 = 9017.0 / 3168.0 , b62 = -355.0 / 33.0,
236 b63 = 46732.0 / 5247.0, b64 = 49.0 / 176.0,
237 b65 = -5103.0 / 18656.0,
239 b71 = 35.0 / 384.0, b72 = 0.,
240 b73 = 500.0 / 1113.0, b74 = 125.0 / 192.0,
241 b75 = -2187.0 / 6784.0, b76 = 11.0 / 84.0,
255 dc1 = -(b71 - 5179.0 / 57600.0),
257 dc3 = -(b73 - 7571.0 / 16695.0),
258 dc4 = -(b74 - 393.0 / 640.0),
259 dc5 = -(b75 + 92097.0 / 339200.0),
260 dc6 = -(b76 - 187.0 / 2100.0),
261 dc7 = -(- 1.0 / 40.0);
267 yOut[7] = yTemp[7] = fyIn[7] = yInput[7];
271 for(
unsigned int i = 0; i <
N; ++i)
274 yTemp[i] = yInput[i] + b21 * hstep * dydx[i];
276 RightHandSideInl(yTemp, ak2);
278 for(
unsigned int i = 0; i <
N; ++i)
280 yTemp[i] = fyIn[i] + hstep * (b31 * dydx[i] + b32 * ak2[i]);
282 RightHandSideInl(yTemp, ak3);
284 for(
unsigned int i = 0; i <
N; ++i)
286 yTemp[i] = fyIn[i] + hstep * (
287 b41 * dydx[i] + b42 * ak2[i] + b43 * ak3[i]);
289 RightHandSideInl(yTemp, ak4);
291 for(
unsigned int i = 0; i <
N; ++i)
293 yTemp[i] = fyIn[i] + hstep * (
294 b51 * dydx[i] + b52 * ak2[i] + b53 * ak3[i] + b54 * ak4[i]);
296 RightHandSideInl(yTemp, ak5);
298 for(
unsigned int i = 0; i <
N; ++i)
300 yTemp[i] = fyIn[i] + hstep * (
301 b61 * dydx[i] + b62 * ak2[i] +
302 b63 * ak3[i] + b64 * ak4[i] + b65 * ak5[i]);
304 RightHandSideInl(yTemp, ak6);
306 for(
unsigned int i = 0; i <
N; ++i)
308 yOut[i] = fyIn[i] + hstep * (
309 b71 * dydx[i] + b72 * ak2[i] + b73 * ak3[i] +
310 b74 * ak4[i] + b75 * ak5[i] + b76 * ak6[i]);
312 RightHandSideInl(yOut, ak7);
314 for(
unsigned int i = 0; i <
N; ++i)
317 dc1 * dydx[i] + dc2 * ak2[i] +
318 dc3 * ak3[i] + dc4 * ak4[i] +
319 dc5 * ak5[i] + dc6 * ak6[i] + dc7 * ak7[i]
325 fdydxIn[i] = dydx[i];
328 fLastStepLength = hstep;
351 const G4double hf1 = 6025192743.0 / 30085553152.0,
352 hf3 = 51252292925.0 / 65400821598.0,
353 hf4 = - 2691868925.0 / 45128329728.0,
354 hf5 = 187940372067.0 / 1594534317056.0,
355 hf6 = - 1776094331.0 / 19743644256.0,
356 hf7 = 11237099.0 / 235043384.0;
360 for(
unsigned int i = 0; i < 3; ++i)
362 mid[i] = fyIn[i] + 0.5 * fLastStepLength * (
363 hf1 * fdydxIn[i] + hf3 * ak3[i] +
364 hf4 * ak4[i] + hf5 * ak5[i] + hf6 * ak6[i] + hf7 * ak7[i]);
387 const G4double bf1 = 1.0 / 11282082432.0 * (
388 157015080.0 * tau4 - 13107642775.0 * tau3 + 34969693132.0 * tau2 -
389 32272833064.0 * tau + 11282082432.0);
391 const G4double bf3 = - 100.0 / 32700410799.0 * tau * (
392 15701508.0 * tau3 - 914128567.0 * tau2 + 2074956840.0 * tau -
395 const G4double bf4 = 25.0 / 5641041216.0 * tau * (
396 94209048.0 * tau3 - 1518414297.0 * tau2 + 2460397220.0 * tau -
399 const G4double bf5 = - 2187.0 / 199316789632.0 * tau * (
400 52338360.0 * tau3 - 451824525.0 * tau2 + 687873124.0 * tau -
403 const G4double bf6 = 11.0 / 2467955532.0 * tau * (
404 106151040.0 * tau3 - 661884105.0 * tau2 +
405 946554244.0 * tau - 361440756.0);
407 const G4double bf7 = 1.0 / 29380423.0 * tau * (1.0 - tau) * (
408 8293050.0 * tau2 - 82437520.0 * tau + 44764047.0);
410 for(
unsigned int i = 0; i <
N; ++i)
412 yOut[i] = fyIn[i] + fLastStepLength * tau * (
413 bf1 * fdydxIn[i] + bf3 * ak3[i] + bf4 * ak4[i] +
414 bf5 * ak5[i] + bf6 * ak6[i] + bf7 * ak7[i]);
430 const G4double b81 = 6245.0 / 62208.0,
432 b83 = 8875.0 / 103032.0,
433 b84 = -125.0 / 1728.0,
434 b85 = 801.0 / 13568.0,
435 b86 = -13519.0 / 368064.0,
436 b87 = 11105.0 / 368064.0,
438 b91 = 632855.0 / 4478976.0,
440 b93 = 4146875.0 / 6491016.0,
441 b94 = 5490625.0 /14183424.0,
442 b95 = -15975.0 / 108544.0,
443 b96 = 8295925.0 / 220286304.0,
444 b97 = -1779595.0 / 62938944.0,
445 b98 = -805.0 / 4104.0;
451 for(
unsigned int i = 0; i <
N; ++i)
453 yTemp[i] = fyIn[i] + fLastStepLength * (
454 b81 * fdydxIn[i] + b82 * ak2[i] + b83 * ak3[i] +
455 b84 * ak4[i] + b85 * ak5[i] + b86 * ak6[i] +
459 RightHandSideInl(yTemp, ak8);
461 for(
unsigned int i = 0; i <
N; ++i)
463 yTemp[i] = fyIn[i] + fLastStepLength * (
464 b91 * fdydxIn[i] + b92 * ak2[i] + b93 * ak3[i] +
465 b94 * ak4[i] + b95 * ak5[i] + b96 * ak6[i] +
466 b97 * ak7[i] + b98 * ak8[i]
469 RightHandSideInl(yTemp, ak9);
484 bi[1][1] = -38039.0 / 7040.0,
485 bi[1][2] = 125923.0 / 10560.0,
486 bi[1][3] = -19683.0 / 1760.0,
487 bi[1][4] = 3303.0 / 880.0,
500 bi[3][1] = -12500.0 / 4081.0,
501 bi[3][2] = 205000.0 / 12243.0,
502 bi[3][3] = -90000.0 / 4081.0,
503 bi[3][4] = 36000.0 / 4081.0,
508 bi[4][1] = -3125.0 / 704.0,
509 bi[4][2] = 25625.0 / 1056.0,
510 bi[4][3] = -5625.0 / 176.0,
511 bi[4][4] = 1125.0 / 88.0,
516 bi[5][1] = 164025.0 / 74624.0,
517 bi[5][2] = -448335.0 / 37312.0,
518 bi[5][3] = 295245.0 / 18656.0,
519 bi[5][4] = -59049.0 / 9328.0,
524 bi[6][1] = -25.0 / 28.0,
525 bi[6][2] = 205.0 / 42.0,
526 bi[6][3] = -45.0 / 7.0,
527 bi[6][4] = 18.0 / 7.0,
532 bi[7][1] = -2.0 / 11.0,
533 bi[7][2] = 73.0 / 55.0,
534 bi[7][3] = -171.0 / 55.0,
535 bi[7][4] = 108.0 / 55.0,
540 bi[8][1] = 189.0 / 22.0,
541 bi[8][2] = -1593.0 / 55.0,
542 bi[8][3] = 3537.0 / 110.0,
543 bi[8][4] = -648.0 / 55.0,
548 bi[9][1] = 351.0 / 110.0,
549 bi[9][2] = -999.0 / 55.0,
550 bi[9][3] = 2943.0 / 110.0,
551 bi[9][4] = -648.0 / 55.0;
557 std::memset(b, 0.0,
sizeof(b));
560 for(
G4int j = 0; j <= 4; ++j)
562 for(
G4int iStage = 1; iStage <= 9; ++iStage)
564 b[iStage] += bi[iStage][j] * tauPower;
569 const G4double stepLen = fLastStepLength * tau;
570 for(
G4int i = 0; i <
N; ++i)
572 yOut[i] = fyIn[i] + stepLen * (
573 b[1] * fdydxIn[i] + b[2] * ak2[i] + b[3] * ak3[i] +
574 b[4] * ak4[i] + b[5] * ak5[i] + b[6] * ak6[i] +
575 b[7] * ak7[i] + b[8] * ak8[i] + b[9] * ak9[i]