Re: Assuming non-integer values in Mathematica simplifications
- To: mathgroup at smc.vnet.net
- Subject: [mg71018] Re: [mg71002] Assuming non-integer values in Mathematica simplifications
- From: Andrzej Kozlowski <akoz at mimuw.edu.pl>
- Date: Sat, 4 Nov 2006 23:07:16 -0500 (EST)
- References: <200611040908.EAA25119@smc.vnet.net>
On 4 Nov 2006, at 18:08, vladimir wrote: > I just started using Mathematica. I need to simplify the following > expressions assuming that w/Pi is not integer (see below). I used > the command Element(w/Pi,Rationals] and Element[w/Pi,Reals], but I > still get the answer containing If(w/Pi is Integers ...) in many > places, making it difficult to extract the answer for non-integer w/ > Pi. It seems that the simplification commands in Mathematica do not > listen to the assumption statements even when such a statement is > given within the simplification command. Does anybody know how to > tell Mathematice to stop evaluating the integer cases? Thanks in > advance. > > Here is my expression: > > FullSimplify[(Sum[1, {k, 0, n - 1}]*Sum[ > Cos[w*k]*Sin[w*k], {k, 0, n - 1}]*Sum[Sin[w*k]*x[k], {k, > 0, n - 1}] - Sum[1, {k, 0, n - 1}]*Sum[Cos[w*k]*x[ > k], {k, 0, n - 1}]*Sum[Sin[w*k]^2, {k, > 0, n - 1}] - Sum[Cos[w*k], {k, 0, > n - 1}]*Sum[Sin[w*k], {k, 0, n - 1}]*Sum[Sin[w*k]*x[ > k], {k, 0, n - 1}] - Sum[Cos[w*k]*Sin[w*k], {k, 0, n - > 1}]* > Sum[Sin[w*k], {k, 0, n - 1}]*Sum[x[k], {k, 0, n - 1}] + > Sum[Cos[w* > k], {k, 0, n - 1}]*Sum[x[k], {k, 0, n - 1}]*Sum[Sin[w*k]^2, > {k, 0, > n - 1}] + Sum[Cos[w* > k]*x[k], {k, > 0, n - 1}]*Sum[Sin[w*k], {k, 0, n - 1}]^2)/(-2*Sum[Cos[ > w*k], {k, 0, n - 1}]*Sum[Sin[w* > k], {k, 0, n - 1}]*Sum[Cos[w*k]*Sin[w*k], {k, 0, > n - 1}] + Sum[Sin[w*k], {k, 0, > n - 1}]^2*Sum[Cos[w*k]^2, {k, 0, n - 1}] + Sum[Cos[w*k]* > Sin[w*k], {k, 0, n - 1}]^2*Sum[1, {k, 0, n - 1}] + Sum[ > Cos[w*k], {k, 0, n - 1}]^2* > Sum[Sin[w*k]^2, {k, 0, n - 1}] - Sum[1, {k, 0, n - > 1}]*Sum[Cos[w*k]^2, {k, 0, n - 1}]*Sum[Sin[w*k]^2, {k, > 0, n - > 1}]), w/Ï? â?? Rationals] > Of course using Element(w/Pi,Rationals] etc would not do, since integers are rationals etc. You need to use this double assumption in FullSimplify: Not[Element[w/(2 Pi), Integers]] && Not[Element[w/Pi , Integers]] Of course this is logically equivalent to simply Not[Element[w/Pi , Integers]] but Mathematica can't make this sort of reduction. Note also that even this remains unsimplified: FullSimplify[Not[Element[a/2, Integers] && Not[Element[a, Integers]]]] a/2 \[NotElement] Integers && a \[NotElement] Integers Andrzej Kozlowski Tokyo, Japan
- References:
- Assuming non-integer values in Mathematica simplifications
- From: vladimir <gpwr9k95@yahoo.com>
- Assuming non-integer values in Mathematica simplifications