jhplot.math
Class Symbolic

java.lang.Object
  extended by jhplot.math.Symbolic

public class Symbolic
extends Object

Symbolic calculations. One can select engine, such as "jasymca" (default) or "jscl". Read manual for the description.


Constructor Summary
Symbolic()
          Initialize symbolic calculations using jasymca as the main engine.
Symbolic(String engine)
          Set engine for symbolic calculations.
 
Method Summary
static String derivative(String s)
          Symbolic derivative.
 String elementary(String s)
          Rewrite an expression in term of elementary functions (log, exp, frac, sqrt, implicit roots).
 String eval(String str)
          Evaluate an expression with the given engine.
 void exec(String str)
          Execute a set of expressions.
 String expand(String s)
          Expanding a math formula.
 String factorize(String s)
          Factorize math formula.
 String getEngine()
          Return the name of the current engine.
 String numeric(String s)
          Evaluate numerical values and perform some substitutions.
 String simplify(String s)
          Simplify equation.
 String toJava(String s)
          Convert math equation to Java code
 String toMathML(String s)
          Convert an equation to MathML form.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Symbolic

public Symbolic(String engine)
Set engine for symbolic calculations. This can be either "jasymca" or "jscl"

Parameters:
engine -

Symbolic

public Symbolic()
Initialize symbolic calculations using jasymca as the main engine.

Method Detail

getEngine

public String getEngine()
Return the name of the current engine.

Returns:

eval

public String eval(String str)
            throws Exception
Evaluate an expression with the given engine. For "jasymca", use the standard Matlab/Octave mode. For "jscl", use jscl syntax.

Parameters:
str - string for evaluation.
Returns:
Throws:
Exception

exec

public void exec(String str)
          throws Exception
Execute a set of expressions. This uses always jasymca mode (Octave/Matlab) syntax.

Parameters:
str - string for evaluation
Throws:
Exception

toJava

public String toJava(String s)
              throws jscl.text.ParseException
Convert math equation to Java code

Parameters:
s - input equation
Returns:
result
Throws:
jscl.text.ParseException

toMathML

public String toMathML(String s)
                throws jscl.text.ParseException
Convert an equation to MathML form.

Parameters:
s - input equation
Returns:
result
Throws:
jscl.text.ParseException

expand

public String expand(String s)
              throws jscl.text.ParseException
Expanding a math formula. This uses "jscl" engine.

Parameters:
s - input equation
Returns:
math equation after evaluation
Throws:
jscl.text.ParseException

factorize

public String factorize(String s)
                 throws jscl.text.ParseException
Factorize math formula. This uses "jscl" engine.

Parameters:
s - input equation
Returns:
after factorization.
Throws:
jscl.text.ParseException

elementary

public String elementary(String s)
                  throws jscl.text.ParseException
Rewrite an expression in term of elementary functions (log, exp, frac, sqrt, implicit roots). This uses "jscl" engine.

Parameters:
s - input equation
Returns:
result
Throws:
jscl.text.ParseException

simplify

public String simplify(String s)
                throws jscl.text.ParseException
Simplify equation. It is often useful to rewrite an expression in term of elementary functions, i.e calling "elementary" first. This uses "jscl" engine.

Parameters:
s - input equation
Returns:
result
Throws:
jscl.text.ParseException

numeric

public String numeric(String s)
               throws jscl.text.ParseException
Evaluate numerical values and perform some substitutions. This uses "jscl" engine.

Parameters:
s -
Returns:
result
Throws:
jscl.text.ParseException

derivative

public static String derivative(String s)
                         throws jscl.text.ParseException
Symbolic derivative. This uses "jscl" engine.

Parameters:
s -
Returns:
result
Throws:
jscl.text.ParseException


jHepWork 3.2 ©