This may happen on the first request due to CSS mimetype issues. Try clearing your browser cache and refreshing.

--- a/doc/simp.lyx +++ b/doc/simp.lyx @@ -43,6 +43,10 @@ Single Interval Mathematics Package for Octave \end_layout +\begin_layout Author +Simone Pernice +\end_layout + \begin_layout Standard \newpage @@ -68,7 +72,7 @@ \end_layout \begin_layout Standard -I am Simone Pernice and I am the writer of the SIMP package. +I am Simone Pernice the writer of the SIMP package. If you find any bug or you want to add features, you can contact me at pernice@libero.it. You can find further details on my web site: simonepernice.freehostia.com @@ -82,6 +86,11 @@ Version 1.0, Turin 14th December 2008, initial draft \end_layout +\begin_layout Itemize +Version 1.1, Palermo 2nd January 2009, few fixes to the documentation and + added the new function intFormInt +\end_layout + \begin_layout Section Preface \end_layout @@ -90,30 +99,69 @@ I am an electrical engineer, I worked both on hardware and software fields. Designing an electrical circuit is quite complex because the characteristics of the components involved have huge tolerance some about 5%, while others - 80%. + 50%. The target is to have the circuit working in the worst case of the components and of the environment! That involves to compute several times the same equation putting inside the worst or best case values. - Some time ago I was doing the usual design when I though, what if I use - intervals instead of numbers: I may get the results in just one step! Then - I went on the Internet looking for Interval Mathematics: I discovered it - was invented in the '50s. - Eventually I looked for an open source calculator able to manage intervals - instead of numbers. + Some time ago I was designing a simple circuit when I though: +\begin_inset Quotes eld +\end_inset + +What if I use intervals instead of numbers? I may get the best and worst + case in just one step! +\begin_inset Quotes erd +\end_inset + +. + Then I looked on the Internet for Interval Mathematics: I discovered it + was invented in the '50s +\begin_inset LatexCommand cite +key "key-1" + +\end_inset + +. + Although its not very spread it is a powerful tool: a calculator with finite + precision can be used to compute calculus requiring infinite precision + because the solution is a range where the actual value lay. + +\end_layout + +\begin_layout Standard +Therefore I looked for an open source calculator able to manage intervals + instead of real numbers. Unfortunately I was not able to find anything. - There are just some libraries for C++ language and packages for proprietary + There are just few libraries for the C++ language and packages for proprietary software. - I was thinking to develop a calculator on my own, but I was not that happy - because it would have required a lot of effort. - Then I discovered Octave. - After a look at its tutorial I decided to write a package to work on intervals - in Octave. - It was the right choice, because it took just three days to make SIMP while + I was thinking to develop a calculator on my own, but it would have required + a lot of effort and long time. + Then I discovered Octave +\begin_inset LatexCommand cite +key "key-6" + +\end_inset + +. + By the way Octave is a great tool that can be used by every engineer for + its daily work. + After a look at Octave's tutorial +\begin_inset LatexCommand cite +key "key-3" + +\end_inset + + I decided to write a package to work on intervals in Octave. + It was the right choice, because it took just three days to make it while building a new program from scratch would have taken weeks. The package extends the basic arithmetic functions to single interval mathemati cs, it is called SIMP. - Unfortunately it is not possible to overload Octave operators with m files, - therefore I made new functions working on matrix for that purpose. + As far as I know it is not possible to overload Octave operators with m + script files, therefore I made new functions working on matrix to extend + the basic operations to intervals. + In Octave it is possible to write the first few chars of a function and + then push the TAB key to get the list of the functions compatible. + Moreover it is really simple to build intermediate variables. + That makes not too long using the SIMP functions for standard calculations. \end_layout \begin_layout Standard @@ -145,7 +193,7 @@ \end_inset - shows some example to explain how the SIMP package can be used. + shows some examples to explain how the SIMP package can be used. Eventually the \begin_inset LatexCommand prettyref reference "sec:Functions" @@ -163,6 +211,27 @@ \end_inset +\end_layout + +\begin_layout Standard +SIMP is a simple interval calculator. + Intervals can be used instead of floating point number to automatically + take into account the tolerance of the values used in calculation. + All functions can be extended to interval: therefore it is possible to + apply all the functions to intervals to get the final result as an interval. + If you understand what intervals are, you can go directly to +\begin_inset LatexCommand prettyref +reference "sec:Single-Interval-Mathematics" + +\end_inset + + to read some examples and then to +\begin_inset LatexCommand prettyref +reference "sec:Functions" + +\end_inset + + to see all the functions available. \end_layout \begin_layout Standard @@ -192,8 +261,8 @@ \end_layout \begin_layout Enumerate -Some values have an infinite number of digits after the decimal point, like - for +Some values have an infinite number of digits after the decimal point (real + number), like for \begin_inset Formula $\pi$ \end_inset @@ -201,9 +270,9 @@ \end_layout \begin_layout Enumerate -Some values change with time or samples or whatever, like the weight of +Some values change with time or samples (or whatever), like the weight of a person (which can change of 5% during a day) or the current gain of a - BJT (which can change of 50% from the samples of the same series); + BJT (which can change of 50% on the samples of the same series); \end_layout \begin_layout Enumerate @@ -228,7 +297,7 @@ \end_layout \begin_layout Standard -Here there are two errors: the circumference is knows with the tolerance +Here there are two errors: the circumference is known within the tolerance given by your meter, moreover \begin_inset Formula $\pi$ \end_inset @@ -239,13 +308,14 @@ buy a new pipe in a hardware shop. However the not infinite accuracy of those operation avoid the use of computers as automatic theorem demonstration tools and so on... -\end_layout - -\begin_layout Standard -This kind of issue is quite common on engineer design. + This kind of issue is quite common on engineer design. What engineers do is to be sure their design will work in the worst case or in most of the cases (usually more than 99.9%). - Here a simple example. + +\end_layout + +\begin_layout Standard +Here a simple example follows. Let us say you want to repaint the walls of your living room completely messed up by your children. You need to compute how many paint cans you need to buy. @@ -272,15 +342,16 @@ \end_layout \begin_layout Itemize -roomWidth = 6 -\end_layout - -\begin_layout Itemize -steps roomLength = 4 -\end_layout - -\begin_layout Itemize -steps roomHeight = 3 +roomWidth = 6 (from 5.4m to 6.6m) +\end_layout + +\begin_layout Itemize +steps roomLength = 4 (from 3.6m to 4.4m) +\end_layout + +\begin_layout Itemize +steps roomHeight = 3 (it is assumed correct because its tolerance is much + smaller than the other pieces) \end_layout \begin_layout Itemize @@ -289,7 +360,8 @@ \end_layout \begin_layout Itemize -paintLitersPerCan = 40 +paintLitersPerCan = 40 (it is assumed correct because its tolerance is much + smaller than the other pieces) \end_layout \begin_layout Standard @@ -314,9 +386,9 @@ \begin_layout Standard Are you satisfied with that result? I am not. - What if I have underestimated something? As every good engineer I would - check what happens in the worst case, which means 1.1m step and efficiency - of just 0.8. + What if I have underestimated something? As every engineer I would check + what happens in the worst case, which means 1.1m step and efficiency of + just 0.8. Again just substituting those values in \begin_inset LatexCommand eqref reference "eq:paintCans" @@ -367,14 +439,30 @@ \end_layout \begin_layout Standard -As you can see in the example above a lot of computations are required to - get an idea of the result. - To get the worst (and sometime it is required also the best) case, you - need to think carefully at the equation because some time you need to put - the higher value (for steps) while other times the smallest (for efficiency) - to get the worst case and vice versa for the best. +As you saw in the example above a lot of computations are required to get + an idea of the range where the result of the equation lay. + To get the worst case, you need to think carefully at the equation because + some time you need to put the higher value (like for steps in +\begin_inset LatexCommand prettyref +reference "eq:paintCans" + +\end_inset + +) while other times the smallest (like for efficiency in +\begin_inset LatexCommand prettyref +reference "eq:paintCans" + +\end_inset + +) to get the worst case and vice versa for the best. There is a much simpler way to work with that issue. - You can use intervals instead of number. + You can use intervals instead of number +\begin_inset LatexCommand cite +key "key-1,key-2" + +\end_inset + +. An interval is: \end_layout @@ -397,9 +485,18 @@ \end_inset ). - Moreover if it is correct to use a number, it is possible to use a degenerate + +\end_layout + +\begin_layout Standard +Moreover when it is correct to use a number, it is possible to use a degenerate interval like [a, a]. - It is possible also to define functions that work on interval instead of + That means intervals can replace real numbers in every computation. + +\end_layout + +\begin_layout Standard +It is possible also to define functions that work on intervals instead of numbers: \end_layout @@ -419,25 +516,27 @@ \end_layout \begin_layout Standard -Note also sometime a function may generate several intervals as result, - but in this package we will concentrate on single interval function. - I will give you an example: +Note also sometime a function may generate several intervals as result. + As an example consider the following division: \begin_inset Formula $[4,4]/[-2,2]=[-\infty,-2]\cup[2,+\infty]$ \end_inset -. - However the result is a double interval, for that reason if you try to - divide for a interval containing 0 in SIMP, you will get an error. -\end_layout - -\begin_layout Standard -Eventually note that usually compute the interval result of a function applied - to intervals is a long task. - Therefore sometime we are satisfied by a bigger interval containing the - correct interval. - However the target is always to get the smallest interval containing the - solution. - In the example above you would have: +, it generates two interval as result. + However SIMP works only on single interval function, for that reason if + you try to divide for a interval containing 0 in SIMP, you will get an + error. +\end_layout + +\begin_layout Standard +Eventually note that usually computing the interval result of a function + applied to intervals requires a lot of steps. + Therefore sometime we may be satisfied to find, in a short time, a bigger + interval containing the smallest interval where the solution must lay. + +\end_layout + +\begin_layout Standard +In the example above you would have: \end_layout \begin_layout Itemize @@ -480,7 +579,14 @@ \end_layout \begin_layout Standard -There are few issues you need to know about interval computations. +There are few issues you need to know about interval computations because + they do not happen in standard mathematics +\begin_inset LatexCommand cite +key "key-2" + +\end_inset + +. \end_layout @@ -499,7 +605,7 @@ \end_inset ) can be written in several ways. - If the dimensions of the rectangle are b end h we can write: + If the dimensions of the rectangle are b and h we can write: \end_layout \begin_layout Standard @@ -541,8 +647,8 @@ \begin_layout Standard What is important to remember is that: \emph on -Every variable should appear just once in the equation if possible in order - to get the smallest interval possible as result. +Every variable should appear just once in the equation (if possible) in + order to get the smallest interval possible as result. \end_layout \begin_layout Subsection @@ -550,15 +656,17 @@ \end_layout \begin_layout Standard -The result of a set of equation involving intervals is +The result of a set of simultaneous equations involving intervals is \emph on always \emph default - an Hyper-cube. - For example if we have just two equations in the unknowns x and y the result - will be a couple of intervals which draw a rectangle on the Cartesian plane. - However in general the solution will be smaller, for example just a segment. - In that case the rectangle will contain the solution. + an hyper-cube. + For example if we have two simultaneous equations in the unknowns x and + y the result will be a couple of intervals which draw a rectangle on the + Cartesian plane. + However the solution of a couple of simultaneous equations may be smaller, + for example a segment on the Cartesian plane. + In that case the rectangle will contain the segment. There is no way to solve that, just remember the solution is usually a super set of the actual one. \end_layout @@ -574,18 +682,61 @@ \end_layout \begin_layout Subsection -Installation -\end_layout - -\begin_layout Standard -First of all you have to install the SIMP package in Octave, so that Octave - will automatically load the new functions at every start. +How to run SIMP in Octave +\end_layout + +\begin_layout Standard +Octave +\begin_inset LatexCommand cite +key "key-6" + +\end_inset + + is a powerful numeric calculator, which is what is required for design. + It is open source and freely available on a lot of platform. + I suggest to play with Octave to understand its basic functions +\begin_inset LatexCommand cite +key "key-3,key-4" + +\end_inset + + before using SIMP package. + +\end_layout + +\begin_layout Subsubsection +Install SIMP +\end_layout + +\begin_layout Standard +First of all you have to install the SIMP package in Octave. To do that just run Octave from the directory where was downloaded the package and execute the following command: \end_layout \begin_layout Itemize pkg install simp.tar.gz +\end_layout + +\begin_layout Standard +From the next execution of Octave, it will automatically load the new functions. + Therefore SIMP functions will be available as the standard Octave ones. +\end_layout + +\begin_layout Subsubsection +Remove SIMP +\end_layout + +\begin_layout Standard +If for some reason you want to remove the SIMP package, you can write: +\end_layout + +\begin_layout Itemize +pkg uninstall simp.tar.gz +\end_layout + +\begin_layout Standard +From the next execution of Octave all the SIMP functions will not be available. \end_layout \begin_layout Subsection @@ -596,7 +747,7 @@ SIMP works on matrix, interpreted as intervals. The basic interval is: [min, max], which in Octave is a row vector made by two elements. - The added functions work on those matrix. + The added functions work on those matrixes. For example to add the intervals [5.4, 6.6] and [3.6, 4.4] it is possible to write: \end_layout @@ -611,6 +762,15 @@ \begin_layout Standard addInt stands for add intervals. + All SIMP functions end with the word +\begin_inset Quotes eld +\end_inset + +Int +\begin_inset Quotes erd +\end_inset + +. It is possible to use scalar number instead of intervals. Every scalar is computed like: \begin_inset Formula $s=[s,s]$ @@ -657,7 +817,7 @@ \end_layout \begin_layout Standard -Now we know enough from Octave to compute the equation +Now we know enough Octave syntax to compute the equation \begin_inset LatexCommand ref reference "eq:paintCans" @@ -689,8 +849,9 @@ \begin_layout Standard Sometime the intervals are expressed in terms of tolerance. - The electronic resistors are sold in several tolerances: 1%, 2%, 5%. - There is a function to easily make an interval from a tolerance. + The electronic resistors are sold in several tolerance classes: 1%, 2%, + 5%. + There is a SIMP function to easily make an interval from a tolerance. For example a resistor of 10KOhms with 5% of tolerance can be converted in an interval: \end_layout @@ -716,9 +877,45 @@ \end_layout \begin_layout Standard -All the computations are done among intervals, therefore if a result with - tolerance is required it is possible to get back the value and tolerance - of an interval in the hypothesis that the tolerance is symmetrical: +It is also possible to convert values from engineer notation to interval: +\end_layout + +\begin_layout Itemize +intFormInt([ +\begin_inset Quotes eld +\end_inset + +10K+-5% +\begin_inset Quotes erd +\end_inset + +) +\end_layout + +\begin_layout Description +> ans = [9500, 10500] +\end_layout + +\begin_layout Itemize +intFormInt([ +\begin_inset Quotes eld +\end_inset + +10K+5%-10% +\begin_inset Quotes erd +\end_inset + +) +\end_layout + +\begin_layout Description +> ans = [9000, 10500] +\end_layout + +\begin_layout Standard +All the computations are done among intervals in SIMP. + Therefore there is a SIMP function to convert an interval in engineer notation + (in the hypothesis that the tolerance is symmetrical): \end_layout \begin_layout Itemize @@ -726,7 +923,15 @@ \end_layout \begin_layout Description -> 10K+-5% +> ans = +\begin_inset Quotes eld +\end_inset + +10K+-5% +\begin_inset Quotes erd +\end_inset + + \end_layout \begin_layout Standard @@ -734,7 +939,7 @@ to compute functions. It is possible to compute operation on vectors of the same size (element by element) or scalar by vector. - In that case the scalar is expanded in a vector of the sime size of the + In that case the scalar is expanded to a vector of the same size of the others. That is really useful for the functions where a x vector can be used to compute a y in just one time. @@ -781,7 +986,7 @@ \end_layout \begin_layout Standard -As you can see SMIP can be used just like a calculator. +As you can see SIMP can be used just like a calculator. The basic operations are applied on intervals instead of scalar. That makes really simple to evaluate equations where some data is uncertain. \end_layout @@ -797,7 +1002,7 @@ \end_layout \begin_layout Standard -This section describe the functions provided in the package. +This section describes the functions provided in the SIMP package. \end_layout \begin_layout Subsection @@ -805,272 +1010,539 @@ \end_layout \begin_layout Standard -An interval is described by a matrix with two columns and a row. +All the SIMP functions work on vector of intervals as input. + +\end_layout + +\begin_layout Standard +A vector of intervals is a matrix with two columns and many rows: every + row describes an interval. The matrix is composed by real numbers. +\end_layout + +\begin_layout Standard +An interval is a degenerate vector with two columns and only one row. The first value is the interval minimum, the second is the interval maximum. - A real number is interpreted like an interval with the same maximum and - minimum. - It is also possible to write a vector of intervals: it is a matrix with - two columns and n rows, where every row is an interval. -\end_layout - -\begin_layout Subsection -addInt (a, b, c, ...) + Therefore [1.1, 2.1] is an interval with 1.1 as lower boundary and 2.1 as upper + boundary. +\end_layout + +\begin_layout Standard +A real number is meant as a case of degenerate interval with maximum and + minimum values coincident. + Therefore 5 is like [5, 5]. +\end_layout + +\begin_layout Standard +It is useful working on vector because the same operation can be applied + to several intervals in one step. + All the vectors involved must have the same number of rows (intervals), + with the exception of scalar and single interval. + They are automatically expanded to the number of rows (intervals) that + matches the other inputs. +\end_layout + +\begin_layout Subsection +valtol100ToInt (v1, ptol, ntol) +\begin_inset LatexCommand label +name "sub:valtol100ToInt-(v,-ptol," + +\end_inset + + +\end_layout + +\begin_layout Standard +valtol100ToInt produces an interval with center value given by the scalar + v1, and positive and negative tolerance express in percentage given by + ptol and ntol. + ntol is optional, if ntol is not present it is assumed equal to -ptol. +\end_layout + +\begin_layout Subsection +intToTol (v1) +\end_layout + +\begin_layout Standard +intToTol produces the tolerance of the vector of interval v1, in the hypothesis + that the actual value is in the average point between minimum and maximum. + +\end_layout + +\begin_layout Subsection +intToTol100 (v1) +\end_layout + +\begin_layout Standard +intToTol100 produces the tolerance (expressed in percentage) of the vector + of interval v1, in the hypothesis that the actual value is in the average + point between minimum and maximum. +\end_layout + +\begin_layout Subsection +intToVal (v1) +\end_layout + +\begin_layout Standard +intToVal produces the central value of the vector of intervals v1, in the + hypothesis that the actual value is in the average point. +\end_layout + +\begin_layout Subsection +engFormInt (v1) +\begin_inset LatexCommand label +name "sub:engFormInt-(a)" + +\end_inset + + +\end_layout + +\begin_layout Standard +engFormInt returns a vector of strings representing the intervals in the + vector v1 in engineer notation. + As value it returns the average between minimum and maximum which means + symmetric tolerance. +\end_layout + +\begin_layout Standard +The engineer notation is obtained finding the exponent (multiple of three) + so that the mantissa is between 1 and 1000, then the exponent is converted + into a letter as per the following list: +\end_layout + +\begin_layout Itemize +Y = +\begin_inset Formula $10^{24}$ +\end_inset + + +\end_layout + +\begin_layout Itemize +Z = +\begin_inset Formula $10^{21}$ +\end_inset + + +\end_layout + +\begin_layout Itemize +E = +\begin_inset Formula $10^{18}$ +\end_inset + + +\end_layout + +\begin_layout Itemize +P = +\begin_inset Formula $10^{15}$ +\end_inset + + +\end_layout + +\begin_layout Itemize +T = +\begin_inset Formula $10^{12}$ +\end_inset + + +\end_layout + +\begin_layout Itemize +G = +\begin_inset Formula $10^{9}$ +\end_inset + + +\end_layout + +\begin_layout Itemize +M = +\begin_inset Formula $10^{6}$ +\end_inset + + +\end_layout + +\begin_layout Itemize +K = +\begin_inset Formula $10^{3}$ +\end_inset + + +\end_layout + +\begin_layout Itemize +nothing = +\begin_inset Formula $10^{0}$ +\end_inset + + +\end_layout + +\begin_layout Itemize +m = +\begin_inset Formula $10^{-3}$ +\end_inset + + +\end_layout + +\begin_layout Itemize +u = +\begin_inset Formula $10^{-6}$ +\end_inset + + +\end_layout + +\begin_layout Itemize +n = +\begin_inset Formula $10^{-9}$ +\end_inset + + +\end_layout + +\begin_layout Itemize +p = +\begin_inset Formula $10^{-12}$ +\end_inset + + +\end_layout + +\begin_layout Itemize +f = +\begin_inset Formula $10^{-15}$ +\end_inset + + +\end_layout + +\begin_layout Itemize +a = +\begin_inset Formula $10^{-18}$ +\end_inset + + +\end_layout + +\begin_layout Itemize +z = +\begin_inset Formula $10^{-21}$ +\end_inset + + +\end_layout + +\begin_layout Itemize +y = +\begin_inset Formula $10^{-24}$ +\end_inset + + +\end_layout + +\begin_layout Standard +Eventually the tolerance is added in form of percentage: +\begin_inset Quotes eld +\end_inset + ++- +\begin_inset Quotes erd +\end_inset + + tolerance in percentage +\begin_inset Quotes eld +\end_inset + +% +\begin_inset Quotes erd +\end_inset + +. + Please note that the tolerance is symmetric which is not always the actual + case. + For example engFormInt([9500, 10500]) = +\begin_inset Quotes eld +\end_inset + +10K+-10% +\begin_inset Quotes erd +\end_inset + +. + +\end_layout + +\begin_layout Standard +Note that with other functions ( +\begin_inset LatexCommand prettyref +reference "sub:valtol100ToInt-(v,-ptol," + +\end_inset + +) it is possible to define intervals with not symmetric tolerance, they + will not be converted properly back by +\begin_inset LatexCommand prettyref +reference "sub:engFormInt-(a)" + +\end_inset + +. +\end_layout + +\begin_layout Subsection +intFormInt (string) +\end_layout + +\begin_layout Standard +intFormInt returns a vector of intervals given a vector of strings (or a + single string) representing the number in engineer notation. + See +\begin_inset LatexCommand prettyref +reference "sub:engFormInt-(a)" + +\end_inset + + for details on engineer notation. + For example intFormInt( +\begin_inset Quotes eld +\end_inset + +10K+-10% +\begin_inset Quotes erd +\end_inset + +) = [9500, 10500]. + +\end_layout + +\begin_layout Standard +Although it is not orthogonal to +\begin_inset LatexCommand prettyref +reference "sub:engFormInt-(a)" + +\end_inset + +, it evaluates also expression with not symmetric tolerance: 10K+5%-10% + is converted to [9000, 10500]. + That was done because not symmetric tolerance is quite common in practice. +\end_layout + +\begin_layout Subsection +addInt (v1, v2, v3, ...) \end_layout \begin_layout Standard addInt adds the given vector of intervals. It returns -\begin_inset Formula $a+b+c+\ldots$ +\begin_inset Formula $v1+v2+v3+\ldots$ \end_inset . - They must have the same number of rows or be scalars. + They must have the same number of rows or be single interval or be scalars. At least two vectors are required. \end_layout \begin_layout Subsection -negateInt (a) +negateInt (v1) \end_layout \begin_layout Standard negateInt negates the given vector of intervals. It returns -\begin_inset Formula $-a$ -\end_inset - -. -\end_layout - -\begin_layout Subsection -subInt (a, b, c, ...) +\begin_inset Formula $-v1$ +\end_inset + +. +\end_layout + +\begin_layout Subsection +subInt (v1, v2, v3, ...) \end_layout \begin_layout Standard subInt subtracts the given vector of intervals. It returns -\begin_inset Formula $a-b-c-\ldots$ +\begin_inset Formula $v1-v2-v3-\ldots$ \end_inset . - They must have the same number of rows or be scalar. + They must have the same number of rows or be single interval or be scalar. At least two vectors are required. \end_layout \begin_layout Subsection -mulInt (a, b, c, ...) +mulInt (v1, v2, v3, ...) \end_layout \begin_layout Standard mulInt multiplies the given vector of intervals. It returns -\begin_inset Formula $a\cdot b\cdot c\cdot\ldots$ +\begin_inset Formula $v1\cdot v2\cdot v3\cdot\ldots$ \end_inset . - They must have the same number of rows or be scalar. + They must have the same number of rows or be single interval or be scalar. At least two vectors are required. \end_layout \begin_layout Subsection -invertInt (a) +invertInt (v1) \end_layout \begin_layout Standard invertInt inverts the given vector of intervals. It returns -\begin_inset Formula $\frac{1}{a}$ -\end_inset - -. -\end_layout - -\begin_layout Subsection -invertAddInt (a, b, c, ...) +\begin_inset Formula $\frac{1}{v1}$ +\end_inset + +. +\end_layout + +\begin_layout Subsection +invertAddInt (v1, v2, v3, ...) \end_layout \begin_layout Standard invertAddInt adds the inverse of the given vector of intervals and then inverts again the result. It returns -\begin_inset Formula $\frac{1}{\frac{1}{a}+\frac{1}{b}+\frac{1}{c+\ldots}}$ -\end_inset - -. - They must have the same number of rows or be scalar. +\begin_inset Formula $\frac{1}{\frac{1}{v1}+\frac{1}{v2}+\frac{1}{v3}+\cdots}$ +\end_inset + +. + They must have the same number of rows or be single interval or be scalar. At least two vectors are required. \end_layout \begin_layout Subsection -divInt (a, b, c, ...) +divInt (v1, v2, v3, ...) \end_layout \begin_layout Standard divInt divides the given vector of intervals. It returns -\begin_inset Formula $\frac{\frac{a}{b}}{c}\ldots$ +\begin_inset Formula $\frac{\frac{v1}{v2}}{v3}\ldots$ \end_inset . - They must have the same number of rows or be scalar. + They must have the same number of rows or be single interval or be scalar. + The vectors v2, v3, ... + must not include 0. At least two vectors are required. \end_layout \begin_layout Subsection -powerInt (a, n) +powerInt (v1, n) \end_layout \begin_layout Standard powerInt rise the given vector of intervals to the power of n. It returns -\begin_inset Formula $a^{n}$ -\end_inset - -. -\end_layout - -\begin_layout Subsection -sqrInt (a) +\begin_inset Formula $v1^{n}$ +\end_inset + +. +\end_layout + +\begin_layout Subsection +sqrInt (v1) \end_layout \begin_layout Standard sqrInt squares the given vector of intervals. It returns -\begin_inset Formula $a^{2}$ -\end_inset - -. -\end_layout - -\begin_layout Subsection -sqrtInt (a) +\begin_inset Formula $v1^{2}$ +\end_inset + +. +\end_layout + +\begin_layout Subsection +sqrtInt (v1) \end_layout \begin_layout Standard sqrtInt square roots the given vector of intervals. It returns -\begin_inset Formula $\sqrt{a}$ -\end_inset - -. -\end_layout - -\begin_layout Subsection -sqrAddInt (a, b, c, ...) +\begin_inset Formula $\sqrt{v1}$ +\end_inset + +. +\end_layout + +\begin_layout Subsection +sqrAddInt (v1, v2, v3, ...) \end_layout \begin_layout Standard addSqrInt adds the square of the given vector of intervals and then it squares root the result. It returns -\begin_inset Formula $\sqrt{a^{2}+b^{2}+c^{2}+\ldots}$ -\end_inset - -. - They must have the same number of rows or be scalar. +\begin_inset Formula $\sqrt{v1^{2}+v2^{2}+v3^{2}+\ldots}$ +\end_inset + +. + They must have the same number of rows or be single interval or be scalar. At least two vectors are required. \end_layout \begin_layout Subsection -engFormInt (a) -\end_layout - -\begin_layout Standard -engFormInt prints the intervals in the vector a in engineer format. - It prints the average between minimum and maximum expressed with engineer - notation and add the tolerance in percentage. -\end_layout - -\begin_layout Subsection -dB10ToLinInt (a) -\end_layout - -\begin_layout Standard -db10ToLinInt rises 10 to the power of a tens. +dB10ToLinInt (v1) +\end_layout + +\begin_layout Standard +db10ToLinInt rises 10 to the power of v1 tens. It returns -\begin_inset Formula $10^{\frac{a}{10}}$ -\end_inset - -. -\end_layout - -\begin_layout Subsection -linToDB10Int (a) -\end_layout - -\begin_layout Standard -linToDB10Int produces 10 times the logarithm of a. +\begin_inset Formula $10^{\frac{v1}{10}}$ +\end_inset + +. +\end_layout + +\begin_layout Subsection +linToDB10Int (v1) +\end_layout + +\begin_layout Standard +linToDB10Int produces 10 times the logarithm of v1. It returns -\begin_inset Formula $10log_{10}(a)$ -\end_inset - -. -\end_layout - -\begin_layout Subsection -dB20ToLinInt (a) -\end_layout - -\begin_layout Standard -db10ToLinInt rises 10 to the power of a twenties. +\begin_inset Formula $10log_{10}(v1)$ +\end_inset + +. +\end_layout + +\begin_layout Subsection +dB20ToLinInt (v1) +\end_layout + +\begin_layout Standard +db10ToLinInt rises 10 to the power of v1 twenties. It returns -\begin_inset Formula $10^{\frac{a}{20}}$ -\end_inset - -. -\end_layout - -\begin_layout Subsection -linToDB20Int (a) -\end_layout - -\begin_layout Standard -linToDB10Int produces 20 times the logarithm of a. +\begin_inset Formula $10^{\frac{v1}{20}}$ +\end_inset + +. +\end_layout + +\begin_layout Subsection +linToDB20Int (v1) +\end_layout + +\begin_layout Standard +linToDB10Int produces 20 times the logarithm of v1. It returns -\begin_inset Formula $20log_{10}(a)$ -\end_inset - -. -\end_layout - -\begin_layout Subsection -valtol100ToInt (v, ptol, ntol) -\end_layout - -\begin_layout Standard -valtol100ToInt produces an interval with center value given by the scalar - v, and positive and negative tolerance express in percentage given by ptol - and ntol. - ntol is optional, if not present it is assumed equal to ptol. -\end_layout - -\begin_layout Subsection -intToTol (a) -\end_layout - -\begin_layout Standard -intToTol produces the tolerance of the vector of interval a, in the hypothesis - that the actual value is in the average point. - -\end_layout - -\begin_layout Subsection -intToTol100 (a) -\end_layout - -\begin_layout Standard -intToTol100 produces the tolerance (expressed in percentage) of the vector - of interval a, in the hypothesis that the actual value is in the average - point. -\end_layout - -\begin_layout Subsection -intToVal (a) -\end_layout - -\begin_layout Standard -intToVal produces the central value of the vector of intervals a, in the - hypothesis that the actual value is in the average point. +\begin_inset Formula $20log_{10}(v1)$ +\end_inset + +. \end_layout \begin_layout Subsection @@ -1104,8 +1576,8 @@ \end_layout \begin_layout Standard -monotonicFunctionInt produces the y interval obtained applying the monotonic - function f to the interval x. +monotonicFunctionInt produces the y vector of interval obtained applying + the monotonic function f to the vector of interval x. If f is not monotonic, y may be wrong. \end_layout @@ -1114,8 +1586,8 @@ \end_layout \begin_layout Standard -functionInt try to produces the y interval obtained applying the function - f to the interval x. +functionInt try to produces the y vector of interval obtained applying the + function f to the vector of interval x. The function is checked for monotonicity on the given number of point. nOfPoint is optional, default is 10. \end_layout @@ -1125,7 +1597,8 @@ \end_layout \begin_layout Standard -plotInt plots two curves. +plotInt plots the interval of vector y respect to the interval of vector + x. Those curves, for every x interval center point, goes through ymin and ymax. x and y must have the same rows. @@ -1139,23 +1612,58 @@ For every x center point, plots the y tolerance. \end_layout +\begin_layout Standard + +\newpage + +\end_layout + \begin_layout Section Biography \end_layout -\begin_layout Enumerate +\begin_layout Bibliography +\begin_inset LatexCommand bibitem +key "key-1" + +\end_inset + http://en.wikipedia.org/wiki/Interval_arithmetic \end_layout -\begin_layout Enumerate +\begin_layout Bibliography +\begin_inset LatexCommand bibitem +key "key-2" + +\end_inset + http://www.cs.utep.edu/interval-comp/hayes.pdf \end_layout -\begin_layout Enumerate +\begin_layout Bibliography +\begin_inset LatexCommand bibitem +key "key-6" + +\end_inset + +http://www.octave.org +\end_layout + +\begin_layout Bibliography +\begin_inset LatexCommand bibitem +key "key-3" + +\end_inset + http://www-mdp.eng.cam.ac.uk/web/CD/engapps/octave/octavetut.pdf \end_layout -\begin_layout Enumerate +\begin_layout Bibliography +\begin_inset LatexCommand bibitem +key "key-4" + +\end_inset + http://www.gnu.org/software/octave/docs.html \end_layout