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

More types of infinity transformations #149

Open
DanielVandH opened this issue Feb 18, 2023 · 2 comments
Open

More types of infinity transformations #149

DanielVandH opened this issue Feb 18, 2023 · 2 comments

Comments

@DanielVandH
Copy link
Member

Currently the only type of transformation used for handling infinite bounds is $u \mapsto a + t/(1-t)$ and $u \mapsto t/(1-t)^2$. It could be nice to eventually support other transformations.

In some of the integrals I've dealt with in my work, I've found that transformations like

$$ s = -\cot\left[\frac{\left(\pi + 2\arctan(a)\right)(\xi+1)}{4}\right], \quad -1 < \xi < 1, $$

and

$$ s = -\cot\left[\frac{\left(\pi - 2\arctan(a)\right)(s-1)}{4}\right], \quad -1 < \xi < 1, $$

could be useful, giving the (rather complicated..) results

$$ \int_{-\infty}^a g(s)\mathrm{d}s = \frac{1}{4}\left(\pi + 2\arctan(a)\right)\int_{-1}^1 \csc^2\left[\frac{1}{4}\left(s+1\right)\left(2\arctan(a) + \pi\right)\right]g\left(-\cot\left[\frac{\left(\pi + 2\arctan(a)\right)(s+1)}{4}\right]\right)\mathrm{d}s, $$

$$ \int_a^\infty g(s)\mathrm{d}s = \frac{1}{4}\left(\pi - 2\arctan(a)\right)\int_{-1}^1 \csc^2\left[\frac{1}{4}\left(s-1\right)\left(\pi - 2\arctan(a)\right)\right]g\left(-\cot\left[\frac{\left(\pi - 2\arctan(a)\right)\left(s-1\right)}{4}\right]\right)\mathrm{d}s $$

which typically gave better results when applying Gauss-Legendre quadrature afterwards. These integrals I dealt with had issues with oscillations and singularities, etc., so the currently used transform is still a good default. Another useful transform is $t \mapsto (2/\pi)\arctan(t)$, giving

$$ \int_{-\infty}^\infty g(t)\mathrm{d}t = \frac{\pi}{2}\int_{-1}^1 \sec^2\left(\frac{\pi t}{2}\right)g\left(\tan\frac{\pi t}{2}\right)\mathrm{d}t. $$

@ChrisRackauckas
Copy link
Member

We can add an option to the problem type.

@lxvm lxvm mentioned this issue Feb 25, 2024
5 tasks
@lxvm
Copy link
Collaborator

lxvm commented Mar 3, 2024

Note that in #241 I've added an internal API that should make it easier to add these infinity transformations and other changes of variables.

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

No branches or pull requests

3 participants