A computer algebra system written in pure Python http://sympy.org/ . To get started to with contributing https://github.com/sympy/sympy/wiki/Introduction-to-contributing
oscarbenjamin on master
Fix a variable name in the comm… Merge pull request #21646 from … (compare)
oscarbenjamin on master
Docs: remove spurious comma Merge pull request #21645 from … (compare)
Mod
in a*(b%3)
where a
and b
are plain Symbol
? SymPy will evaluate it to a*Mod(b, 3)
, while I'd want to keep the precedence explicit (so that ultimately generation of lower level code honours this user-enforced precedence)
eq [some equation]
it'll solve it
Why does the following latex code of the function varies from the symbol?
import sympy as sp
r = sp.symbols("r")
print(sp.latex(sp.symbols("\delta\ u_t")))
print(sp.latex(sp.Function("\delta\ u_t")(r)))
gives
\delta u_{t}
\delta\ u_{t}{\left(r \right)}
Notice that the space right after \delta
is escaped for the function, but not for the symbol.
Okay, is there a way I can use the Symbol-like expressions for functions, or define the symbol without the space? The way it gets displayed, it appears as if \delta
and u_t
are two different variables. Ofcourse, sp.symbols("\deltau_t")
, it won't work.
Also, why raw strings for latex?
Okay, is there a way I can use the Symbol-like expressions for functions, or define the symbol without the space? The way it gets displayed, it appears as if
\delta
andu_t
are two different variables. Ofcourse,sp.symbols("\deltau_t")
, it won't work.Also, why raw strings for latex?
Any solution for this?
Maybe someone can explain the following to me:
Using sympy 1.7.1 i get the following:
from sympy import *
init_printing()
a = Symbol('a')
a0, = solveset(Eq(2*a**5,0.34),domain=S.Reals)
a0 # 0.70160032942779
0.70160032942779
print(a0.round(4)) # 0.7016
print(a0.round(4).n(10)) # 0.7015991211
Thank you for any hints.
Wolfgang
Sorry, a very general question, I'm just looking around with sympy.
I was confused by sympy having two implementations of vectors, sympy.vector
an sympy.physics.vector
. They seem to not be sharing code and the documentation for either doesn't mention another one and the reason to have them separate. Why is that? Is there a way to make them interoperate?
Thanks!
=
I'm using sym.Eq(a, b)
sym.solve()
with a list of the expressions