Add Scattering to ParticleTracker#2748
Conversation
# Conflicts: # docs/whatsnew/index.rst
Add static stub files
…ines.rst Co-authored-by: Nick Murphy <namurphy@cfa.harvard.edu>
Co-authored-by: Nick Murphy <namurphy@cfa.harvard.edu>
…diography' into src-reformat-particle-tracker-radiography
basic update routine
Add default value for atomic electron scattering
…le-scattering # Conflicts: # src/plasmapy/formulary/collisions/misc.py
| return integral / factorial(n) | ||
|
|
||
|
|
||
| def Bethe_Moliere_scattering( |
There was a problem hiding this comment.
I always just hear this called Moliere scattering- I think Bethe mostly just described Moliere's results in english? Either way, I think it's best to stick to that name and then just cite Bethe's paper
| return Bethe_stopping_lite(I.si.value, n.si.value, v.si.value, z) * u.J / u.m | ||
|
|
||
|
|
||
| def _f_n_mol_integrand( |
There was a problem hiding this comment.
This is probably old but you don't actually need to compute the integral, just type up the data in Table II and then interpolate over that to get f0, f1, f2, then plug those into Eq. 25 to get the angle probability distribution f(theta)dtheta
You could maybe try explicitly doing the integral if you want, just to test the table, but I think the table will be much faster and avoids numerical integration.
Final rewrite of scattering routine
| [1e-3 * 1e-40, 1e-3 * 0.2084, 1e-3 * 0.0237], | ||
| ] | ||
|
|
||
| _f_mol_spline = make_interp_spline(_ϑ_tabulated, _f_mol_tabulated) |
There was a problem hiding this comment.
Is this a 2D spline? Make sure it's treating the three columns independently, e.g. fitting them each with separate splines. Can you check the interpolator vs. the table data to make sure you have a good interpolation over the full range?
| else: | ||
| f_n = [_f_mol_n(ϑ, i) for i in range(3)] | ||
|
|
||
| return np.sum(B_coefficient * f_n, axis=0) |
There was a problem hiding this comment.
If this is the full RHS of eq 25 should it include a factor of ϑ multiplying all of these terms?
| return scattering_integrand | ||
| else: | ||
| # Eq. 30 | ||
| theta_w = χ_c * np.sqrt(B) |
There was a problem hiding this comment.
Why not just use pi as the upper bound, and not rely on this approximation that neglects the higher order terms?
There was a problem hiding this comment.
TODO: Figure out heuristic for including higher-order corrections when necessary
| ) | ||
|
|
||
| mean_squared, _mean_squared_error = quad( | ||
| lambda theta: theta**2 |
There was a problem hiding this comment.
I don't entirely understand the theta**2 here for calculating the RMS. Is that because the theta is left off of eq. 25 earlier?
Shouldn't the scattering integrand be squared? https://en.wikipedia.org/wiki/Root_mean_square
Add support for compound targets
Reduce cognitive complexity of `-update_velocity_stpoping`
Adds Coulomb scattering to the
ParticleTrackerMerge #2712 and #2790 first