125{
126
127
129
131 b31 = 3.0/40.0 , b32 = 9.0/40.0 ,
132 b41 = 0.3 , b42 = -0.9 , b43 = 1.2 ,
133
134 b51 = -11.0/54.0 , b52 = 2.5 , b53 = -70.0/27.0 ,
135 b54 = 35.0/27.0 ,
136
137 b61 = 1631.0/55296.0 , b62 = 175.0/512.0 ,
138 b63 = 575.0/13824.0 , b64 = 44275.0/110592.0 ,
139 b65 = 253.0/4096.0 ,
140
141 c1 = 37.0/378.0 , c3 = 250.0/621.0 , c4 = 125.0/594.0 ,
142 c6 = 512.0/1771.0 , dc5 = -277.0/14336.0 ;
143
144 const G4double dc1 = c1 - 2825.0/27648.0 , dc3 = c3 - 18575.0/48384.0 ,
145 dc4 = c4 - 13525.0/55296.0 , dc6 = c6 - 0.25 ;
146
147
148
149
150 yOut[7] = yTemp[7] = yIn[7] = yInput[7];
151
153
154
155
156
157 for(i=0; i<numberOfVariables; ++i)
158 {
159 yIn[i]=yInput[i];
160 }
161
162
163 for(i=0; i<numberOfVariables; ++i)
164 {
165 yTemp[i] = yIn[i] + b21*Step*dydx[i] ;
166 }
168
169 for(i=0; i<numberOfVariables; ++i)
170 {
171 yTemp[i] = yIn[i] + Step*(b31*dydx[i] + b32*ak2[i]) ;
172 }
174
175 for(i=0; i<numberOfVariables; ++i)
176 {
177 yTemp[i] = yIn[i] + Step*(b41*dydx[i] + b42*ak2[i] + b43*ak3[i]) ;
178 }
180
181 for(i=0; i<numberOfVariables; ++i)
182 {
183 yTemp[i] = yIn[i] + Step*(b51*dydx[i]
184 + b52*ak2[i] + b53*ak3[i] + b54*ak4[i]) ;
185 }
187
188 for(i=0; i<numberOfVariables; ++i)
189 {
190 yTemp[i] = yIn[i] + Step*(b61*dydx[i]
191 + b62*ak2[i] + b63*ak3[i] + b64*ak4[i] + b65*ak5[i]) ;
192 }
194
195 for(i=0; i<numberOfVariables; ++i)
196 {
197
198
199 yOut[i] = yIn[i] + Step*(c1*dydx[i] + c3*ak3[i] + c4*ak4[i] + c6*ak6[i]) ;
200
201
202
203 yErr[i] = Step*(dc1*dydx[i]
204 + dc3*ak3[i] + dc4*ak4[i] + dc5*ak5[i] + dc6*ak6[i]) ;
205
206
207
208 fLastInitialVector[i] = yIn[i] ;
209 fLastFinalVector[i] = yOut[i];
210 fLastDyDx[i] = dydx[i];
211 }
212
213
214 fLastStepLength = Step;
215
216 return;
217}
G4int GetNumberOfVariables() const
void RightHandSide(const G4double y[], G4double dydx[]) const