Re: Re: Refine, assumptions, domains
- To: mathgroup at smc.vnet.net
- Subject: [mg101750] Re: [mg101715] Re: Refine, assumptions, domains
- From: Andrzej Kozlowski <akozlowski at gmail.com>
- Date: Thu, 16 Jul 2009 08:17:38 -0400 (EDT)
- References: <h3hjkc$1ue$1@smc.vnet.net> <h3hqqr$5l3$1@smc.vnet.net> <200907151108.HAA16411@smc.vnet.net>
On 15 Jul 2009, at 04:08, Richard Fateman 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. > It may be just me but I can't understand what you are trying to do at all. If you just want: > a way of finding the solutions of any equation, > say Sin[x]==0 that lie in a particular range then what's wrong with: x /. {ToRules[Reduce[Sin[x] == 0 && 0 < x < 10, x]]} {Pi, 2*Pi, 3*Pi} ??? Andrzej Kozlowski
- References:
- Re: Refine, assumptions, domains
- From: Richard Fateman <fateman@cs.berkeley.edu>
- Re: Refine, assumptions, domains