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

Evaluate many different integrands over the different domain #170

Closed
WWXkenmo opened this issue Mar 23, 2023 · 6 comments
Closed

Evaluate many different integrands over the different domain #170

WWXkenmo opened this issue Mar 23, 2023 · 6 comments

Comments

@WWXkenmo
Copy link

WWXkenmo commented Mar 23, 2023

Feature

Desired Behavior / Functionality

Hey,

Thanks for developing this module. Recently I am trying to deal with an integration problem, which require to integrate many different integrands over different domain. For example, I have a set of function [f_1(t; a1, b1), f_2(t; a2, b2), ..., f_n(t; an, bn)], that means each function has the same form but just has difference in parameters, what I want to do is integrating f_1,..., f_n with each function has specific integrate domain (n). so the output would still a n-dimensional tensor, with each elements is the integration results of f_i

I have tracked the PR, and seems integrate on the same domain has been implement (#160), so I am wondering if this feature could be realized. If could, this tool could be applied on more scenarios.

Thanks,
Ken

@gomezzz
Copy link
Collaborator

gomezzz commented Mar 24, 2023

Hi @WWXkenmo thanks for reaching out!

Yes, it is definitely related to #160 , I don't think it is yet support but implementing it should be quite manageable, I think. Would you be interested in implementing it?

@ilan-gold you are probably better qualified to answer this in general than me, what are your thoughts on this? :)

@WWXkenmo
Copy link
Author

Hi,

After working on code today, I think I have figure out this issue, it could be easily down by Integration by substitution.
that is, for n th function (domain), we could represent the t_n as t*t_scale_n + t0_n, in which t_scale_n = t_n - t0_n, so, for every t_n, we substitute as the function of t, then we could use a fixed domain for t ([0, 1]), and each domain would be specific by the index ([t0_n, t_n]). But be aware of the rule of integration, the integrand need to multiply the t_scale_n, but t_scale_n and t0_n now could be the new parameter, which is feasible using current vectorised method #160.

It could be down externally, but it also could be integrated in the module. I would glad to help, but maybe in the next week?

Best,
Ken

@ilan-gold
Copy link
Collaborator

@WWXkenmo If I understand you correctly, I think I have an identical use-case. I wrote a custom integrator and it works very well. @gomezzz If I understand @WWXkenmo correctly, I would be happy to contribute what I have. Basically, it lets you change the domain of integration for each of the vectorized integrands. If this is not something we want to support, then I can just make the changes that let me build this custom integrator and send @WWXkenmo the code separately.

@gomezzz
Copy link
Collaborator

gomezzz commented May 11, 2023

@ilan-gold can be closed now, I think, right? :)

@ilan-gold
Copy link
Collaborator

At long last

@ilan-gold
Copy link
Collaborator

Also I have spoken to @WWXkenmo - I can help him IRL if he wants but what he wants to do is now possible via an API.

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