MathGroup Archive 2009

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Re: Refine, assumptions, domains

  • To: mathgroup at smc.vnet.net
  • Subject: [mg101752] Re: [mg101715] Re: Refine, assumptions, domains
  • From: Bob Hanlon <hanlonr at cox.net>
  • Date: Thu, 16 Jul 2009 08:18:00 -0400 (EDT)
  • Reply-to: hanlonr at cox.net

Put the condition inside the Reduce

x /. {ToRules[Reduce[{Sin[x] == 0, 0 < x < 10}, x]]}

{Pi, 2*Pi, 3*Pi}


Bob Hanlon

---- Richard Fateman <fateman at cs.berkeley.edu> wrote: 

=============
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.


--

Bob Hanlon



  • Prev by Date: Re: SphericalPlot3D: shifting the origin
  • Next by Date: Re: Refine, assumptions, domains
  • Previous by thread: Re: Re: Refine, assumptions, domains
  • Next by thread: Re: Refine, assumptions, domains