Re: Refine, assumptions, domains
- To: mathgroup at smc.vnet.net
- Subject: [mg101715] Re: Refine, assumptions, domains
- From: Richard Fateman <fateman at cs.berkeley.edu>
- Date: Wed, 15 Jul 2009 07:08:57 -0400 (EDT)
- References: <h3hjkc$1ue$1@smc.vnet.net> <h3hqqr$5l3$1@smc.vnet.net>
Jon McLoone wrote:
> How about...
>
> n Pi /. {ToRules[Reduce[0 < n*Pi < 10 && Element[n, Integers], n]]}
>
> On Jul 14, 10:37 am, Richard Fateman <fate... at cs.berkeley.edu> wrote:
>> What I'm looking for is a simple way to obtain a finite list
>>
>> { Pi, 2 Pi, 3 Pi}
>>
>> from this information:
>>
>> 0< n*Pi < 10, Element[n,Integers]
>>
>> Refine doesn't do this, at least with Mathematica 6.0
>> Suggestions? (cc to fate... at gmail.com would be nice.)
>
>
Thanks for the suggestions!
What I really wanted was a way of finding the solutions of any equation,
say Sin[x]==0 that lie in a particular range, say the range 0 to 10.
Naturally, I prefer that this be done symbolically and exactly rather
than numerically, when possible.
If we try
Reduce[Sin[x]==0,x].
After replacing the dummy name C[1] by n, the answer condition is
Element[n, Integers] && (x == 2*n*Pi || x == Pi + 2*n*Pi)
which is correct but clumsy.
Automatically mapping this into Jon's construction, is hairier.
If we can manage to get this...
(2 n Pi || Pi + 2 n Pi) /. {ToRules[
Reduce[((0 < 2*n*Pi < 10) || (0 < Pi + 2*n*Pi < 10)) &&
Element[n, Integers], n]]}
The answer comes out
{0 || Pi, 2*Pi || 3*Pi}
which is pretty close; % /. Or->List //Flatten does the rest, given
that particular form.
Thanks.
- Follow-Ups:
- Re: Re: Refine, assumptions, domains
- From: Andrzej Kozlowski <akozlowski@gmail.com>
- Re: Re: Refine, assumptions, domains