62 G4int noIntegrationVariables,
65 fLastStepLength(0.), fAuxStepper(0)
67 const G4int numberOfVariables = noIntegrationVariables;
69 ak2 =
new G4double[numberOfVariables] ;
70 ak3 =
new G4double[numberOfVariables] ;
71 ak4 =
new G4double[numberOfVariables] ;
73 pseudoDydx_for_DistChord =
new G4double[numberOfVariables];
78 yTemp =
new G4double[numberOfVariables] ;
79 yIn =
new G4double[numberOfVariables] ;
81 fLastInitialVector =
new G4double[numStateVars] ;
82 fLastFinalVector =
new G4double[numStateVars] ;
83 fLastDyDx =
new G4double[numStateVars];
85 fMidVector =
new G4double[numStateVars];
86 fMidError =
new G4double[numStateVars];
104 delete[] fLastInitialVector;
105 delete[] fLastFinalVector;
138 b31 = 0. , b32 = 3.0/4.0 ,
139 b41 = 2.0/9.0, b42 = 1.0/3.0 , b43 = 4.0/9.0;
142 const G4double dc1 = b41 - 7.0/24.0 , dc2 = b42 - 1.0/4.0 ,
143 dc3 = b43 - 1.0/3.0 , dc4 = - 0.125 ;
150 yOut[7] = yTemp[7] = yIn[7];
156 for(i=0;i<numberOfVariables;i++)
162 for(i=0;i<numberOfVariables;i++)
164 yTemp[i] = yIn[i] + b21*Step*DyDx[i] ;
168 for(i=0;i<numberOfVariables;i++)
170 yTemp[i] = yIn[i] + Step*(b31*DyDx[i] + b32*ak2[i]) ;
174 for(i=0;i<numberOfVariables;i++)
176 yOut[i] = yIn[i] + Step*(b41*DyDx[i] + b42*ak2[i] + b43*ak3[i]) ;
180 for(i=0;i<numberOfVariables;i++)
184 yErr[i] = Step*(dc1*DyDx[i] + dc2*ak2[i] + dc3*ak3[i] +
189 fLastInitialVector[i] = yIn[i] ;
190 fLastFinalVector[i] = yOut[i];
191 fLastDyDx[i] = DyDx[i];
195 fLastStepLength =Step;
207 fLastInitialVector[1], fLastInitialVector[2]);
209 fLastFinalVector[1], fLastFinalVector[2]);
213 fAuxStepper->
Stepper( fLastInitialVector, fLastDyDx, 0.5 * fLastStepLength,
214 fMidVector, fMidError );
216 midPoint =
G4ThreeVector( fMidVector[0], fMidVector[1], fMidVector[2]);
222 if (initialPoint != finalPoint)
225 distChord = distLine;
229 distChord = (midPoint-initialPoint).mag();
CLHEP::Hep3Vector G4ThreeVector
static G4double Distline(const G4ThreeVector &OtherPnt, const G4ThreeVector &LinePntA, const G4ThreeVector &LinePntB)
G4BogackiShampine23(G4EquationOfMotion *EqRhs, G4int numberOfVariables=6, G4bool primary=true)
G4int GetNumberOfVariables() const
G4double DistChord() const
T max(const T t1, const T t2)
brief Return the largest of the two arguments
G4int GetNumberOfStateVariables() const
void RightHandSide(const double y[], double dydx[])
void Stepper(const G4double y[], const G4double dydx[], G4double h, G4double yout[], G4double yerr[])