Ask Your Question
0

assume and simplify

asked 2012-08-26 07:15:52 +0100

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 17:53:43 +0100

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-27 06:19:20 +0100 )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 10:34:53 +0100 )edit
0

answered 2012-08-27 07:53:03 +0100

achrzesz gravatar image

updated 2012-08-28 05:25:14 +0100

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 15:21:45 +0100 )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 07:15:52 +0100

Seen: 1,984 times

Last updated: Aug 28 '12