Manipulation of equations

asked 2017-08-30 01:52:32 -0600

ortollj gravatar image

updated 2017-08-30 02:43:58 -0600

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,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)
edit retag flag offensive close merge delete

Comments

I've edited the code to add:

var('m')
assume(m,'integer')
ortollj gravatar imageortollj ( 2017-08-30 02:45:26 -0600 )edit