openPlaG



openPlaG - Plot-a-Graph - Instructions


Content: Constants | Functions | Basic functions | Trigonometric functions | Non differentiable functions | Probability functions | Special functions | Iterations || Display

With the openPlaG mathematical function graphs can be drawn. Up to three graphs can be shown in one image. For this, input fields for three formulas are available.

The formulas can contain the following symbols:


x Function variable x
0-9 Numbers up to a value of 10000 (and -10000).

+ Plus, e.g. x+1
- Minus, e.g. 1-x
* Times, this must not be omitted. For example you have to write 2*x instead of 2x.
/ Divided by, e.g. 1/x
. , Point or comma as decimal separator, e.g. 1.5
( ) Brackets, only parentheses are allowed in any amount. Each opened bracket must be closed again.

Constants

e Euler's number; 2.718281828459
pi π, Pi; 3.1415926535898
sq2 Square root of 2; 1.4142135623731
go Relation of the golden ratio; 1.6180339887499
d Feigenbaum constant delta; 4.6692016091030

Functions

Nested functions like sin(pow(x#2/3)) or ((x-1)*(x+1))/(2*(x*x)) are no problem at all. You only have to take care of the correct use of the parentheses. Polynomials like 2*pow(x#3)-4*pow(x#2)+x+1 are possible, too.
Functions with multiple variables, like norm, can have the x at one or at several optional positions. The standard position is shown in the examples.

- Basic functions

pow Power, e.g. pow(x#2) for x2. Root can be written as e.g. pow(x#1/2) for square root of x, an exponential function like this: pow(e#x) for ex.
  Roots of negative bases can only be shown if the numerator of the power is 1 and the denominator of the power is odd (e.g. pow(x#1/3)).
  To calculate negative x-values for e.g. pow(x#2/3), you have to alter this function into pow(pow(x#1/3)#2).

log Natural Logarithm , e.g. log(x)
log10 Decadic Logarithm, e.g. log10(x)
logn Logarithm to the base n, e.g. logn(2#x) for the binary (base 2) logarithm.

- Trigonometric functions

sin Sine, Sinus, e.g. sin(x)
cos Cosine, Cosinus, e.g. cos(x)
tan Tangent, e.g. tan(x)
cot Cotangent, e.g. cot(x)
sin2 Sine square, e.g. sin2(x)
cos2 Cosine square, e.g. cos2(x)
tan2 Tangent square, e.g. tan2(x)
cot2 Cotangent square, e.g. cot2(x)
asin Arcsine, e.g. asin(x)
acos Arccosine, e.g. acos(x)
atan Arctangent, e.g. atan(x)
acot Arccotangent, e.g. acot(x)
sinh Hyperbolic Sine, e.g. sinh(x)
cosh Hyperbolic Cosine, e.g. cosh(x)
  tanh Hyperbolic Tangent, e.g. tanh(x)
coth Hyperbolic Cotangent, e.g. coth(x)
asinh Area Hyperbolic Sine, e.g. asinh(x)
acosh Area Hyperbolic Cosine, e.g. acosh(x)
atanh Area Hyperbolic Tangent, e.g. atanh(x)
acoth Area Hyperbolic Cotangent, e.g. acoth(x)
sca Secant, e.g. sca(x)
csc Cosecant, e.g. csc(x)
asca Arcsecant, e.g. asca(x)
acsc Arccosecant, e.g. acsc(x)
scah Hyperbolic Secant, e.g. scah(x)
csch Hyperbolic Cosecant, e.g. csch(x)
arscah Area Hyperbolic Secant, e.g. arscah(x)
arcsch Area Hyperbolic Cosecant, e.g. arcsch(x)

- Non differentiable functions

abs Absolute value, e.g. abs(x)
min Minimum of several values, e.g. min(1#x#pow(x#1/3)) as minimum of 1, x and third root of x.
max Maximum of several values, e.g. max(abs(x)#x*x) as maximum of the absolute value of x and x2.
% Modulo division, whole-numbered remainder, e.g. 10%x
fmod Modulo division, floating point remainder, e.g. fmod(x#1) displays only the position after the decimal point of the input value.
R round, e.g. R(x#2) rounds two decimal places.
H Heaviside step function, e.g. H(x): 0, if x≤0, else 1
sig Signum function (Sign function), e.g. sig(x)
tri Triangle curve, e.g. tri(1#2#x). The first value is the period, the second is the amplitude.
rect Rectangle curve, e.g. rect(1#-1#2#x). The first value is the upper limit, the second is the lower and the third is the period.
saw Sawtooth wave, e.g. saw(2#1#x). The first value is the period, the second is the amplitude.
saw2 Reverse sawtooth wave, e.g. saw2(2#1#x). The first value is the period, the second is the amplitude.
ramp Ramp function, e.g. ramp(1#2#1#x). The first value is the start value, the second is the end value and the third is the height.
con Condition function, e.g. con(0#sin(x)#1). The first value is the lower limit, the third is the upper limit. If the second value is between these two, the result is 1, else 0.
rand Integer random number between two integers, e.g. rand(0#2) returns 0, 1 or 2. (The PHP function mt_rand is used.)
rand2 Random number between two numbers with decimal places (maximal 9), e.g. rand2(0#1#3) returns a number with three decimal places between 0 and 1.
asy vertical asymptote for a given fixed value, e.g. asy(1) or asy(e).

- Probability functions

norm Normal or Gaussian distribution, e.g. norm(0#1#x) for the uniform distribution. The first value is the expected value, the second is the standard deviation.
phi Φ, Cumulative Gaussian distribution function, e.g. phi(0#1#x). This is an approximation based on the displayed interval. It delivers reasonable values if the normal distribution in the chosen interval starts at very low values near 0. A common display of both functions is advisable.
chi2 Chi-square distribution, e.g. chi2(3#x). The first value is the number of the degrees of freedom.
ichi2 Inverse-chi-square distribution, e.g. ichi2(3#x). The first value is the number of the degrees of freedom.
chi Chi distribution, e.g. chi(3#x). The first value is the number of the degrees of freedom.
stud Student's t-distribution, e.g. stud(2#x). The first value is the number of the degrees of freedom.
F F-distribution (Fisher-Snedecor), e.g. F(5#2#x). The first two values are the numbers of the degrees of freedom.
Fz Fisher's z-distribution, e.g. Fz(5#2#x). The first two values are the numbers of the degrees of freedom.
Ft Fisher-Tippett distribution, e.g. Ft(1#2#x). The first value is the location parameter, the second is the scale parameter. The second parameter must be >0.
poi Poisson distribution, e.g. poi(3#x). The first value is the expected value.
lnorm Log-normal distribution, e.g. lnorm(0#1#x). The first value is the mean, the second is the standard deviation.
cau Cauchy distribution or Lorentz distribution, e.g. cau(0#1#x) for the standard Cauchy distribution. The first value is the location parameter, the second is the scale parameter.
lapc Laplace distribution, e.g. lapc(0#1#x). The first value is the location parameter, the second is the scale parameter. The second parameter must be >0.
logd Logistic distribution, e.g. logd(1#2#x). The first value is the location parameter, the second is the scale parameter.
hlogd Half-logistic distribution, e.g. hlogd(x).
uni Uniform distribution, e.g. uni(1#2#x). The first value is the lower limit, the second is the upper limit.
rlng Erlang distribution, e.g. rlng(5#1#x). The first value is the shape parameter, the second is the rate parameter. The first parameter must be a natural number.
pon Exponential distribution, e.g. pon(1#x). The first value is the rate parameter.
cosd Raised cosine distribution, e.g. cosd(0#1#x). The first value is the location parameter, the second is the scale parameter. cosd is defined in the interval [location-scale,location+scale].
scahd Hyperbolic secant distribution, e.g. scahd(x).
kum Kumaraswamy distribution, e.g. kum(0.5#0.5#x). The first two values are the shape parameters a and b.
levy Lévy distribution, e.g. levy(1#x). The first value is the scale parameter.
rlgh Rayleigh distribution, e.g. rlgh(1#x). The first value is the scale parameter.
wb Weibull distribution, e.g. wb(2#1#x). The first value is the shape parameter, the second is the scale parameter.
wig Wigner semicircle distribution, e.g. wig(1#x). The first value gives the radius.
gk Gauss-Kuzmin distribution, e.g. gk(x).
geo Geometric distribution (variant A), e.g. geo(0.8#x). The first value is a probability.
yule Yule-Simon distribution, e.g. yule(2#x). The first value is the shape parameter.
gammad Gamma distribution, e.g. gammad(2#3#x). The first value is the shape parameter, the second is the scale parameter.
igammad Inverse-gamma distribution, e.g. igammad(2#1#x). The first value is the shape parameter, the second is the scale parameter.
igauss Inverse Gaussian distribution, e.g. igauss(1#0.25#x). The first value is the shape parameter, the second is the scale parameter.
par Pareto distribution, e.g. par(2#1#x). The first value is the location parameter, the second is the shape parameter.
pear Pearson distribution (type III), e.g. pear(1#1#2#x). The first value is the location parameter, the second is the scale parameter and the third is the shape parameter.
brw Relativistic BreitWigner distribution, e.g. brw(1#2#x). The first value is the mass of the resonance, the second is the resonance's width and the third is the energy.
trid Triangular distribution, e.g. trid(1#2#4#x). The first value is the lower limit, the second is the most probable and the third is the upper limit.
gum1 Gumbel distribution type 1, z.B. gum1(2#1#x). The first two values are the parameters a and b.
gum2 Gumbel distribution type 2, z.B. gum2(2#1#x). The first two values are the parameters a and b.

- Special functions

scir Semicircle curve, e.g. scir(x#1) for a semicircle with the radius 1. The formula is pow(r*r-x*x#1/2), r gives the radius.
ell Semielliptic curve, e.g. ell(2#1#x) for a semiellipse with the horizontal radius 2 and the vertical radius 1. The formula is pow((1-x*x/(a*a))*b*b#1/2).
pyth Pythagorean theorem, e.g. pyth(x#1). The formula is c=pow(a*a+b*b#1/2).
thr Rule of three, e.g. thr(x#1#2). The formula for thr(a#b#c) is f(x)=b*c/a.
dc Exponential decay, e.g. dc(5#1#x). The first value is the initial quantity, the second is the decay constant.
cat Catenary, e.g. cat(1#x). The first value is the constant a.
HY4 Hyper4, also known as tetration or super-exponentiation, e.g. HY4(x#3) for x to the power of (x to the power of x). Here the maximum value can be excessed very quickly!
lambda Lambda function, e.g. lambda(x#3) for x to the power of (x to the power of (3-1))
gd Gudermannian function, e.g. gd(x) for atan(sinh(x))
siv Semiversus, e.g. siv(x) for sin2(x/2)
sinc Sine cardinalis, e.g. sinc(x) for sin(x)/x
hubb Hubbert curve, e.g. hubb(x) for 1/(2+2*cosh(x))
sgm Sigmoid function, e.g. sgm(x) for 1/(1+pow(e#-x))
gom Gompertz curve, e.g. gom(2#-5#-3#x). The first value is the upper asymptote, the second is the parameter b and the third is the growth rate. Second and third value must be negative.
zeta Riemann zeta function, e.g. zeta(x).
eta Dirichlet eta function, e.g. eta(x).
fac Factorial, e.g. fac(x). Non-natural numbers as input values are rounded down.
stir Stirling's approximation for large factorials, e.g. stir(x). The formula is pow(2*pi*x#1/2)*pow(x/e#x).
gamma Gamma function (Euler and Weierstrass definition), e.g. gamma(x), for positive input values as approximation for large factorials and for some statistical distributions.
beta Euler beta function, e.g. beta(2#x).

Iterations (iterative functions)

y previous function value, e.g. for y(0) is 0 the initial value for y, the next value is the last result of the input value x and so on.
y2 pre-previous function value, e.g. y2(1)+0.001.
step Number of the iteration steps done, divided by the parameter value, e.g. step(100) counts up to five (at 500 px width).
man Mandelbrot function, e.g. man(0#-0.7) for y(0)*y(0)-0.7
Attention: derivative and integral with the iteration don't lead to very reasonable results. As well a logarithmic scale won't work here.

Differential and integral equations

Derivative and integral (both only first order) within a function are written like this:
D Derivative, e.g. D(x*x). Not allowed is e.g. D(D(x))
S Integral, e.g. S(x*x). Not allowed is e.g. S(S(x))
A second derivative can be drawn by the use of Derivative and D() together. The same is possilbe with the integral, but this is much more difficult too use.

Adjust the display

Just try out, you can't break anything!

Functions:

Next to the formula terms the color of up to three graphs can be set and whether the according term should be written into the graphic.
Derivative displays the derivated graph. In the graphic this will be displayed as f'(x)=[...]'.
Integral you can choose to display the cumulative function in the displayed interval (integrate over ...). Thereby the function values are cumulated one after another. In the graphic the integrated term will be displayed as F(x)=S[...]. You can also set a constant C, which will be added to the integral.
At From ... to you can choose the domain for the function (piecewise defined function). Enter the designated x-values. If empty, the domain will cover the whole range for x. Constants like pi/2 are allowed, too.

Display properties:

Width and Height refer to the size of the graphic and have nothing to do with the range of values. Minimum size is 200, maximum is 500.
Range defines in which range the graphs are displayed. Maximal input and output value is 10000 (or -10000). With a logarithmic scale the output value can raise up to 10300. Constants like pi*2 are allowed, too.
Intervals defines the number of sectors on each axis that are labeled with dashes and numbers. Maximum is 100. The width should be divisible without remainder by the number of intervals on the x-axis, same for the height and the intervals on the y-axis.
Reticule lines is the same as Intervals, but for the drawn through grey lines. Maximum again is 100.
Dashes length defines the length of the dashes at the interval borders. Maximum length is 500. If the dashes cover the whole graphic you will get a nice, black grid.
Decimal places defines the maximum number of displayed decimal places in the caption.
Gap at origin gives the size of the gap around the origin. When 0 this isn't shown.

The checks, if set, cause the display of the reticule lines, axis lines (x- and y-axis), caption (values and axes), dashes, frame and potentially occuring error messages.

Logarithmic scale defines if the y-axis is displayed linear or logarithmic. No means linear. As logarithmic bases 2, e, 10 and 100 can be chosen. The logarithmic display doesn't show integrated or derivated graphs or iterations!

Calculate single value

Enter a function with the syntax above or click on 1, 2 or 3 to take a function from above. Choose an input value and click Calculate to see its function value. Values of the function phi, derivatives, integrals and iterations can't be calculated.
This tool also can be used as a pocket calculator. Simply enter an arithmetic term like 2*2 and no input value.


The displayed graph is never an exact image of the function, but an approximation as good as possible.



Up