Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Manipulation of equations

Hi is there a way to do that SageMath transform equp2s in equp2sBis ?

for v in var( 'a_0,b_0,a_m,a_m,b_m,m,rho_m,rho_epsilon,rho_0,theta_0,theta_epsilon,theta_m' ): assume( v, 'real' )
for v in var('h,w,t,p_0,p_m') : assume(v,'complex')
p = function('p')(t) # define f to be a function of t complex
h=rho_epsilon*e^(I*theta_epsilon)
p_m=rho_m*e^(I*theta_m)
p_0=rho_0*e^(I*theta_0)
#p_0=p(w)
#
equp=p(w+h)==p_0+p_m*h^(m) 
equp2=abs(equp.lhs())^2==abs(equp.rhs())^2
equp2s=equp.lhs()==equp.rhs()
equp2sBis=equp.lhs()==(rho_epsilon^m*rho_m*e^( I*(theta_epsilon*m + theta_m)) + rho_0*e^( I*theta_0))
show(equp2s)

Manipulation of equations

Hi is there a way to do that SageMath transform equp2s in equp2sBis ?

for v in var( 'a_0,b_0,a_m,a_m,b_m,m,rho_m,rho_epsilon,rho_0,theta_0,theta_epsilon,theta_m' 'a_0,b_0,a_m,a_m,b_m,rho_m,rho_epsilon,rho_0,theta_0,theta_epsilon,theta_m' ): assume( v, 'real' )
for v in var('h,w,t,p_0,p_m') : assume(v,'complex')
var('m')
assume(m,'integer')
p = function('p')(t) # define f to be a function of t complex
h=rho_epsilon*e^(I*theta_epsilon)
p_m=rho_m*e^(I*theta_m)
p_0=rho_0*e^(I*theta_0)
#p_0=p(w)
#
equp=p(w+h)==p_0+p_m*h^(m) 
equp2=abs(equp.lhs())^2==abs(equp.rhs())^2
equp2s=equp.lhs()==equp.rhs()
equp2sBis=equp.lhs()==(rho_epsilon^m*rho_m*e^( I*(theta_epsilon*m + theta_m)) + rho_0*e^( I*theta_0))
show(equp2s)
show(equp2sBis)
equp2s=equp.lhs()==equp2sBis.rhs()*equp2sBis.rhs().conjugate()
show(equp2s)