RE: Re: List of solution
- To: mathgroup at smc.vnet.net
- Subject: [mg47005] RE: [mg46990] Re: List of solution
- From: "Florian Jaccard" <florian.jaccard at eiaj.ch>
- Date: Sat, 20 Mar 2004 03:50:17 -0500 (EST)
- Reply-to: <florian.jaccard at eiaj.ch>
- Sender: owner-wri-mathgroup at wolfram.com
It is true... But the Select[%, FreeQ[#, I] &] method doesn't do it better... But you can use : Reduce[x^3 - 10x + 1 == 0,x,Reals] This shoes that the 3 solutions are Real... So you can obtain the exact solutions like this : Simplify[ComplexExpand //@ Solve[x^3 - 10x + 1 == 0, x]] And if you want a automatic "real solve" function, you can for example make this : mySolveReal[equ_, var_] := DeleteCases[Simplify[ ComplexExpand //@ Solve[equ, var]], {var -> xx_} /; Im[xx] != 0] and try on a few examples... It works fine on your example ! mySolveReal[x^3-10x+1==0,x] mySolveReal[x^2-x-10==0,x] mySolveReal[x^2-x+10==0,x] Meilleures salutations Florian Jaccard -----Message d'origine----- De : astanoff [mailto:astanoff at yahoo.fr] Envoyé : ven., 19. mars 2004 07:36 À : mathgroup at smc.vnet.net Objet : [mg46990] Re: List of solution Florian Jaccard wrote: > Hello ! > C'est très simple : > In[4]:= > liste = {{x -> 0, y -> 0}, {x -> 1, y -> 0}, > {x -> I, y -> 1 + 2*I}} > Out[4]= > {{x -> 0, y -> 0}, {x -> 1, y -> 0}, > {x -> I, y -> 1 + 2*I}} > In[5]:= > DeleteCases[liste, {x -> xx_, y -> yy_} /; > Im[xx] != 0 || Im[yy] != 0] > Out[5]= > {{x -> 0, y -> 0}, {x -> 1, y -> 0}} The case with 3 real roots Solve[x^3 - 10x + 1 == 0] doesn't seem to work fine... -- 0% de pub! Que du bonheur et des vrais adhérents ! Vous aussi inscrivez-vous sans plus tarder!! Message posté à partir de http://www.gyptis.org, BBS actif depuis 1995.