Save to my list
Unsave this
Created on
0
Aug 2012
Last activity
0
Apr 2013
Plugin

# Math operations++

Publication ID: ICY-V5W8V1

## Short Description

Execute complex math operations on sequences, such as ‘3*sequence1 + log(sequence2)/sequence3’, in a single step. All the operations are executed pointwise.

## Documentation

This plugin is similar to the Math operations plugin: it provides usual pointwise math operations on sequences, such as addition, product, absolute value extraction, rounding to the closest integer, etc. However, it also allows the user to perform complex combinations of theses operations, using a mathematical expression interpretor.

Please have a look to the Math operations plugin documentation: it will give you details about the general behaviour of Math operations++. Mathematical expressions, which are specific to this plugin, are described below.

The features provided by this plugin can be accessed:

• directly through the GUI (using a EzPlug interface),
• through the protocol editor provided by the Blocks plugin,
• from the java code (see the documentation in the Functor.java (in the Math operation plugin package) and Expression.java files for more details).

### Mathematical expression

Using mathematical expressions, it is possible to define math operations such as:

1. 5*a + 1/2*b
2. rho*cos(theta) + alpha^(-2)

The first example defines an expression which is a linear combination of two variables (a and b); the second example involves three variables (rho, theta and alpha) in a more complex operation. Each of these variables represents a sequence, a scalar value or an array (see the Math operations plugin documentation for details about the objects that can be used as inputs of math operations).

In the EzPlug interface, variables can have any name composed of az, AZ, 09 or _ characters. In the protocol editor, variable names must correspond to the names of block entries, i.e. a, b, c or d.

The lists of available operators and functions that can be used to define mathematical expressions are presented below.

### Available operators

• - : subtraction
• * : multiplication
• / : division
• ^ : power

All the operators are left-associative, which means that a/b/c will be evaluated as (a/b)/c. Usual precedence rules between operators apply: operator ^ is evaluated first, then * and /, and finally + and -. For instance, -a^3 + 4/3*b will be interpreted as (-(a^3)) + ((4/3)*b).

### Available functions

All the following functions expect one argument, unless otherwise specified.

• abs : absolute value
• sign : sign extraction
• sqrt : square root
• exp : exponential function
• log : natural logarithm
• log10 : decimal logarithm
• cos : cosine
• sin : sine
• tan : tangent
• acos : arc cosine
• asin : arc sine
• atan : arc tangent
• cosh : hyperbolic cosine
• sinh : hyperbolic sine
• tanh : hyperbolic tangent
• round : rounding to the closest integer
• floor : rounding to the largest previous integer
• ceil : rounding to the smallest following integer
• max : maximum (expects two arguments)
• min : minimum (expects two arguments)

## Changelog

• Version 2.0.0.0 • Released on: 2013-04-16 10:31:02
Description:

Major code refactoring... This plugin is about to be deleted and embedded in Math Operations.

• Version 1.2.0.0 • Released on: 2012-12-10 14:52:39
Description:

Fix: compatibility issue with Math operations v1.2.0.0

• Version 1.1.0.0 • Released on: 2012-09-14 16:26:50
Description:

Fix: documentation, synchronize version number with the MathOperations plugin.

• Version 0.0.4.0 • Released on: 2012-09-05 17:25:59
Description:

Fix: VarExpression values can now be loaded from a XML file.

• Version 0.0.3.0 • Released on: 2012-08-30 17:14:02
Description: