Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stop using half-steps for A and B #37

Merged
merged 2 commits into from
Jul 11, 2024
Merged

Stop using half-steps for A and B #37

merged 2 commits into from
Jul 11, 2024

Conversation

egavazzi
Copy link
Owner

Fixes #36

We were using half-steps in height for the A and B matrices. The problem came from doing this with the A matrix but not with the Q matrix. This is (temporarly?) fixed by removing the half-steps for calculating A and B.

Explanation

To explain the problem lets take an example:
For a stream of electrons coming down, at an altitude z and energy E we were 'removing' electrons degrading in energy or scattering in pitch-angle. This was done using half-step in height so using neutral densities at altitude (z + 1/2). But now when calculating the matrix Q the 'source' of electrons at lower energies, we are not using neutral densities at altitude z, without taking half-steps. As neutral densities are higher at lower altitudes, this led to an imbalance in the production and loss of electrons, with more electrons being produced than removed.

Below are profiles of Ie at different energies and varying dz.
With halfsteps:
20keV_changing_dz_from_150km_differentE

Without halfsteps:
20keV_changing_dz_from_150km_differentE_nohalfsteps
(x-axis Ie, y-axis altitude)

@egavazzi egavazzi merged commit 51d0a55 into main Jul 11, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Ionization rates are too big and vary with dz
1 participant