MathGroup Archive 2006

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

Search the Archive

Re: On Reduce

  • To: mathgroup at smc.vnet.net
  • Subject: [mg72046] Re: On Reduce
  • From: Jean-Marc Gulliet <jeanmarc.gulliet at gmail.com>
  • Date: Sat, 9 Dec 2006 06:09:55 -0500 (EST)
  • Organization: The Open University, Milton Keynes, UK
  • References: <elbi51$k23$1@smc.vnet.net>

Virgil Stokes wrote:
> I have the following small piece of Mathematica code that works fine for 
> my purposes.
> 
>  BInv = {{  1/4, 1/4, 0},
>               {-1/2, 1/2, 0},
>               {  3/4, -5/4, 1}}
>  B = Inverse[BInv]
>  b = {4 + \[Delta], 8, 10};
>  BInv.b // FullSimplify
>  Reduce[{%[[1]] >= 0, %[[2]] >= 0, %[[3]] >= 0}, {\[Delta]}]
>  % /. {\[Delta] -> b1 - 4} // FullSimplify
> 
> which gives
> 
> 0 <=  b1 <= 8
> 
> which is of course correct. But, how can I use (access) the values 0 and 8?
> That is, I would like to now use these values in some expressions that 
> would follow this.
> 
> Thanks,
> V. Stokes
> 
Hi Virgil,

In Mathematica, "Everything is an expression." Therefore, you can 
manipulate the result made of inequalities as any expression.

In[1]:=
BInv = {{1/4, 1/4, 0}, {-2^(-1), 1/2, 0}, {3/4, -5/4, 1}};
B = Inverse[BInv];
b = {4 + δ, 8, 10};
FullSimplify[BInv . b];
Reduce[{%[[1]] >= 0, %[[2]] >= 0, %[[3]] >= 0}, {δ}];
sol = FullSimplify[% /. {δ -> b1 - 4}]

Out[6]=
0 <= b1 <= 8

In[7]:=
FullForm[sol]

Out[7]//FullForm=
FullForm[Inequality[0, LessEqual, b1, LessEqual, 8]]

In[8]:=
lowval = First[sol]

Out[8]=
0

In[9]:=
upval = Last[sol]

Out[9]=
8

Regards,
Jean-Marc


  • Prev by Date: Re: Histogram3D
  • Next by Date: Re: Solve chokes on Piecewise input that Reduce handles quite well??
  • Previous by thread: Re: On Reduce
  • Next by thread: how-to show a contourplot together with a point grid