MathGroup Archive 2000

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

Search the Archive

Re: Extracting all the variables from a list of equations?


"Ryan VanRiper (--)" wrote:
> 
> How would i go about extracting all the variables from a list of
> inequalities?
> 
> If i had..   V = {v$233Period > 0,  v$234Period == v$233Period,
> v$236Period <=  v$235Period}
> 
> I would like to get a list that looks like the following..
> 
> X = {v$233Period, v$234Period, v$233Period, v$236Period, v$235Period}
> 
> Then find all the unique elements to give an answer..
> 
> Y = {v$233Period, v$234Period, v$236Period, v$235Period}

Here is one approach.

In[44]:= relations =
{Less,LessEqual,Equal,GreaterEqual,Greater,Unequal};

In[45]:= v2 = V /. Thread[relations->List];

In[46]:= Variables[v2]
Out[46]= {v$233Period, v$234Period, v$235Period, v$236Period}


Daniel Lichtblau
Wolfram Research


  • Prev by Date: Graphing, Symbolic Manipulation, and Regressions
  • Next by Date: Re: writing mathematica script files for the math kernel under linux
  • Previous by thread: Extracting all the variables from a list of equations?
  • Next by thread: Re: Extracting all the variables from a list of equations?