Download Function and Variable Reference ¶

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Mark-to-market accounting wikipedia , lookup

Transcript
Function and Variable Reference ¶
LiveAtom contains a flexible expression parser and evaluator which allows users to enter expressions
symbolically, rather than numerically. These expressions are then evaluated at each time step, with
the value of the special variable 't' as the independent variable. Entering values symbolically is often
faster than using the Table interface, and allows you to change the timescale resolution without
having to change your model.
Numbers and Operators
Name
Number
+,*,/
%
**
Definition
Numbers may be entered in standard or scientific notation: 1, 2.35, -1.2e-6
Addition and subtraction: 2+3 => 5; 5-7 => -2
Multiply and divide: 5*7 => 35; 1/3 => 0.333
Modulo operator; returns the remainder of numerator/denominator: 4 % 2.5 => 1.5
Exponentiation: 2**3 => 8; 5**2 => 25
Special Variables
Name Definition
The value of the current time, in seconds. Note that this value is always in seconds,
t
regardless of this units.
bias_x The X component of the global bias field
bias_y The Y component of the global bias field
bias_z The Z component of the global bias field
t_max The duration of the experiment; the maximum value of t.
T
Time expressed as a percentage (valued 0-1) of the experiment duration (t/t_max).
Functions
Name
sin(x)
cos(x)
tan(x)
Definition
Sine of x, in radians
CFuosine of x, in radians
Tangent of x, in radians
exp(x)
Exponentiation function, ex
Square root of x
Natural log of x
Absolute value of x
Minimum of x or y
Maximum of x or y
sqrt(x)
log(x)
abs(x)
min(x,y)
max(x,y)
step(x)
if (x) >= 0: 1 else 0
ramp(v1, v2)
ramp(var, start, start_value,
end, end_value)
ramp_inc(var, start,
start_value, end, end_value)
A linear ramp from v1 to v2 over T
A linear ramp from start_value to end_value (exclusive) based on the
distance that var is between start and end.
A linear ramp from start_value to end_value (inclusive) based on the
distance that var is between start and end.
Examples
In all of the below examples, the experiment duration is set to 1.5s.
Function: sin(2*pi*T)
Function: step(T-0.5)
Function: ramp(T,0,0,0.5,2) + ramp_inc(T, 0.5, 2, 1, 1)