MathGroup Archive 2002

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

Search the Archive

Re: Solve and using the solutions further

  • To: mathgroup at smc.vnet.net
  • Subject: [mg38360] Re: [mg38252] Solve and using the solutions further
  • From: Tomas Garza <tgarza01 at prodigy.net.mx>
  • Date: Thu, 12 Dec 2002 01:38:18 -0500 (EST)
  • Sender: owner-wri-mathgroup at wolfram.com

If you study the following sequence you´ll understand how to obtain what you
want:

In[1]:=
sol = Solve[{3*x + y + z == -1, 2*x + y + z == -3,
    x - y + z == -3}, {x, y, z}]
Out[1]=
{{x -> 2, y -> -1, z -> -6}}
In[2]:=
pos = Cases[sol[[1]], w_ /; w[[2]] > 0]
Out[2]=
{x -> 2}
In[3]:=
pos[[1,2]]
Out[3]=
2

Bear in mind that the solution to a set of simultaneous equations comes out
as a sequence of rules. Then Cases will help you get the rule or rules where
the second part is positive.

Tomas Garza
Mexico City
----- Original Message -----
From: "Angela Birk" <angela.birk at hwwa.de>
To: mathgroup at smc.vnet.net
Subject: [mg38360] [mg38252] Solve and using the solutions further


> Hi,
> I am trying to solve 3 equations on 3 variables --- which is solveable.
> After that I want to use only the positive solutions of the three
> variables for further calculations. I tried to use the Select command in
> connection with the Solve command, but I get only an empty list.
>
> Could you help by recommend commands?
>
> Thank you in advance.
> Regards
> Angela Birk
>
> --
> Angela Birk
> University of Hamburg
> HWWA
> Economics
> 20347 Hamburg, Germany
> +49 40 42834 - 478
>
>
>
>




  • Prev by Date: Re: minimize avg distance to some points
  • Next by Date: RE: Plot[x Sin[x],{-100,100}] Bad {-100,99} Good?
  • Previous by thread: Re: Solve and using the solutions further
  • Next by thread: Plot[x Sin[x],{-100,100}] Bad {-100,99} Good?