Consider this: β=iπ/L
If we want to model this in sympy, we need both the symbol β and the expression iπ/L.
If we also declare beta
as a symbol, beta=symbols('beta')
, we get a nice symbol, that prints as β.
But when if we try to assign the expression to it, beta = i * pi * L
, a disconnect between variable beta
and the symbol beta
(β) happens. Python variable beta
is now overwritten with the expression, and doesn't point to symbol β anymore.
Solution: Define both symbol and the associated expression in a consistant manner.
s_beta = symbols('beta') # symbol beta
e_beta = i * pi / L # expression beta
This will give us power to use the symbol and the expression in any calculation.
Run the code in sympy live.