In [11]:
from sympy import init_session, init_printing, Matrix
init_session()
init_printing()
In [37]:
B, Bi, R, mu = symbols('B, B_{inv}, R, mu')
a0, a1, b0, b1 = symbols('alpha_0, alpha_1, beta_0, beta_1', real=True, positive=True)
# V, h, phi, eta, R, C = symbols('V, h, phi, eta, R, C')
# z, dp = symbols('z, dp', real=True)
# Hc = symbols('H_c')
B = Matrix([[1/sqrt(b0), 0], [a0/sqrt(b0), sqrt(b0)]])
R = Matrix([[cos(mu), sin(mu)], [-sin(mu), cos(mu)]])
Bi = Matrix([[sqrt(b1), 0], [-a1/sqrt(b1), 1/sqrt(b1)]])
In [39]:
expand_trig(simplify(trigsimp(Bi * R * B)))
Out[39]:
In [41]:
simplify(Bi * Matrix([[1, 0],[0, 1]]) * B)
Out[41]:
In [42]:
simplify(Bi * Matrix([[0, 1],[-1, 0]]) * B)
Out[42]:
In [ ]:
e, beta, c = symbols('e, beta, c')
V, h, phi, eta, R, C = symbols('V, h, phi, eta, R, C')
z, dp = symbols('z, dp', real=True)
Hc = symbols('H_c')
zs = C/h/2.
def H(z, dp):
return -eta*beta*c*dp**2 + e*V/C * cos(h*z/R + phi)
H(z, dp)
In [ ]:
def ps(z):
return solve(Eq(H(z,dp), 0), dp)[0]
ps(z)
In [55]:
def ps(z):
return sqrt(cos(z))
# return -sqrt(e*V/(eta*beta*c*C) * h*z/R)
# return -sqrt(e*V/(eta*beta*c*C) * cos(h*z/R+phi))
ps(z)
Out[55]:
In [ ]:
integrate(ps(z), (z, -zs, zs))