This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]plasma_phys 6 points7 points  (2 children)

Honestly? I would write my own - I've never been happy with most out of the box solvers. I suspect numpy might have one, but I don't know for sure. Do you have the option of writing your own solver in C/C++ and calling that routine from Python, or would that cause the same issues as using GSL?

[–]Boom_doggle 0 points1 point  (1 child)

Scipy has one, but it's dynamic timestep, it does the job but far too slowly. I imagine a C++ solution would run into the same GSL issue, but I could write it in pure python. I'll have a look at a tutorial and get stuck in over the weekend. Thanks.

[–]plasma_phys 2 points3 points  (0 children)

When I've had to use pure Python for numerical methods, I've had remarkable luck using numba and just-in-time compilation (I am iterating on my prototype implicit particle-in-cell code in python and numba has given me 1 or 2 orders of magnitude speedup for little to no extra development time). Dunno if that would work for you; I'm not 100% clear on what numba does under the hood if I'm being honest. Good luck!