Processing math: 100%
Ask Your Question
0

substitute complex number form in a function

asked 4 years ago

ortollj gravatar image

updated 4 years ago

Hi

how can i do so that there is no more x0 nor y0 in f but that f(z,ˉz) , with z=x0+y0I?

var('Z,z,x_0,y_0,r,rho,theta')
assume(Z,'complex') ;assume(z,'complex')
assume(x_0,'real') ;assume(y_0,'real')
Zr(x_0,y_0,r) = -sqrt(((r^2/(x_0^2 + y_0^2) - 1)*x_0 + r*sqrt(-r^2/(x_0^2 + y_0^2) + 1)*y_0/sqrt(x_0^2 + y_0^2))^2 + (r*sqrt(-r^2/(x_0^2 + y_0^2) + 1)*x_0/sqrt(x_0^2 + y_0^2) - (r^2/(x_0^2 + y_0^2) - 1)*y_0)^2)*sqrt(-r^2/(x_0^2 + y_0^2) + 1)*x_0/sqrt(x_0^2 + y_0^2) + x_0

Zi(x_0,y_0,r)=-I*sqrt(((r^2/(x_0^2 + y_0^2) - 1)*x_0 + r*sqrt(-r^2/(x_0^2 + y_0^2) + 1)*y_0/sqrt(x_0^2 + y_0^2))^2 + (r*sqrt(-r^2/(x_0^2 + y_0^2) + 1)*x_0/sqrt(x_0^2 + y_0^2) - (r^2/(x_0^2 + y_0^2) - 1)*y_0)^2)*sqrt(-r^2/(x_0^2 + y_0^2) + 1)*y_0/sqrt(x_0^2 + y_0^2) + I*y_0
show("Zr",(Zr).simplify_full())
show("Zi",(Zi).simplify_full())

Zr0=(Zr).subs(x_0 + I*y_0==z,x_0^2+y_0^2==z*(z.conjugate()))
#show("Zr0",(Zr0).simplify_full())
Zi0=(Zi).subs(x_0 + I*y_0==z,x_0^2+y_0^2==z*(z.conjugate()))
#show("Zi0",(Zi0).simplify_full())
f=Zr0+Zi0
show("f : ",f.simplify_full())
Preview: (hide)

Comments

like that, I completed the transformation using a text editor : z2¯zz¯zzr2z¯zz2¯z2z¯zr2z¯zz¯zz¯z

g(z,r)=((z)*z*conjugate(z) - sqrt(z*conjugate(z))*(z)*sqrt(-(r^2*(z*conjugate(z) )- (z*conjugate(z))*z*conjugate(z))/(z*conjugate(z)))*sqrt(-(r^2 - z*conjugate(z))/(z*conjugate(z))))/(z*conjugate(z))
show(g(z,r).simplify_full())
ortollj gravatar imageortollj ( 4 years ago )

1 Answer

Sort by » oldest newest most voted
2

answered 4 years ago

rburing gravatar image

updated 4 years ago

Just express x0 and y0 directly in terms of z and ˉz (direct subsitution is more reliable than "pattern matching" substitution with x0+iy0 and x20+y20):

Zr0=Zr((z+z.conjugate())/2, (z-z.conjugate())/(2*I), r)
Zi0=Zi((z+z.conjugate())/2, (z-z.conjugate())/(2*I), r)
f=Zr0+Zi0
show(LatexExpr(r"f : (z,\bar{z},r) \mapsto"),f.simplify_full())

f:(z,ˉz,r)  2z¯z4r2+4z¯zz¯zr2z¯zz¯z2¯z

Preview: (hide)
link

Comments

Thank you @rburing

ortollj gravatar imageortollj ( 4 years ago )
1

something that is a little bit surprising :

simplify_full() is not able to simplify the factor 2 of (2a +2bc)/(2d) in f above ;-)

ortollj gravatar imageortollj ( 4 years ago )

normally this function f is simplifiable to f(z,r)=r2ˉz

show(((fout.subs(z==(a+b*I)).simplify_full())).simplify_full())

gives (z,r)  a2+b2a2+b2r2a2+b2a2+b2r2a2+b2aib which gives r^2/(a-b*I)

but SageMath is not able to simplify it

ortollj gravatar imageortollj ( 4 years ago )
1

simplification pb solved see:post :simplify_full-does-not-simplify

ortollj gravatar imageortollj ( 4 years ago )

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 4 years ago

Seen: 360 times

Last updated: Jul 12 '20