next up previous contents
Next: Polynomials (2) and Rational Up: Working with Jasymca Previous: Comparison of LAPACK and

Symbolic Variables

In contrast to the examples Octave and Matlab, Jasymca integrates numeric and symbolic datatypes at the core of the program; symbolic math is not treated as an add-on. This means that with few exceptions most operations accept any mixture of numeric and symbolic arguments using the same commands and commandsyntax.

Symbolic variables should not be confused with variables as discussed until now. These latter variables serve as address for an object in memory (the ``environment''), while symbolic variables are algebraic objects on their own. That means if x is a conventional variable, entering x in the textinputfield makes Jasymca search in the environment for the corresponding object, which then replaces x. If however x is a symbolic variable, the same action will lead to the creation of a first-degree polynomial with variable x and coefficients 1 and 0.

In Octave-mode, each symbolic variable x must be declared as symbolic by entering syms x before using it. The command clear x deletes the symbolic (actually any) variable x.

>> x=3;             % nonsymbolic variable
>> x^2+3-2*sin(x)   % placeholder for '3'
ans = 11.718        
>> syms x           % symbolic variable
>> x^2+3-2*sin(x)   % create function
ans = -2*sin(x)+(x^2+3)


next up previous contents
Next: Polynomials (2) and Rational Up: Working with Jasymca Previous: Comparison of LAPACK and
Helmut Dersch
2009-03-15