WARNING: This server provides a static reference view of the NetKernel documentation. Links to dynamic content do not work. For the best experience we recommend you install NetKernel and view the documentation in the live system .

Endpoint
Name:Math Runtime
Description:Mathematical Engine Runtime - Full Symbolic and Numeric operations
Id:MathRuntime
Category:accessor
Identifier Syntax

Math Runtime is an accessor using Active URI syntax with the following base identifiers:

Base
active:math

and the following arguments: (for more details on argument passing details see here)

ArgumentRulesTypingDescription
operator
Mandatory
Representation (java.lang.Object)expression to evaluate
varargs [varargs] Any quantityRepresentation (java.lang.Object)Varargs allows an arbitrary number of additional unspecified arguments.
Request Verbs

The following verb is supported:

Verb
SOURCE
Response

The response representation of this accessor for SOURCE requests is unknown.

This accessor throws no documented exceptions.

Import Requirements

To use Math Runtime accessor you must import the module urn:org:netkernel:lang:math:

<import>
  <uri>urn:org:netkernel:lang:math</uri>
</import>

The Math language runtime provides a rich symbolic and numeric mathematical evaluation engine.

operator

The operator argument must be transreptable to java.lang.String and is the mathematical expression to be evaluated.

Example 1

The operator

Expand[(x+1)*(x-3)*(y+2)]

is evaluated to the symbolic expansion...

x^2*y-2*x*y-3*y+2*x^2-4*x-6

Example 2

This is an example of calculating the symbolic derivative (with respect to x)...

D[x^2*y-2*x*y-3*y+2*x^2-4*x-6, x]

is evaluated to the symbolic expression...

2*x*y-2*y+4*x-4

Variable arguments

Arbitrary named arguments may be supplied. Numeric arguments will be provided as numeric variables substituted into the operator expression.

For example:

operator: x^2-3*x+1
x argument value: 2

will return the numeric result 1.0

Alternatively if the named argument is a String it will be parsed to an expression and substituted into the expression...

For example:

operator: x^2-3*x+1
x argument value: y*z+3

will return the symbolic result (y*z+3)^2-3*(y*z+3)+1

Warning be careful with symbolic arguments to avoid recursive variable references (the same symbol in the argument as the argument name itself) which will result in a stack overflow exception.

Pipeline Evaluation

The active:math engine can be used to create very rich and powerful mathematical pipeline processes, where the symbolic or numeric response of one stage is fed into a following stage - either as the operator or as an argument.

Built-in Functions

The active:math engine uses the Symja project which in turn incorporates many powerful math functions from Apache Commons-Math and JSA. A small set of examples are provided on the Symja site here.

A reference list is provided here.