rednose icon indicating copy to clipboard operation
rednose copied to clipboard

Casadi better than sympy

Open haraschax opened this issue 5 years ago • 2 comments

Is casadi a better option for the symbolic solving then sympy?

https://web.casadi.org/

haraschax avatar Dec 16 '20 05:12 haraschax

This would be interesting to find out, since CasADi seems to have both Python and C++ APIs. Both are capable of generating C code, which would suggest that in speed their maybe quite similar. This article suggests sympy has more "general purpose symbolic abilities", so I guess one way of moving forward with this is determining whether CasADi actually supports all the features of sympy which rednose and openpilot use or could benefit from.

wolterhv avatar Feb 20 '21 14:02 wolterhv

Interesting. Sympy is quite slow for some of the more complicated jacobians. I assumed this would be better with cassadi, but maybe not.

Sympy also doesn't handle elements, vectors and matrices well together, there is a lot of weird code to deal with that

haraschax avatar Feb 23 '21 11:02 haraschax