Type::Series

Type representing truncated Puiseux, Laurent, and Taylor series expansions

MuPAD® notebooks will be removed in a future release. Use MATLAB® live scripts instead.

MATLAB live scripts support most MuPAD functionality, though there are some differences. For more information, see Convert MuPAD Notebooks to MATLAB Live Scripts.

Syntax

testtype(obj, (Puiseux | Laurent | Taylor))
testtype(obj, (Puiseux | Laurent | Taylor, x))
testtype(obj, (Puiseux | Laurent | Taylor, x = x0))
testtype(obj, (Puiseux | Laurent | Taylor, x, Undirected | Real | Right | Left))
testtype(obj, (Puiseux | Laurent | Taylor, x = x0, Undirected | Real | Right | Left))

Description

Type::Series(Puiseux), Type::Series(Laurent), and Type::Series(Taylor) represent truncated Puiseux series, Laurent series, and Taylor series, respectively.

The call testtype(obj, Type::Series(T)) checks, whether obj is a truncated series expansion of domain type Series::Puiseux and of mathematical type T.

The call testtype(obj, Type::Series(T, x = x0)) checks in addition, whether the series variable is x and the expansion point is x0. If x0 is omitted, x0 = 0 is assumed.

The call testtype(obj, Type::Series(T, x = x0, dir)) checks in addition, whether the direction of expansion is compatible with the specified direction dir. See the help pages of series and Series::Puiseux for more details about the direction.

See Example 1 and Example 3.

If obj is of domain type Series::Puiseux, but not a Puiseux expansion in the mathematical sense, then testtype(obj, Type::Series(T)) returns FALSE. This is the case if the coefficients of obj depend on the series variable, or if the type flag of obj is 1. See Example 2, and the help page of Series::Puiseux for more details.

A Laurent series is a Puiseux series with integral exponents. If the expansion point is finite, then a Taylor series is a Puiseux series with nonnegative integral exponents. If the expansion point is complexInfinity, then a Taylor series is a Puiseux series with nonpositive integral exponents. See Example 1 and Example 4.

For the expansion points infinity and -infinity, the directions Left and Right, respectively, are implicitly assumed.

Specifying x0 = infinity is equivalent to x0 = complexInfinity and dir = Left, and similarly x0 = -infinity is equivalent to x0 = complexInfinity and dir = Right.

See Example 4.

This type does not represent a property: it cannot be used in assume to mark an identifier as a truncated series expansion.

Examples

Example 1

The following call returns a Puiseux series:

s := series(sin(sqrt(x)), x);
domtype(s);

However, s is not a Laurent series:

testtype(s, Type::Series(Puiseux)),
testtype(s, Type::Series(Laurent)),
testtype(s, Type::Series(Taylor))

A Laurent series that is not a Taylor series:

s := series(1/sin(x), x);
domtype(s);

testtype(s, Type::Series(Puiseux)),
testtype(s, Type::Series(Laurent)),
testtype(s, Type::Series(Taylor))

The inverse of s is a Taylor series:

1/s;
testtype(1/s, Type::Series(Puiseux)),
testtype(1/s, Type::Series(Laurent)),
testtype(1/s, Type::Series(Taylor))

Example 2

Type::Series represents only objects of domain type Series::Puiseux:

s := 1 + x + 2*x^2 + O(x^3);
domtype(s), testtype(s, Type::Series(Puiseux));

s := series(exp(x + 1/x), x = infinity, 3);
domtype(s), testtype(s, Type::Series(Puiseux));

For objects of domain type Series::Puiseux, whose coefficients contain the series variable or whose type flag is 1, the result is FALSE as well:

s := series(psi(x), x = infinity);
domtype(s), coeff(s, 0), testtype(s, Type::Series(Puiseux));

s := series(sin(sqrt(-x)), x);
domtype(s), testtype(s, Type::Series(Puiseux));

Example 3

By specifying further arguments, you can check for the series variable, the expansion point, and the direction of expansion as well:

s := series(sin(sqrt(-x)), x, Left);
testtype(s, Type::Series(Puiseux, y)),
testtype(s, Type::Series(Puiseux, x)),
testtype(s, Type::Series(Puiseux, x = 0)),
testtype(s, Type::Series(Puiseux, x = 2));

Series::Puiseux::direction(s),
testtype(s, Type::Series(Puiseux, x, Undirected)),
testtype(s, Type::Series(Puiseux, x, Real)),
testtype(s, Type::Series(Puiseux, x, Right)),
testtype(s, Type::Series(Puiseux, x, Left));

s := series(x^5/(x - 2), x = 2, 3);
testtype(s, Type::Series(Laurent, x)),
testtype(s, Type::Series(Laurent, x = 2)),
testtype(s, Type::Series(Laurent, x = 3));

If you specify a direction, testtype checks whether it is compatible with the direction of the series:

Series::Puiseux::direction(s),
testtype(s, Type::Series(Puiseux, x = 2, Undirected)),
testtype(s, Type::Series(Puiseux, x = 2, Real)),
testtype(s, Type::Series(Puiseux, x = 2, Right)),
testtype(s, Type::Series(Puiseux, x = 2, Left));

Example 4

The following example is a Laurent series around infinity, but not a Taylor series:

s := series(z*exp(1/z), z = infinity);
testtype(s, Type::Series(Puiseux)),
testtype(s, Type::Series(Laurent)),
testtype(s, Type::Series(Taylor))

The expansion point is infinity, or equivalently, complexInfinity from the left:

Series::Puiseux::point(s), Series::Puiseux::direction(s);
testtype(s, Type::Series(Laurent, z)),
testtype(s, Type::Series(Laurent, z = 0)),
testtype(s, Type::Series(Laurent, z = infinity)),
testtype(s, Type::Series(Laurent, z = -infinity)),
testtype(s, Type::Series(Laurent, z = complexInfinity));

testtype(s, Type::Series(Laurent, z = complexInfinity, Undirected)),
testtype(s, Type::Series(Laurent, z = complexInfinity, Real)),
testtype(s, Type::Series(Laurent, z = complexInfinity, Right)),
testtype(s, Type::Series(Laurent, z = complexInfinity, Left));

Mathematically, the expression is even an undirected expansion around complexInfinity:

s := series(z*exp(1/z), z = complexInfinity);
Series::Puiseux::point(s), Series::Puiseux::direction(s);

testtype(s, Type::Series(Laurent, z)),
testtype(s, Type::Series(Laurent, z = infinity)),
testtype(s, Type::Series(Laurent, z = -infinity)),
testtype(s, Type::Series(Laurent, z = complexInfinity));

testtype(s, Type::Series(Laurent, z = complexInfinity, Undirected)),
testtype(s, Type::Series(Laurent, z = complexInfinity, Real)),
testtype(s, Type::Series(Laurent, z = complexInfinity, Right)),
testtype(s, Type::Series(Laurent, z = complexInfinity, Left));

Parameters

obj

Any MuPAD® object

x

The series variable: an identifier

x0

The expansion point: an arithmetical expression

Options

Laurent, Puiseux, Taylor

The type of series

Left, Real, Right, Undirected

The direction of the expansion

Return Values

See testtype