4 ms·
I've used SymPy in a very similar way, in my case it was some nasty derivatives that were needed for some orbital mechanics calculations. First write down the
by exDM69 3y ago
I've used SymPy in a very similar way, in my case it was some nasty derivatives that were needed for some orbital mechanics calculations.
First write down the equations, then let SymPy do the laborious math part and turn the output into C code.
I'm guessing this is why you don't see a lot of SymPy projects in the wild. It was used for some intermediate calculations, and the results were turned into the product's code and the symbolic code is thrown away.
- analog31 3y agoThere might be a better way, but my habit is to include the symbolic code as a comment in the C. I've thanked myself for doing this.
- abricq 3y agoI commit the symbolic code on its own file, in the same commit which adds the c code.
- lucioperca 3y agoI guess a hypermodern solution would be to produce the parts of the C code with CI/CD from the SymPy Code.