Special Functions.
This file contains special functions, like hyperbolic functions, elliptic functions, beta functions etc. It does also contain some polynomial functions.
function sinh (x:numerical) Computes (exp(x)-exp(-x))/2
function cosh (x:numerical) Computes (exp(x)+exp(-x))/2
function asinh (z:numerical) Computes log(z+sqrt(z^2+1))
function acosh (z:numerical) Computes log(z+(z^2-1))
function sinc (z:numerical) Computes sin(x)/x Takes care of x~=0, returning 1 in this case. For intervals containting 0 the function fails.
function sec (x:numerical) Computes 1/cos(x)
function cosec (x:numerical) Computes 1/sin(x)
function cot (x:numerical) Computes 1/tan(x)
function polar polar(x,y), polar(x,y,z) compute polar coordinates. This function computes the polar coordinates in two or three dimensions. >{phi,r}=polar(1,2); degprint(phi), r, 63°26'5.82'' 2.2360679775 Returns {phi,r} or {phi,psi,r} See:
rect (Mathematical Functions)
function rect rect(phi,r), rect(phi,psi,r) compute rectangle coordinates. Computes rectangle coordinates in two or three dimensions. >{x,y}=rect(45°,sqrt(2)); [x,y] [ 1 1 ] Returns {x,y} or {x,y,z} See:
polar (Mathematical Functions),
polar (Maxima Documentation)
function logbase (x:numerical, a:numerical) Computes the logarithm to base a
function log10 (x:numerical) Computes the logarithm to base 10
function polydif (p:vector) Returns the polynomial p'. Polynomials are stored in Euler starting with the constant coefficient. >polydif([0,0,1]) [ 0 2 ]
function cheb (x:complex, n:nonnegative integer) Computes the Chebyshev polynomial T_n(x). The functions used T(x,n) = cos(n*acos(x)), if possible. For x<-1 and x>1, it uses T(x,n) = (w+1/w)/2, where w is the n-th power of the inverse Joukowski transform. >x=-1.1:0.01:1.1; y=x'; z=x+I*y; >plot2d(abs(cheb(z,5)),niveau=exp(0:10)) See:
chebpoly (Mathematical Functions),
chebrek (Mathematical Functions)
function chebrek (x:vector, n:nonnegative integer) Computes the Chebyshev polynomial via the recursion formula. >chebrek(-1:0.1:1,10) [ 1 -0.2007474688 0.9884965888 -0.0998400512 -0.9884965888 -0.5 0.5623462912 0.9955225088 0.4284556288 -0.5388927488 -1 -0.5388927488 0.4284556288 0.9955225088 0.5623462912 -0.5 -0.9884965888 -0.0998400512 0.9884965888 -0.2007474688 1 ] Works for vector x and scalar n.
function chebpoly (n:nonnegative integer) Computes the coefficients of the n-th chebyshev polynomial. >p=chebpoly(10) [ -1 0 50 0 -400 0 1120 0 -1280 0 512 ] >plot2d("polyval(p,x)",-1,1); >x=-1.1:0.01:1.1; y=x'; z=x+I*y; >p=chebpoly(10); w=abs(polyval(p,z)); >plot2d(log(w+0.2),niveau=0:10,>hue,>spectral) The function uses a loop.
function chebfit (xp:vector, yp:vector, n:nonnegative integer, .. a:real scalar=-1, b:real scalar=1) Fits Chebyshev polynomials on [a,b] to (xp,yp). Returns the vector of coefficients p(x) = sum a_[i] T(x,i) See:
chebval (Mathematical Functions)
function chebval (x:number; alpha:vector, .. a:real scalar=-1, b:real scalar=1) Evaluates sum a[i]*T(x,i). See:
chebfit (Mathematical Functions)
function beta (a:numerical, b:numerical) Computes the beta function
function betai (x:real, a:real, b:real) Computes the incomplete beta function.
function complexgamma (z:complex, p=gammaparams) Complex gamma function.
function gamma (z:numerical) Gamma function in the complex plane. You can also use _gamma(x) for real gamma function directly. The function uses an iteration implemented in the Euler language. >x=-2:0.05:2; y=x'; z=x+I*y; w=log(abs(gamma(z))); >plot3d(x,y,w/totalmax(w),>contour,zoom=3); See:
gamma (Euler Core),
gamma (Maxima Documentation)
function ellrf (x:real nonnegative scalar, .. y:real nonnegative scalar, z:real nonnegative scalar) Carlson's elliptic integral of the first kind RF (x; y; z). The iteration is implemented in the Euler language. x, y, and z must be nonnegative, and at most one can be zero.
function ellf (phi: real scalar, k: real scalar) Elliptic integral of the first kind F(phi,k)
function ellrd (x:real nonnegative scalar, .. y:real nonnegative scalar, z:real nonnegative scalar) Carlson's elliptic integral of the second kind RD(x; y; z). x and y must be nonnegative, and at most one can be zero. z must be positive. See:
elle (Mathematical Functions)
function elle (phi: real scalar, k: real scalar) Elliptic integral of the second kind E(phi,k). See:
ellrd (Mathematical Functions)