34 using namespace field_utils;
38 : fEquation(equation), fnvar(nvar), fsteps(steps)
42 G4Exception(
"G4ModifiedMidpoint::G4ModifiedMidpoint()",
44 "Invalid number of variables; must be greater than zero!");
54 setValue(yIn, Value1D::LabTime, y0, y1, yTemp, yOut);
65 y1[i] = yIn[i] + h * dydyIn[i];
80 y1[j] = y0[j] + h2 * dydx[j];
92 yOut[i] = 0.5 * (y0[i] + y1[i] + h * dydx[i]);
103 setValue(yIn, Value1D::LabTime, y0, y1, yTemp, yMid, yOut);
114 y1[i] = y0[i] + h * dydxIn[i];
135 y1[j] = y0[j] + h2 * derivs[i-1][j];
140 if(i == fsteps / 2 - 1 )
153 yOut[i] = 0.5 * (y0[i] + y1[i] + h * derivs[fsteps-1][i]);