Re: How to use matlab to do interval arithmetic(or range arithmetic)?



In article <ftbk8d$27n$1@xxxxxxxxxxxxxxxxxx>, Yi <hvachy@xxxxxxx> wrote:
Supposing
A~[-1 1]:means minimum A=-1 maximum A=1;
B~[4 6]:means minimum B=4,maximum B=6;
C~[100 200]:means minimum C=100,maximum C=100;

How to get the interval of f=A*B-C+....

I want to develope a general code for these kind of
problems.

One thing you are going to need to decide: when a name (a variable)
appears more than once in the formula, does it represent the
same value at each place, or does it represent a possibly different
value at each place?

For example, take the simple A / A over [-2 -1]. Does that
evaluate to [1] (the interval containing only 1), or does it
evaluate to [-1/-2 -2/-1] (i.e, [1/2 2]) ?

Also, you need to decide what to do about singularities. For example
if A is [-1 1] and you have chosen the "same value at all places"
interpretation, then A / A is [1] except for the possibility that A
was 0; with 0/0 being undefined, A/A would be the set {1, undefined}.
You can come up with similar scenarios in which the expression
has a nice well-contained range, except that it has a singularity
at which it becomes one of the infinities.


Maple has range arithmetic; it chose the "a name represents
a possibly different value each time" interpretation, which is
a lot easier to process, but is frustrating to deal with for
many situations that you want interval arithmetic for.


Note that if you chose "a name represents the same value
each time it occurs", then if the input is a polynomial, in
order to get the correct range, you would have to calculate the
minima and maxima of the polynomial over the range -- which would
most easily be handled by calculating the first derivative of the
polynomial, solving for zeros (which might not be symbolically
possible if the polynomial was degree 5 or higher), and taking
the second derivative to figure out which class each of the
solution points is (minima, maxima, saddle-point). That's probably
why Maple chose the other (less useful) interpretation -- less work!!


You should give consideration to allowing an additional
notation on your inputs. One type of work for which interval
arithmetic is used a fair bit is for error analysis in scientific
formulae, for which the input numbers would tend to be
written as A +/- B (e.g., 6.023E-23 +/- 0.002E-23).
This is convertable to your [] notation, but users would generally
find it inconvenient to do the conversion themselves.

Another common use for interval arithmetic is in being given
rounded numbers, and asked to calculate the significance of the
rounding -- i.e., to take a range +/- 0.5 on the last written
digit. It's a nuisance to the user to have to put in those ranges
manually.
--
"Style is instinctive and few achieve it in a notable degree. Its
development is not hastened by instruction. It comes or it doesn't.
It will take care of itself." -- Walter J. Phillips
.



Relevant Pages

  • Re: RfD -- FVALUE vsn 2.0
    ... especially where notation is concerned. ... which is how to specify the compilation ... variable toing toing off ...
    (comp.lang.forth)
  • Re: Question regard implication and being a theorem of FOL.
    ... Let F and G be any wff. ... That notation doesn't make sense. ... And it IS the case that every interpretation that satisifes {F&~F ... What we mean by 'G is proven from a contradiction', ...
    (sci.logic)
  • Re: Bit field types and promotions
    ... >> promoted to one of the int types, and types longer than an int type ... > - If both operands have the same type, then no further conversion is ... > (your interpretation) ... if both operands have signed integer types or both have ...
    (comp.std.c)
  • Re: Bit field types and promotions
    ... >> full-sized standard integer types, i.e, unsigned long long. ... > promoted to one of the int types, and types longer than an int type ... - If both operands have the same type, then no further conversion is ... (your interpretation) ...
    (comp.std.c)
  • Re: Why does everyone do it?
    ... It means that there is an interpretation of x in the structure N such ... DATA CONVERSION is very much commonplace, when working with computers. ... history is being made here. ...
    (sci.math)

Loading