Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2006
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2006

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

Search the Archive

Re: Selecting Real Roots, Again

  • To: mathgroup at smc.vnet.net
  • Subject: [mg67134] Re: Selecting Real Roots, Again
  • From: Peter Pein <petsie at dordos.net>
  • Date: Sat, 10 Jun 2006 04:53:31 -0400 (EDT)
  • References: <e6b5q5$d3c$1@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

DOD schrieb:
> I've read the many posts already here about how to get mathematica to
> select real roots for you, but I have a slightly(very slighty, I
> thought) different problem ,and I don't know how to get mathematica to
> do what I want.
> 
> I want to get the solution for a polynomial of the following form:
> d x^n + (1-d) x^2 =y
> 
> so for example, I do
> Solve[.9 x^10 + .1 x^2 ==y,x]
> and I get a whole bunch of solution,  very good.  For my purposes, y
> lives in the [0,1], as must the solution.  So I can see, by hand, which
> root I want; exactly one root is both real, and has solutions in my
> inverval.  So I want to tell mathematica to:
> 
> A: look at only solutions x* that are real over y in [0,1]
> 
> and
> 
> B: of those solutions, give the one x* that itself lies is [0,1].
> 
> So, when I try to do something from reading previous posts, I cannot
> get it to work:
> In[24]:=
> Select[Solve[.9 x^10 + .1 x^2 ==y,x],Element[x/.#,Reals]&]
> 
> Out[24]=
> {}
> or perhaps
> In[41]:=
> Select[Solve[.9 x^10 + .1 x^2
> ==y,x],Assuming[Element[y,Reals],Eement[x/.#,Reals]]&]
> Out[41]=
> {}
> 
> 
>  So How to I tell mathematica to do this?
> 
Hi,

you might try Reduce with assumptions:

In[1]:=
$Assumptions={0?x,x?1,0?y,y?1};

x0=x/.{ToRules[Refine[Reduce[
         9/10 x^10+1/10x^2==y&&And@@$Assumptions,x]]]}
-->
  {Root[-10*y + #1^2 + 9*#1^10 & , 2]}

You have to take the global assumptions into the call to Reduce[], since this function obviously doesn't care about $Assumptions (in ver. 5.1).
The addtitional Refine[] removes 0<=y<=1 from the output of Reduce.

hth,
   Peter


  • Prev by Date: Re: Selecting Real Roots, Again
  • Next by Date: Re: Selecting Real Roots, Again
  • Previous by thread: Re: Selecting Real Roots, Again
  • Next by thread: Re: Selecting Real Roots, Again