I have a very complicated pair of functions $F(x,y), G(x,y)$ that are used in a differential equation $0 = x'' + F(x,y)$, $0 =y '' + G(x,y)\,. $ $F$ and $G$ are roughly sums of products of the Bessel functions $J_n(x) J_m(y)$. In a differential equation, it is very costly to have to recompute the sum of these special functions at each step. Is there a way to make this process more efficient? I would like, for example, to precompute an interpolating function for use in NDSolve but I find NDSolve has trouble with these types of functions.
Asked
Active
Viewed 109 times
1 Answers
0
NDSolve does not have problems with interpolating functions. Not from my experience at least. Can you post an example where you run into problems?
A few other thoughts:
- Are you by any chance using
BesselJZeroin $F$ and $G$ (BesselJZerois even slower thanBesselJ) - Bessel functions have other parametrizations which you could try
- Try using
Compile - Check this question: How to improve performance of BesselJ to the level of GSL?
Mr Puh
- 1,017
- 6
- 12
Method->"Splines"it typically works well theNDSolvefrom my limited experience. – chris Sep 09 '20 at 15:21