Skip to content

Tag: sympy

Decimal logs in Sympy

I want to solve an expression in SymPy But then I try to code it like this The result isn’t correct. Answer You’ve got the result with ten digits, and not the decimal logarithm. Documentation says, In SymPy, as in Python and most programming languages, log is the natural logarithm, also known as l…

ModuleNotFoundError: No module named ‘sympy’

I’m on MacOSX Mojave 10.14.6 on a MacBook Pro 2015. So I pip installed sympy, right? I head over to my shell, run python3, and do: Just to be sure, I pip installed again just to make sure. My pip list also includes sympy as sympy 1.4. What’s wrong here? Is there another setup step I’ve misse…

Expand index notation equation using sympy

Below I have an equation written using index notation. This equation can be expressed with the six equations on the figure. The first equation is expanded using index notation (einstein notation: https://en.wikipedia.org/wiki/Einstein_notation). In U_k,k the comma is a convention for derivative. Since we have…

How to make Polygon in SymPy from a list of vertices

I want to use SymPy to create a Polygon with n faces and calculate all parameters. The easy form is but I want to use n points from a list, for example But this form and similar is not validated. Any suggestions? Answer You could do this by putting an asterisk in front of the list of parameters to expand