Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Maple does not simplify if variables have "assume"s on them

77 views
Skip to first unread message

unruh

unread,
Aug 10, 2012, 2:53:06 PM8/10/12
to
I am having trouble with Maple not simplifying expressions with
"assumes" on them.

For example, the answer to one of my integrations was
N12:=1/4 I (-epsilon~^2 -4IOmega~ +epsilon~^2)

where the ~ are the expressions with "assume"
(assume(epsilon>0);assume(Omega>0))
The correct answer should be just Omega~, but there is no way I can get
that answer no matter how many "simplify" or "expand" I put around the
original expression of N12.
Ie, maple seems to think that one of those epsilon~ is a different
variable from the other one.

If I copy that output to another input line, then maple simplifies the
expression.

Axel Vogt

unread,
Aug 10, 2012, 3:10:32 PM8/10/12
to
It would help if you provide your full code (as far as needed),
otherwise it is hard to understand.

PS: you may wish to provide it with all operational signs
(like multiplication etc), for copy & paste.

It seems a bit that this may be the reason, since Maple
would simplify it to what you expect.

unruh

unread,
Aug 10, 2012, 4:28:57 PM8/10/12
to
OK. Here it is.

> Gamma:=epsilon^2/2:assume(epsilon>0); assume(Omega>0); assume(t,real):
> phi1:=proc(t,x); -epsilon/2*exp((I*Omega+Gamma)*(t-x)); end proc:
> phi2:=proc(t,x); epsilon/2*exp((I*Omega-Gamma)*(t+x)); end proc:
> pi1:=proc(t,x); diff (phi1(t,x),t);end proc:
> pi2:=proc(t,x); diff (phi2(t,x),t);end proc:
> q1:=proc(t); exp((I*Omega+Gamma)*t);end proc:q2:=proc(t);
> exp((I*Omega-Gamma)*t);end proc:
> p1:=proc(t); -diff(q1(t),t);end proc:
> p2:=proc(t);-diff(q2(t),t);end proc:
> N12:=simplify(I/2*
( 2*int(conjugate(phi1(t,x))*pi2(t,x)-conjugate(pi1(t,x))*phi2(t,x),x=0..infinity)
+conjugate(q1(t))*p2(t)-conjugate(p1(t))*q2(t)
+epsilon*(conjugate(phi1(t,0))*q2(t)-conjugate(q1(t))*phi2(t,0)) ));

2 2
N12 := 1/4 I (-epsilon~ - 4 I Omega~ + epsilon~ )

Peter Pein

unread,
Aug 10, 2012, 5:26:22 PM8/10/12
to
Hi,

as it is almost midnight here, I do not have the patience to try it
myself - sorry.

I would guess that it makes sense to put all assumptions to the very
beginning of your code and to define Gamma later.

.. just a shot in the dark.

Good luck, Peter

Axel Vogt

unread,
Aug 11, 2012, 6:30:56 AM8/11/12
to
On 10.08.2012 22:28, unruh wrote:
> On 2012-08-10, Axel Vogt <&nor...@axelvogt.de> wrote:
>> On 10.08.2012 20:53, unruh wrote:
>>> I am having trouble with Maple not simplifying expressions with
>>> "assumes" on them.
>>>
>>> For example, the answer to one of my integrations was
>>> N12:=1/4 I (-epsilon~^2 -4IOmega~ +epsilon~^2)
>>>
...
>> It seems a bit that this may be the reason, since Maple
>> would simplify it to what you expect.
>
> OK. Here it is.
...
> 2 2
> N12 := 1/4 I (-epsilon~ - 4 I Omega~ + epsilon~ )

There are several issues (I do not use semicolon after writing
'proc' and always want to see, which variables are local or
global, t::real is a correct usage while you also use it on
differentiation).

Suggestion (and that differs from your result):

restart;
Gamma:=epsilon^2/2:
-epsilon/2*exp((I*Omega+Gamma)*(t-x)): phi1:=unapply(%, t,x);
epsilon/2*exp((I*Omega-Gamma)*(t+x)): phi2:=unapply(%, t,x);
diff (phi1(t,x),t): pi1:=unapply(%, t,x);
diff (phi2(t,x),t): pi2:=unapply(%, t,x);
exp((I*Omega+Gamma)*t): q1:=unapply(%, t);
exp((I*Omega-Gamma)*t): q2:=unapply(%, t);
-diff(q1(t),t): p1:=unapply(%, t) ;
-diff(q2(t),t): p2:=unapply(%, t);

tmp0:='I/2*
( 2*Int(conjugate(phi1(t,x))*pi2(t,x)-conjugate(pi1(t,x))*phi2(t,x),x=0..infinity)
+conjugate(q1(t))*p2(t)-conjugate(p1(t))*q2(t)
+epsilon*(conjugate(phi1(t,0))*q2(t)-conjugate(q1(t))*phi2(t,0)) )';
simplify(%) assuming (0 < epsilon, 0<Omega, t::real):
simplify(%) assuming (0 < epsilon, 0<Omega, t::real): # twice, yes
tmp1:=%;

tmp:=value(tmp1) assuming (0 < epsilon, 0<Omega, t::real);
2
tmp := 1/4 I epsilon + Omega


0 new messages