A Mathematical library for Mathcad
by Giuseppe Borzi'
Description
The Mathematical library for MathCad is a DLL which adds about seventy
special functions to MathCad PLUS. The library is freeware; the only restrictions
are those coming from the owners of the numerical codes used. It is written
in C but part of the codes were originally in fortan. Most of the codes
for the numerical computation of special functions
have been taken from the Cephes Math Library Copyrighted by Stephen
L. Moshier, available by anonymous ftp from
ftp.std.com/pub/astronomy/cephes.
Other codes come from the Collected Algorithms (CALGO) by ACM and slatec,
which are available from netlib; these
includes:
-
file 644 by D.E. Amos for the computation of scaled and unscaled Bessel
and Airy functions of complex argument;
-
file 577 by B.C. Carlson and E.M. Notis for symmetric incomplete elliptic
integrals of the first, second, and third which are also used to compute
LegendreP;
-
dxlegf and associated routines from slatec, by J. M. Smith for Legendre
polynomials and associated functions
-
a modification of the (fortran single precision) code given in file 404
for the computation of complex logarithmic gamma function (use with care).
The conversion has been performed with f2c for 644,577 and dxlegf, while
404 was completely rewritten in C, using some Cephes function for complex
numbers, which are always intended in the cut plane -pi < arg(z) <=
pi. Moreover, an alternative implementation of the algorithm for Psi (digamma)
function distributed with Mathcad 7.0 Pro is provided.
Please send comments, suggestions and bug reports at the email address
gborzi@dees.unict.it. If you have C or fortran code for the computation
of further special functions or other numerical software in C or fortran
and you want to include it in the library you can send me your source code;
remember that non free software will not be included in the library.
The following functions are included in the distribution:
-
Unscaled and scaled Bessel functions of first and second kind of real order
and complex argument; unscaled and scaled Hankel functions of real order
and complex argument.
-
Unscaled and scaled modified Bessel functions of first and second kind
of real order and complex argument.
-
Spherical Bessel functions of first and second kind of real order and complex
argument; spherical Hankel functions.
-
Unscaled and scaled Airy functions and their first derivatives of complex
argument; struve function.
-
Logarithm of gamma function, beta function and logarithm of beta function
of complex arguments; reciprocal of gamma function, binomial coefficient,
Psi function, incomplete gamma function, complemented incomplete gamma
function, inverse of incomplete complemented gamma function, incomplete
beta function and inverse incomplete beta function.
-
Hypergeometric functions: 1F1, 2F0,
1F2,
2F1,
3F0.
-
Elliptic Integrals: Legendre's canonical incomplete elliptic integral,
Legendre's complete elliptic integral, associated Legendre's complete elliptic
integral of the first, second and third kind; Jacobian elliptic functions
cn(u,k), dn(u,k), sn(u,k) and their amplitude phi(u,k); Carlson's incomplete
elliptic integral of the first, second and third kind.
-
Dawson's integral, Fresnel integrals, dilogarithm, Riemann zeta function
and Riemann zeta function of two arguments.
-
Exponential integral Ei, sine and cosine integrals and hyperbolic sine
and cosine integrals.
-
Legendre polynomials and associated functions of the first and second kind;
normalised Legendre polynomials and associated functions of the first kind,
spherical harmonics and sequences of spherical harmonics.
-
Simple and useful functions: round x to nearest or even integer number,
sign of x and complex sign of x, semifactorial.
You can download the library with the source code clicking here
or from Simtel
or Winsite
(mathlib.zip). A wide list of links and resources for Mathcad can be found
here.
If you find this software useful, a postcard to the author is welcomed,
but absolutely NOT MANDATORY.
My home address is:
Giuseppe Borzi' - v. Kennedy 34 - 95045 Misterbianco - Catania - ITALY
I prefer to receive postcard about your town (monuments, important
buildings...).
What's new (v 1.2 - April 98)
-
Psi function can now deal with complex arguments.
-
Legendre polynomials and associated functions with their normalised versions
and spherical harmonics are now available.
-
Example files are now provided, which show some application of the functions
for electromagnetic problems.
What's new (v 1.1 - July 97)
-
Bessel and Airy functions can deal with complex arguments; scaled versions
of these functions are included.
-
Logarithmic gamma function, beta function and logarithmic beta function
can deal with complex arguments.
-
Legendre's canonical incomplete, complete and associated elliptic integral
of the third kind and Carlson's incomplete elliptic integral of the first,
second and third kind are now available.
-
A bug in the Jacobian elliptic functions cn(u,k), dn(u,k), sn(u,k) and
their amplitude phi(u,k) has been corrected; now they work with k rather
than m=k^2 (thanks to Esther Weiner).
Installation
To install the library, simply copy the file named mathlib.dll in the USEREFI
subdirectory of your Mathcad directory, then run Mathcad. The Mathcad file
mathlib.mcd provided with the libray contains usage examples for the functions.
Note
This software is provided AS IS without warranty of any kind, either express
or implied. This includes without limitation the fitness for a particular
purpose or application and any warranties of merchantability. The author
shall not be liable for any damage, whether direct, indirect, special,
or consequential, arising from a failure of this software or accompanying
files to operate in a manner desired by the user. The author shall not
be liable for any damage to data or property which may be caused directly
or indirectly by the use of this program.
Acknowledgments
I wish to thank Professors S. L. Moshier and the ACM for having provided
the numerical software used to build the library.
About the author, Giuseppe Borzì
My homepage is here.