Ask Your Question
0

assume and simplify

asked 2012-08-26 00:15:52 -0500

anonymous user

Anonymous

Hello,

assume(u,'complex') ; assume(v,'complex'); assume(u==conjugate(v)) ; 
u-conjugate(v)

returns

u-conjugate(v)

whereas I was expecting

0

What should I do if I want to simplify some computation involving complex numbers along with their conjugates?

edit retag flag offensive close merge delete

2 answers

Sort by » oldest newest most voted
0

answered 2012-08-26 10:53:43 -0500

calc314 gravatar image

I think the problem is that you are using assume in some steps when you just need assignment. The code below produces a result of 0.

var('v')
assume(v,'complex')
u=conjugate(v)
u-conjugate(v)
edit flag offensive delete link more

Comments

But in some case we can't replace an assumption with an assignment. For exemple if we know that x²=y³, but both x and y are unknown, one would expect x**2-y**3 to return 0 I guess sage doesn't perform this kind of things?

tim gravatar imagetim ( 2012-08-26 23:19:20 -0500 )edit

Yeah, I don't think that this kind of "assumption" is doable in Maxima (which does our assumptions under the hood). But @achrzesz has the usual way to handle this kind of thing, via substitution and/or pattern matching, which hopefully is what you are looking for.

kcrisman gravatar imagekcrisman ( 2012-08-27 03:34:53 -0500 )edit
0

answered 2012-08-27 00:53:03 -0500

achrzesz gravatar image

updated 2012-08-27 22:25:14 -0500

sage: var('x y');
sage: (x^2-y^3).subs_expr(x^2==y^3)    
0    
sage: (x-conjugate(y)).subs_expr(x==conjugate(y))    
0   
sage: maxima('x^2-y^3,x^2=y^3')              
0
sage: maxima('x-conjugate(y),x=conjugate(y)')     
0
#replace x^2 by y^3 in x^4-y^6
sage: maxima('ratsubst(y^3,x^2,x^4-y^6)')
0
#simplify according to the rules
sage: maxima('scsimp(x^4-y^6,x^2=y^3)')
0
edit flag offensive delete link more

Comments

This doesn't perform any nontrivial simplification, for example x^4-y^6 doesn't return 0. But still my question was answered. Thanks everyone.

tim gravatar imagetim ( 2012-08-27 08:21:45 -0500 )edit

Your Answer

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

Add Answer

Question Tools

Stats

Asked: 2012-08-26 00:15:52 -0500

Seen: 794 times

Last updated: Aug 27 '12