RE: Choose one solution in Mathematica
- To: mathgroup at smc.vnet.net
- Subject: [mg36112] RE: [mg36095] Choose one solution in Mathematica
- From: "Florian Jaccard" <jaccardf at eicn.ch>
- Date: Thu, 22 Aug 2002 04:32:49 -0400 (EDT)
- Sender: owner-wri-mathgroup at wolfram.com
Dear Roberto !
I'm afraid your example is not good. In fact, your equation has only x=1 as
solution.
Let us take a better example :
x^2+x-6=0
You can proceed like this :
In[10]:=
allSolutions=x/.Solve[x^2+x-6==0,x]
Out[10]=
{-3,2}
In[11]:=
intersetingSolutions=Select[allSolutions,#>0&]
Out[11]=
{2}
Meilleures salutations
Florian Jaccard
e-mail : jaccardf at eicn.ch
-----Message d'origine-----
De : Roberto [mailto:roberto.de_santis at ecb.int]
Envoyé : mer., 21. août 2002 11:52
À : mathgroup at smc.vnet.net
Objet : [mg36095] Choose one solution in Mathematica
Dear all,
Assume that
x^2 - 2x + 1 = 0
The two solutions are x = -1 and x = 1.
If I assume that x > 0, then the only relevant solution would be x = 1.
How can I tell this to Mathematica?
Solve[x^2 - 2x + 1 = 0, x]
and then........
Many thanks.
Roberto De Santis