Re:SymPy: Symbolic Mathematics in Python
by whatshisface on Wednesday February 28, 2024 @02:53PM
(#39542697)
I could be wrong, but I seriously doubt C macros can do this.
Re:SymPy: Symbolic Mathematics in Python
by sampo on Wednesday February 28, 2024 @03:11PM
(#39542888)
Why are you thinking of macros?
Re:SymPy: Symbolic Mathematics in Python
by whatshisface on Wednesday February 28, 2024 @04:03PM
(#39543383)
In an embedded environment you would want it to be pre-compiled and optimized.
You could maybe calculate the Jacobian in C code using automatic differentiation. Might be less C-code, might be less elementary operations done in the C code, and you would not need to be copy-pasting complex symbolically derived formulas from Python to C.
https://en.wikipedia.org/wiki/Automatic_differentiation