Rascal

Frequently Occuring Problems


  1. Multiplication like "2x" doesn't seem to work!
  2. Matrix- and Vectorproduct does not seem to work!
  3. Why don't you predefine pi, e, i or j, ... in Rascal?
  4. In the online version Rascal seems to forget my definitions!
  5. Plotting does not seem to work online!
  6. Rascal does not solve my equations!
  7. Rascal does not know how to divide!
  8. Rascal does not understand my function definitions!
If you have other problems (with Rascal!), use this form to send me an email. You can find further information in the user manual or at the homepage of Rascal. You may also experiment with the online version of Rascal.

  1. Multiplication like "2x" doesn't seem to work!
    The reason is that this was never intended to work. This would introduce too much ambiguity which does not justify the slight increase in comfort. On the other hand "x2" cannot be recognized as a multiplication as this is a correct variable name.
    Solution: Use the multiplication symbol "*": "2*x"

  2. Matrix- and Vectorproduct does not seem to work!
    If you try to multiply two vectors or matrices a*b, then the number of columns of a must be equal the number of lines in b; else the multiplication is not possible! Often you need to transpose one of the factors to get it right.
    Example: Think of two vectors
    a=[1;2;3]
    =[1]
    2
    3

    and
    b=[4;5;6]
    =[4]
    5
    6

    Let's compute a usual scalar product. As both vectors are column vectors, we need to transpose the first, else the dimensions would not fit.
    >a'
     [1 2 3]
    >a'*b
     [32]
    If we transposed b, then the result would be a matrix:
    >a*b'
     [4 5 6;8 10 12;12 15 18]
    So it is important to be careful about the dimensions, as there are several ways of multiplying vectors and matrices!
    Solution: Check dimensions and transpose appropriately

  3. Why don't you predefine pi, e, i or j, ... in Rascal?
    This question seems to be obsolete, as now pi,e and i are being predefined using "rascal.rc", but still there is the question why it isn't hardwired into rascal, as these special numbers are well-known constants.
    The reason is that pi and e are infinitesimal numbers, they cannot be represented as a finite floating point number. Thus the user has to decided what accuracy is suitable and what datatype shall be used to represent the constants. Here are some examples for suitable definitions and the resulting accuracy on my system. As you can see there are a lot different ways of defining pi, depending on your needs. Generally using intervals is adviseable, as this way you are not starting from a false assumption; in above interval definitions pi is always enclosed in the interval and the worst result in your computation could be that the result cannot be determined in the arithmetic that was used. With rounded scalar representation you just get a result and you don't know how much the error you made in the beginning propagated.
    In current versions that have the c-xsc-modules included, rascal.rc predefines "pi" and "e" as string constants with an accuracy of about 300 digits. They are rounded to the corresponding datatype as soon (or late) you use them. Without the c-xsc-modules "pi" and "e" are being defined as double-precision constants.
    The complex unit "i" can be represented accurately, but many engineers prefer using "j" as the imaginary unit, as "i" is used otherwise. In Rascal you have the freedom to use "j" instead of "i", just enter
    >i=0;j=complex(0,1);
    >sqrt(-16)
     (4*j)
    Solution: Understand that Rascal doesn't dictate what definition you have to use... :)

  4. In the online version Rascal seems to forget my definitions!
    Each time you load that page Rascal is started again; thus everything you computed before is discarded. If you would like to use definitions, don't erase them from the text-area-field in that page, but add further lines below. Rascal will execute each line one after the other.
    Also if you would like to try out some of the examples from the documentation, you have to enter the full examples, not just the last lines.
    Solution: Don't leave out the definitions, Rascal cannot guess what you want him to remember!

  5. Plotting does not seem to work online!
    Sorry, this was not intended to work online. Rascal uses gnuplot for plotting and this program is not designed for online purposes. Well, it _could_ be done, but the online version is just a try-out version, so live with it.
    Solution: Try it at home!

  6. Rascal does not solve my equations!
    Rascal will only answer questions that are posed right:
    Solution: Read the manual to find out how to ask the proper way...

  7. Rascal does not know how to divide!
    Actually Rascal can do even more, Rascal can deal with fractions: Computing 1/2-1/6 would result in 1/3! If you really want to get the decimal equivalent, just add a dot '.' to one of the numbers you would like to divide: Then Rascal will display the result as a floating point number and get the result you had expected. Some examples:
    >38/12+7/3
     11/2
    >38/12.+7/3
     5.5
    >38/12+7/3+0.
     5.5
    Solution: Add a decimal point '.' to one of the numbers.

  8. Rascal does not understand my function definitions!
    Perhaps you encountered trouble like this:
    >f(x)=5*x
    parse error
    >g=sin+cos
     Error:SYMREC+SYMREC

    Sadly Rascal does not yet tell you properly what went wrong, something that will be changed in future. You need to follow the correct syntax for function definitions. In the first case there is a final semicolon missing, in the second there are no variables: The correct versions are
    >f(x)=5*x;
    >g(x)=sin(x)+cos(x);
    Solution: Follow the correct syntax.

SourceForge Logo

Sebastian Ritterbusch
25. 07. 2001