The Invisible Variable

Valery Ochkov http://twt.mpei.ac.ru/ochkov

ochkov@twt.mpei.ac.ru

This paper is about a peculiar issue in IT (Information Technology) - is it possible and relevant to have invisible symbols on the screen interface. As you will see from the following examples, it is possible and makes a lot of sense, because it improves the readability and gives human interface to the computer document.

Example 1. Invisible adding

The picture 1. Invisible adding

The picture 1a. Built-in invisible adding

Example 2. Zero dimension value

The picture 2. Zero dimension value

Example 3. Degree Celsius and decibels

The picture 3. Work with degrees Celsius and Fahrenheit

The picture 3a. Work with decibels

Example 4. Roman arithmetic

The picture 4. Work with Roman numeral

Example 5. Sparse matrix

The picture 5. Simulation of work with sparse matrix

Example 6. Infinite cycle

The picture 6. Infinite cycle in Mathcad

Example 7. Second name of the variable

The picture 7. Expanded name of Mathcad-variable

Preface

A famous novel by H.G. Wells[1] The Invisible Man inspired this paper about The Invisible Variable (Constant, Function, or Operator[2]). The author has a lot of practical experience with Mathcad - 1986-2000 MathSoft, Inc. and regardless that all the examples are based on this particular software they are applicable to the realm of IT.

In all software including Mathcad, the white color is paint, like any other color. Mathcad software gives a unique opportunity to its users. It allows changing colors of the variables, constants, functions, and operators [1]. So if we paint their color to white on white background, they will become invisible exactly like The Invisible Man, who becomes invisible when gets dressed.

Lets discuss the color in Mathcad documents. By default the Mathcad user writes in black, blue and white: mathematical expressions normally are black, text remarks normally are blue, both on white background. Color is one type of property. Another property is the font mathematical expressions are often written in Arial, and commentaries are often written in Times. It allows to tell legibly the difference between two types of objects on black and white hard copies: when you print with help of black and white printer in the illustrations of this article, for example[3]. By default the background of mathematical expressions and commentaries is white[4] (in black-blue and white). Color of this background user can change for green, for example[5]. Apart user of Mathcad has a right to change the background of single expressions. It may be done, for example, for turning reader attention to these expressions. On the contrary we can hide some expressions changing its background from white color to black one (invisible expressions we write in black and black [6]).

Mathematical expressions of Mathcad in its turn consist of above mentioned variables, functions and operators built-in and user ones. Styles[7] are given automatically to these objects when we input them with help of keyboard: constants get the style onstants, but variables, functions and operators get the style Variables. Apart built-in styles (Constants and Variables) there are seven user styles in Mathcad.

That allows in one Mathcad-document to have different objects with the same names owing to different styles:

:= 3 := 4 := A + A A = 3 A = 4 A = 7

In this example there is not one but three variables which keep their values 3, 4 and 7. Our example is artificial enough, but in real Mathcad-documents there are only two variables : one is user variable (the name of the variable is popular enough), the other is built-in one is unit of measure of current strength[8]. For we do not spoil ampere by the operator A = something, it is necessary to give to these two variables A different styles. But for we do not entangle we can change names of the same name variables with help of some attributes of a style: type (name) and/or size of print, its style[9] (general, demi-bold, italic) and/or its color. But the color may be white. Here it is the invisible variable heroine of our article[10]. In the roman by G.Wells the invisible man became invisible when he dressed. The invisible variable we can do invisible one in all Mathcad-document either changed white color of the background in separate operators or in separate operators changed its back.

Below seven examples with invisible variables are showed.

By the way both in Mathcad and in mathematics there are invisible variables or operators (functions). One of them is the operator of raising to a power Xy. Here we see two operands (X and Y), but we do not see the name (symbol) of the operator. So that invisible variable or rather invisible function (operator) is not invention of author but it is legal mathematical method.

Example 1. Invisible adding

In Mathcad there is one more invisible built-in operator it is the operator of multiplication. Or rather we say so: user of Mathcad has a right to change way of writing of the operator of multiplication:

2× 2 2 a and 2

In last two examples (2 and 2) the operator of multiplication is invisible one. It meets prevalent in mathematics the tradition that we do not put the sign of multiplication between factors if certainly they are not constants: in this case the expression 22 would be double-shift. It is both 2 2, i.. four and twenty-two.

But a blank between two values may mean both multiplication and adding. For example: 2 oclock 30 minutes, 1 km 200 m and etc. Here the invisible sign of adding puts between the same dimension values. In the picture 1 is showed how this peculiarity we can realize in Mathcad:

Invisible adding

The picture 1. Invisible adding

First of all we introduce into the calculation the users function with name + with help the operator in the picture 1. The built-in function duplicates the operator of adding: we can not change the color of symbol of built-in operator (it is not expedient too possibility of visible adding must be), but we change the color of the name of users function from black one (by default) to white. In Mathcad we can call the function with two arguments as the built-in operator. We have done it in the picture 1: the first call is leaded on colored background, the second one on white background.

Notice: If in Mathcad we press the button +, then well not get the symbol +, but the heading of the operator of adding: + . For input the symbol +, and others special symbols (minus, division, $, @ and etc) we have to strike a chord [Shift + Ctrl + K]. After it the cursor of a keyboard changes its color from blue to red one. That will be indication of interlock of work some buttons as macros of input of operators. Repeated pressing the chord [Shift + Ctrl + K] gives back cursor blue color and user of Mathcad possibility of work with buttons +, , /, * and others as arithmetical and other operators.

In Mathcad 2001 the built-in operator of invisible variable has appeared see the picture 1a.

Built-in invisible adding

The picture 1a. Built-in invisible adding

Example 2. Zero dimension value

Mathcad shows needless pedantry when we output dimension values. We say, for example, the given equipment is situated at 20 meters point, but the other one at zero point. But we do not make more exact the unit of measure of this zero point (meters, centimeters, feet, inches and etc.). Mathcad always accompanies output of dimension value with addition of units of measure (even in those case when it is not necessary (see above)). In this case we can hide the output unit of measure, making it invisible: (see the picture 2).

Zero dimension value

The picture 2. Zero dimension value

Example 3. Degree Celsius and decibels

One of the difficulties that user of Mathcad comes into collision with , solving dimension problem is work with degrees Celsius.

Point is that that in Mathcad Kelvin and Renkin degrees are built-in (absolute temperature scale), but Fahrenheit degrees and degrees Celsius are not built-in (relative scale), that are widely used in calculations and especially in every day life. But degrees Celsius (Fahrenheit degrees) we can not introduce into calculation with help of simple rule of input users unit of measure connecting it with built-in one with help of coefficient. Example:

barrel := 42 gal barrel = 157.99 L

Work with relative scales of measure of temperature is showed in the picture 3.

Work with degrees Celsius and Fahrenheit

The picture 3. Work with degrees Celsius and Fahrenheit

In the picture 3 input of temperatures value by Celsius (Fahrenheit) scale we do with help of visible first function C (F) as the afterfix operator. But output of value of temperature by the Celsius scale or (Fahrenheit) is leaded by call second invisible function C (F) as the prefix operator with additional value C (F) that equals one.

Technology of work with invisible symbols is used in Mathcad-document in the picture 3a, where estimation dimension values with help of decibels is leaded.

Work with decibels

The picture 3a. Work with decibels

Bel is the logarithm of ratio of tow physical values. The second physical value (denominator) is some base.

Example 4. Roman arithmetic

Roman arithmetic of Mathcad supports arithmetic of work with tenfold, dyadic, hexadecimal and octonary numbers. But if you want you can make Mathcad to work with Roman numerals. For it an invisible function is introduced into calculation. This function gives back Roman numeral if its argument is Arabic numeral, if the argument is Roman numeral (the picture 4):

Work with Roman numeral

The picture 4. Work with Roman numeral

In the picture 4 Roman arithmetic works at the expense of the invisible function is called as the after- or prefix operator (without brackets, enveloping the arguments).

Example 5. Sparse matrix

Mathcad has powerful tools for work with vectors and matrixes. There is only one demerit these massifs must be completely filled up. In the picture 5 we show how you can simulate the work with matrix that is not completely filled (rarefied matrix).

Simulation of work with sparse matrix

The picture 5. Simulation of work with sparse matrix

In the picture 5 empty elements of the matrix keep infinity number that is seldom introduced into the matrix as its element. But this infinity is invisible invisible style is given to it. The infinity is disregarded when we determine minimum and maximum values of elements of the matrix and also their mean value. The infinity is disregarded as since the matrix previously becomes the vector with sifting empty elements.

Example 6. Infinite cycle

Tools of programming of Mathcad keep operators of creation the cycle only with precheck (the cycle while). If you want to create the cycle with aftercheck or the cycle with exit from middle then you have to create infinite cycle with insets of operators: break, continue or return. The infinite cycle is formed with help of infinite operand of the operator while. The symbol of infinity (here any non-trivial number may be used) is written in white and white (see the picture 6).

The picture 6. Infinite cycle in Mathcad

In the picture 6 the invisible symbol is used for input empty line in the program.

Example 7. Second name of the variable

In Mathcad there are a few limitations to names of functions and variables. The name of Mathcad-variable, in particular, may keep blanks, Greek and Russian letters, subscripts, and strokes and so on:

But nevertheless there are some limitations. It is impossible, for example, that the variable has superscript (stroke), it is impossible that some parts of variable write italics, it is impossible to change color, size, type of print of the variable and etc.

One of the solutions of this problem is showed in the picture 7:

Expanded name of Mathcad-variable

The picture 7. Expanded name of Mathcad-variable

In the picture 7 the name of the variable (a, b, c) is hidden (invisible). It is showed the commentary as the name of the variable where mathematical operator is put in.

It is possible to give great number examples of use the invisible symbol, but seven is beautiful number.



[1][1] (I have special suggestion about this, which we can discuss lately - BV) The Invisible Man the roman by G.D. Wells (1866-1946). The roman was conceived and written in 1896. It was published in June August of 1897 in Londons magazine Pirson magazine and was published as a independent edition in September of the same year in London. Wells acquaintance with philosophy of F.Nitcshe (his works were actively translated in England in the 1890-th years) found its reflection in the roman. The history of genius inventor who revealed the secret of invisibility is the story of Nitcshes man. Concentration of the hero on scientific investigations lead him to isolation from people, moral hard, exasperation, that allows him to step over moral prohibition. Study nature makes a man as ruthless as nature itself, Wells noticed. Prompted by contempt and hatred against people the inventor aspires to conquer mankind with help of realm of terror. Carefully describing all details Wells aspired to give prove the idea by technical resources. After the book was published D.Konrad said that Wells was realist of fantasy. (V.L.Golman. Encyclopedia of literature. M.: VAGRIUS, 1998. 656 p.)

[2][2] Further in the text under the invisible variable well mean one of these objects of Mathcad, that user makes invisible.

[3] We have in mind hard copy of the article. Soft copy of the article is accessible in Internet to the address: http:// Certainly we find here colored illustration of the article.

[4] In DOS-versions of Mathcad we wrote in white and black . That was connected with savings of fluorescent layer of a screen. Nowadays people begin to change displays by their moral ageing but not physical one. I repeat once more that is the reason why the black background of the screen was changed to white one.

[5] It is considered that green color salutary influences on eyesight (green lampshades, eyeglasses with green spectacle lens and so on). It was popular so-called Herculean displays writing in green and black but not in white and black about 10 15 years ago.

[6] Faces of militiamen in photographs in newspapers or on TV are often covered such black rectangle.

[7] Styles we use in textual processors, for example in Word, when one indention we mark like heading (of an article, book), but the other like common text. Such structuring of the text (commentaries) is possible in Mathcad.

[8] Mathcad is not mathematical, but physical and mathematical program that allows to give values of physical values (mass, time, length, energy and so on) but not abstract values (like in traditional programming).

[9] Here the term style has the second meaning.

[10] In Mathcad there is one way to create invisible variable. The name of a variable may consist of one or several blanks.