Re: A question on interval arithmetic
- To: mathgroup at smc.vnet.net
- Subject: [mg43717] Re: [mg43691] A question on interval arithmetic
- From: Daniel Lichtblau <danl at wolfram.com>
- Date: Thu, 2 Oct 2003 02:51:11 -0400 (EDT)
- References: <200309302042.QAA25624@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
Oliver Friedrich wrote: > > Hallo, > > the resistance of 2 resistors in parallel is r1*r2/(r1+r2). Now I want to > introduce tolerances in the resistors and ask for the range of resistance > of the combination. One may think that e.g > > (r1*r2)/(r1+r2)/.{r1->Interval[{10,20}],r2->Interval[{20,40}]} > > would lead to the correct result, but there's a trap. If I replace the > expressions by the intervals, Mathematica evaluates the new expression assuming > that all four intervals are independant from each other. And that's not > correct. Taken either the minimum or the maximum from a certain interval , > Mathematica should stick to that, because it is nonsense to take Min[r1] and Max > [r1] within the same expression, r1 can have only one value at a time. > > How can I avoid this problem? > > Oliver Friedrich The Interval arithmetic is certainly "correct" insofar as it does exactly what it was designed to do. What that is happens not to be what you require for this particular problem. For your purpose you might use Minimize and Maximize subject to constraints that put the variables in the desired ranges. In[8]:= rat=(r1*r2)/(r1+r2); {Minimize[{rat,{10<=r1<=20,20<=r2<=40}},{r1,r2}], Maximize[{rat,{10<=r1<=20,20<=r2<=40}},{r1,r2}]} Out[9]= {{20/3, {r1 -> 10, r2 -> 20}}, {40/3, {r1 -> 20, r2 -> 40}}} Daniel Lichtblau Wolfram Research