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

Add in error propagation from finite differencing lower energy cutoff in Lockwood formulas #1

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

iMurfyD
Copy link

@iMurfyD iMurfyD commented Jan 28, 2025

What this is and why it's needed:

The derivative of the lower energy cutoff is used to estimate the reconnection rate. However, due to the sparsity of data the derivative itself can be quite noisy. This change aims to quantify the error present in this derivative and propagate that error into the Lockwood formulas.

This hasn't been tested yet, so please do not merge.

Formulation

For a function $f(x)$, its the finite difference approximate of the derivative can be expanded as

$$\frac{f(x+h)-f(x)}{h} = \frac{1}{h}\left(f(x)+f'(x)h+ \frac{1}{2} f''(x)h^2 + ... - f(x) \right),$$

where $h$ is the step size of the grid. This can be rearranged to find the error in the derivative. This error is given by

$$\frac{f(x+h)-f(x)}{h} - f'(x) = \frac{h}{2} f''(x) + \mathcal{O}\left( h^{2}\right),$$

where $\mathcal{O}\left( h^{2}\right)$ are higher order terms in the Taylor expansion of $f(x+h)$. By numerically calculating the second derivative using finite difference, we can estimate the magnitude of $\frac{h}{2} f''(x)$.

@iMurfyD
Copy link
Author

iMurfyD commented Jan 28, 2025

@ddasilva Is there an example driver for lib_lockwood1992.py to test and plot the error? I didn't see one in the repo.

@ddasilva
Copy link
Owner

ddasilva commented Jan 30, 2025

@ddasilva Is there an example driver for lib_lockwood1992.py to test and plot the error? I didn't see one in the repo.

Thanks for this! Here's a self-contained directory with a notebook where you can play with plotting the reconnection rate for several events:
https://drive.google.com/file/d/1zUW7FBECpoT1Q2pZU6YQpfzV2e9dCZf6/view?usp=sharing

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.

2 participants