Approximately order of magnitude faster spec sims (for 100 betas, I get 33 s with develop -> ~4s with this branch)
Here is a small script you can use to just compare the outputs of 2 files, in the relevant columns
compare.py.txt
In general, I find that zmax is the same to within 1e-15 m, fA to within 1Hz, and B_avg to within 1e-8 T
From my standalone testing, there should be approximately another order of magnitude "hanging around", if we call these fill_properties more than one beta at a time. Maybe in 10^3 or 10^4 beta "chunks" is optimal. Too much, and there is a lot of wasted time allocating memory all once
I think it makes sense to merge this, and then as you work on segmentBuilder, we can unlock this extra order of magnitude.
Didn't mention, the speed was attained by:
interp2D -> RectBivariateSpline. In my tests, it was exactly the same (2D cubic spline), but interp2D refits the spline every evaluation, and is not vectorized. In the documentation, it said interp2D was deprecated. Otherwise, calling it is exactly the same
This variable substitution removed the singularity in our integrals, leaving only roundoff error (which must have occured anyways). This let me replace quad (which could not be vectorized) to a Simpsons rule, which could. As mentioned, we really benefit when calling this function for more than one beta at once. I still have to write up the reasoning for this.
That these components work is proven by comparing the csvs for develop vs. this branch, though I did test each of these changes
Approximately order of magnitude faster spec sims (for 100 betas, I get 33 s with develop -> ~4s with this branch)
Here is a small script you can use to just compare the outputs of 2 files, in the relevant columns compare.py.txt
In general, I find that zmax is the same to within 1e-15 m, fA to within 1Hz, and B_avg to within 1e-8 T
From my standalone testing, there should be approximately another order of magnitude "hanging around", if we call these fill_properties more than one beta at a time. Maybe in 10^3 or 10^4 beta "chunks" is optimal. Too much, and there is a lot of wasted time allocating memory all once
I think it makes sense to merge this, and then as you work on segmentBuilder, we can unlock this extra order of magnitude.
Didn't mention, the speed was attained by:
That these components work is proven by comparing the csvs for develop vs. this branch, though I did test each of these changes