Open jonapost opened 9 years ago
Copying the last information from topic #8, posted by Jason , to provide a starting point.
"Compute Step Size is 2000 mm. This is with all the geometry in tPMF, so intersections are checked for etc... Error would be lower in general without corrections for intersections with volumes." snipped to focus on this topic "These similar plots but for the Quadropole Mag field:
The number of function calls used by the Murua stepper shoots up after around 4000 mm, which is when the trajectory starts to double back on itself. I haven't had a chance to think about why that happens?"
The previous run started at the origin, which might be why the error is so large. I ran the test again, but this time I generated the base line trajectory with tPMF. At first this made no difference, but then I started looking at other starting points. Here are some graphics of two other starting points (the first two I tried actually):
(100 mm, 100 mm, 0.0 mm): This is all the steppers combined, which has a large error
but the actual error of the Murua stepper is much smaller than that
Here is a plot of the number of function calls:
And here is the second point (-2000._mm,1300._mm,300.*mm): with just the Murua stepper:
and the function calls plot:
The baseline for the following plots was from using tPMF, with geometry turned on. (previously I had commented out a section of code in tPMF in which all but the world volumes where placed.) Position error for starting position: (100mm,100mm,0mm) Relative Position error (substituted the baseline solution for the true solution in Error/Magnitude True Solution):
Notice the big jumps that occur at intersection points. It seems that the Murua stepper might have more difficulties when going through an intersection point. Now for Momentum:
Now the relative errors for starting point (-2000.mm,1300.mm,300.*mm):
There were no intersections in this trajectory. Here is the relative error for just the Murua stepper since it is of a much smaller scale:
I am now going to try a different baseline solution other than Fine45.
OK, I made a second version of the interpolation_error program, errror_by_stepper, which calculates an "interpolant" by just calling the stepper to make up the extra distance. The results are pretty much similar when averaged out (all of these are with the geometry and intersection locators turned on): Relative position error for starting position: (100mm,100mm,0mm):
And now for just the Murua stepper:
Now for the relative errors for the point (-2000.mm,1300.mm,300.*mm):
So it seems that interpolation is a better way to estimate error for points located in between step endpoints. I tried this method because there is no ready interpolant available for ClassicalRK4.
For the above plots MinEps = 5e-05 and MaxEps = 0.001. These were the default values set in tPMF.
For the baseline solution I overrided the default values and set them equal to maxEpsStep= 0.00001; minEpsStep= 2.5e-10
They can be easily changed though.
Compare the error of the position, momentum and number of field evaluations in new Nystrom steppers versus an established stepper ( ClassicalRK4 or CashKarpRKF45 ) and potentially a representative new non-Nystrom stepper.
( Issue to group these comparisons, and separate from other topics. ) Please add new information and results below.