Problem with code - symbolic integration takes awfully long time
3 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Hi all, I am facing a problem concerning symbolic integration.
I have a function that I need to double integrate for variables x1 and y1. This is what my function looks like:
fun_o = p_outer*mi*(1-exp(-jo/K))*sin_delta1;
ymin = -L/2+cy-so;
ymax = L/2+cy-so
;
unknown (symbolic) parameters are x1, y1 and so and:
p_outer - is a function of y1 and so
jo - is a function of x1, y1 and so
sin_delta1 - is a function of y1
so in not dependent on neither x1 nor y1. Other parameters are numerical values.
This is what my integral looks like:
Fy_outer = int(int(fun_o, x1, -b/2, b/2), y1, ymin, ymax);
After I run the code, it takes awfully long time to compute this integral. Plus I need three more integrals which are as complex as this or even more complex than this integral. Plus I would need to run the code multiple times with different numerical values.
Profiler shows that certain mupadex function consumes the time (the 400s is the most I have let it run):
Is there any way to speed up the simulation, what am I doing wrong?
5 Commenti
Walter Roberson
il 29 Gen 2022
On my system, the release took about 216 seconds, and did not change the value. There is a chance that if OmegaR and W_outer were defined with numeric values that it could get further.
... though when I look at the denominator, it seems unlikely to me that you would be able to get anywhere symbolically even if numeric values for those were known.
It might also be worth experimenting with reversing the order of integration.
It looks to me as if your best chance at a symbolic solution would be if so were defined numerically as well as OmegaR
Risposte (0)
Vedere anche
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!