Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.soft-sys.math.mathematica > #5793 > unrolled thread
| Started by | "A. Lapraitis" <ffcitatos@gmail.com> |
|---|---|
| First post | 2011-10-22 10:18 +0000 |
| Last post | 2011-10-24 09:23 +0000 |
| Articles | 5 — 3 participants |
Back to article view | Back to comp.soft-sys.math.mathematica
Full simplify problem "A. Lapraitis" <ffcitatos@gmail.com> - 2011-10-22 10:18 +0000
Re: Full simplify problem dimitris <dimmechan@yahoo.com> - 2011-10-23 10:25 +0000
Re: Full simplify problem dimitris <dimmechan@yahoo.com> - 2011-10-23 10:29 +0000
Re: Full simplify problem dimitris <dimmechan@yahoo.com> - 2011-10-23 10:30 +0000
Re: Full simplify problem DrMajorBob <btreat1@austin.rr.com> - 2011-10-24 09:23 +0000
| From | "A. Lapraitis" <ffcitatos@gmail.com> |
|---|---|
| Date | 2011-10-22 10:18 +0000 |
| Subject | Full simplify problem |
| Message-ID | <j7u59t$u$1@smc.vnet.net> |
Hello, Could anyone explain why the following does not give zero? In[72]:= Assuming[ x == y + z, FullSimplify[ E^x - E^(y + z) ] ] Out[72]= E^x - E^(y + z) Thanks!
[toc] | [next] | [standalone]
| From | dimitris <dimmechan@yahoo.com> |
|---|---|
| Date | 2011-10-23 10:25 +0000 |
| Message-ID | <j80q30$ab1$1@smc.vnet.net> |
| In reply to | #5793 |
On Oct 22, 1:18 pm, "A. Lapraitis" <ffcita...@gmail.com> wrote:
> Hello,
>
> Could anyone explain why the following does not give zero?
>
> In[72]:= Assuming[
> x == y + z,
> FullSimplify[
> E^x - E^(y + z)
> ]
> ]
>
> Out[72]= E^x - E^(y + z)
>
> Thanks!
Wow! This is rather strange! Here is some similar examples
In[31]:= Assuming[x - y == 0, FullSimplify[E^x - E^(y + z)]] (*works*)
Out[31]= E^y*(1 - E^z)
In[36]:= Assuming[x - y == 2, FullSimplify[E^x - E^(y + z)]](*not
works*)
Out[36]= E^x - E^(y + z)
In[37]:= Assuming[x == y, FullSimplify[E^x - E^(y + z)]] (*works*)
Out[37]= E^y*(1 - E^z)
In[30]:= Assuming[x == 2*y, FullSimplify[E^x - E^(y + z)]] (*not
works*)
Out[30]= E^x - E^(y + z)
Somehow FullSimplify need some push in order to simplify your
expression and similar ones.
I don't claim this is a normal behavior, I don't have any explanation
for it, I don't know what
I would do if I didn't have some knowledge of Mathematica but I found
the following
workaround (not trivial indeed) for your example:
In[69]:= Assuming[x == y + z, FullSimplify[E^x - E^(y + z),
ComplexityFunction -> (If[Head[#1] === Power, 1, 0] & )]]
Out[69]= 0
This does the same
In[70]:= Assuming[x == y + z, FullSimplify[E^x - E^(y + z),
ComplexityFunction -> (Count[{#1}, _Power, Infinity] & )]]
Out[70]= 0
(You can use the option ComplexityFunction to specify different
simplicity criteria. Here the goal is to avoid Power if possible.
Remember that Head[Exp[z]] is Power and FullForm[Exp[z]] is
Power[E,z].)
I would also add that for my similar examples mentioned above a
workaround could be:
In[80]:= TrigToExp[Assuming[x == 2*y, FullSimplify[E^x - E^(y + z),
ComplexityFunction -> (Count[{#1}, _Power, Infinity] & )]]]
Out[80]= E^(2*y) - E^(y + z)
In[82]:= TrigToExp[Assuming[x - y == 2, FullSimplify[E^x - E^(y + z),
ComplexityFunction -> (Count[{#1}, _Power, Infinity] & )]]]
Out[82]= E^(2 + y) - E^(y + z)
Best Regards
Dimitris
[toc] | [prev] | [next] | [standalone]
| From | dimitris <dimmechan@yahoo.com> |
|---|---|
| Date | 2011-10-23 10:29 +0000 |
| Message-ID | <j80qam$adm$1@smc.vnet.net> |
| In reply to | #5793 |
On Oct 22, 1:18 pm, "A. Lapraitis" <ffcita...@gmail.com> wrote: > Hello, > > Could anyone explain why the following does not give zero? > > In[72]:= Assuming[ > x == y + z, > FullSimplify[ > E^x - E^(y + z) > ] > ] > > Out[72]= E^x - E^(y + z) > > Thanks! Hello again. Apart from my original reply I would also like to add the following attempt which generates a message but does what you wanted. Assuming[x === y + z, FullSimplify[E^x - E^(y + z)]] $Assumptions::fas:Warning: One or more assumptions evaluated to False. 0 ?=== lhs === rhs yields True if the expression lhs is identical to rhs, and yields \ False otherwise. But I do consider my first attempt the best one (and I finally understood that this is a normal behavior of FullSimplify thanks to Mr Kozlowski). Dimitris
[toc] | [prev] | [next] | [standalone]
| From | dimitris <dimmechan@yahoo.com> |
|---|---|
| Date | 2011-10-23 10:30 +0000 |
| Message-ID | <j80qcj$ae5$1@smc.vnet.net> |
| In reply to | #5793 |
On Oct 22, 1:18 pm, "A. Lapraitis" <ffcita...@gmail.com> wrote: > Hello, > > Could anyone explain why the following does not give zero? > > In[72]:= Assuming[ > x == y + z, > FullSimplify[ > E^x - E^(y + z) > ] > ] > > Out[72]= E^x - E^(y + z) > > Thanks! Actually private communication with Andrzej Kozlowski made me understand that the approach in my second message was incorrect. For example each of the following evaluate to True In[116]:= Assuming[x === y + z, FullSimplify[E^x - E^(y + z) === 0]] During evaluation of In[116]:= $Assumptions::fas: Warning: One or more assumptions evaluated to False. >> Out[116]= True In[119]:= Assuming[x === y + z, FullSimplify[E^x - E^(y + z) < 0]] During evaluation of In[119]:= $Assumptions::fas: Warning: One or more assumptions evaluated to False. >> Out[119]= True In[120]:= Assuming[x === y + z, FullSimplify[E^x - E^(y + z) > 0]] During evaluation of In[120]:= $Assumptions::fas: Warning: One or more assumptions evaluated to False. >> Out[120]= True Assuming False every predicate becomes True. Of course the approach in the first message is correct. Dimitris
[toc] | [prev] | [next] | [standalone]
| From | DrMajorBob <btreat1@austin.rr.com> |
|---|---|
| Date | 2011-10-24 09:23 +0000 |
| Message-ID | <j83aql$k7s$1@smc.vnet.net> |
| In reply to | #5793 |
Much easier is E^x - E^(y + z) /. x -> y + z 0 ...unless your real problem is more complicated? Bobby On Sun, 23 Oct 2011 05:24:44 -0500, dimitris <dimmechan@yahoo.com> wrote: > On Oct 22, 1:18 pm, "A. Lapraitis" <ffcita...@gmail.com> wrote: >> Hello, >> >> Could anyone explain why the following does not give zero? >> >> In[72]:= Assuming[ >> x == y + z, >> FullSimplify[ >> E^x - E^(y + z) >> ] >> ] >> >> Out[72]= E^x - E^(y + z) >> >> Thanks! > > Actually private communication with Andrzej Kozlowski made me > understand that the approach in my second message was incorrect. > For example each of the following evaluate to True > > In[116]:= Assuming[x === y + z, FullSimplify[E^x - E^(y + z) === > 0]] > > During evaluation of In[116]:= $Assumptions::fas: Warning: One or more > assumptions evaluated to False. >> > > Out[116]= True > > In[119]:= Assuming[x === y + z, FullSimplify[E^x - E^(y + z) < 0]] > > During evaluation of In[119]:= $Assumptions::fas: Warning: One or more > assumptions evaluated to False. >> > > Out[119]= True > > In[120]:= Assuming[x === y + z, FullSimplify[E^x - E^(y + z) > 0]] > > During evaluation of In[120]:= $Assumptions::fas: Warning: One or more > assumptions evaluated to False. >> > > Out[120]= True > > Assuming False every predicate becomes True. > > Of course the approach in the first message is correct. > > Dimitris > -- DrMajorBob@yahoo.com
[toc] | [prev] | [standalone]
Back to top | Article view | comp.soft-sys.math.mathematica
csiph-web