Mathcad Functions PDF

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 3

Mathcad Functions

From the Mathcad Help Files:

You can insert any built-in function by choosing Function from the Insert menu to open the
Insert Function dialog box. You may also type the names of the built-in functions directly
into Mathcad. Spelling and capitalization are important.

Trigonometric Functions

cos, cot, csc, sec, sin, sinc, tan Calculate the standard trigonometric quantities for
arguments in radians.

Inverse Trigonometric Functions

acos, acot, acsc, asec, asin, atan Calculate the inverse trigonometric quantities.

Data analysis functions

mean, median, gmean, and hmean Arithmetic, geometric, and harmonic means.

Characteristics of an Array

cols, rows size of a matrix

length, last size of a vector

max, min maximum and minimum values in an array

sin(z) cos(z) tan(z)


sec(z) csc(z) cot(z)

Return the trigonometric functions sine, cosine, tangent, secant, cosecant, and cotangent
of z, respectively.

sinc(z) is a special function which correctly evaluates sin(z)/z = 1 in the limit as z


approaches 0.

Arguments:

• z is a dimensionless, complex scalar in radians.

Notes:

1
• Sin(x)/x as x approaches 0 returns 1 when x is used as the argument to sin and as
the denominator in the fraction, or if the same function f(x) = 0 is used as both
argument and denominator. In the case where g(x) = sin(x) and f(x) = x, g(x)/f(x)
returns 0, following the normal Mathcad rules for the fraction 0/0. If you wish to
guarantee you get the correct behavior, use sinc.

• Trig functions are subject to roundoff errors in the following cases:


12
• For large arguments, >10 in magnitude, trig functions begin to lose
precision. When this happens, you see the error message "Cannot
evaluate this accurately at one or more of the points specified."

• The tan function has singularities, and is undefined at odd-integer


multiples of π/2. Arguments near these singularities are subject to
precision errors.

• The value of π on a computer is only an approximation, so arguments to


the trig functions near multiples of π can only be an approximation of the
correct value. If you need more exact values, use symbolic evaluation
with a decimal point, to force floating point calculations.

• Many of these comments also apply to the hyperbolic trig functions.

mean(A, B, C, ...) Returns the arithmetic mean, or average, of A, B, C, ... by summing all
elements in the arguments and dividing by the total number of elements.

median(A, B, C, ...) Returns the median of the elements in A, B, C, ... , the value above and
below which there are an equal number of values.

gmean(A, B, C, ...) Returns the geometric mean of A, B, C, ... defined by

hmean(A, B, C, ...) Returns the harmonic mean of A, B, C, ... defined by

where M is an array created from the function arguments A, B, C, ...

Arguments:

• A, B, C, ... are m x n arrays or scalars. The arithmetic mean accepts complex and
negative values, while the geometric and harmonic means accepts only positive
real numbers. The median function accepts only real values.

2
Notes:

• If there are an even number of values, the median is the arithmetic mean of the
two central values.

• The harmonic mean is the reciprocal of the arithmetic mean of the reciprocals.

• hmean(A, B, C, ...) < gmean(A, B, C, ) < mean(A, B, C, ...).


• The geometric mean is useful for calculating growth rates.

• You may wish to see Mathcad's other functions for data analysis.

Maxima and Minima of an Array

max(A, B, C, ...) Returns the largest value from A, B, C, ... If the elements are complex, max
returns the largest real part of any value plus i times the largest imaginary part of any value.
For example, max(2 + 3i, 3 + 2i) = 3 + 3i.

min(A, B, C, ...) Returns the smallest value from A, B, C, ... If the elements are complex, min
returns the smallest real part of any value plus i times the smallest imaginary part of any
value.

Arguments:

• A, B, C, ... can be arrays, scalars, or strings.

You might also like