linalg
::vandermondeSolve
Solve a linear Vandermonde system
MuPAD® notebooks are not recommended. 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.
linalg::vandermondeSolve(v
, y
, <Transposed>)
linalg::vandermondeSolve(v, y)
returns the
solution of
the linear Vandermonde system with i =
1, …, n.
linalg::vandermondeSolve
uses O(n^{2}) elementary
operations to solve the Vandermonde system. It is faster than the
general solver solve
and
the linear solvers linsolve
, numeric::linsolve
, linalg::matlinsolve
and numeric::matlinsolve
.
The solution returned
by linalg::vandermondeSolve([v[i] $ i=1..n], [y[i] $ i=1..n])
yields
the coefficients of the polynomial p(v)
= x_{1} + x_{2} v + ··· + x_{n} v^{n 
1} interpolating the data table (v_{1}, y_{1}),
…, (v_{n}, y_{n}),
i.e.,
.
See Example 1.
The Vandermonde points v and the right hand side y of the linear system are entered as vectors:
delete y0, y1, y2: v := matrix([[0, 1, 2]]); y := matrix([[y0, y1, y2]])
The solution vector is:
x := linalg::vandermondeSolve(v, y)
The solution yields the coefficients of the interpolating polynomial:
P := v > _plus(x[i+1]*v^i $ i=0..2):
through the points (0, y_{0}), (1, y_{1}), (2, y_{2}):
P(v[1]), P(v[2]), P(v[3])
With the optional argument Transposed
, the
linear system with the transposed Vandermonde matrix corresponding
to v
is solved:
linalg::vandermondeSolve(v, y, Transposed)
delete v, y, x, P:
The Vandermonde points v and the right hand side y of the linear system are entered as 2×1 matrices:
Mat := Dom::Matrix(Dom::ExpressionField(normal)):
delete v1, v2, y1, y2: v := Mat([v1, v2]): y := Mat([y1, y2]):
We define the vectors over the domain Dom::ExpressionField
(normal)
in
order to simplify intermediate computations.
Next, we compute the solution of the corresponding Vandermonde system:
x := linalg::vandermondeSolve(v, y)
We construct the Vandermonde matrix V
and
verify the result:
V := Mat([[1, v[1]], [1, v[2]]])
V * x
delete Mat, v, y, x, V:
We solve a Vandermonde system over the field ℤ_{7} (the
integers modulo 7) represented by the domain Dom::IntegerMod
(7)
:
MatZ7 := Dom::Matrix(Dom::IntegerMod(7)): v := MatZ7([1, 2, 3]): y := MatZ7([0, 1, 2]):
linalg::vandermondeSolve(v, y)
delete MatZ7, v, y:

A vector with distinct elements (a vector is an n×1 or 1
×n matrix of
category 

A vector of the same dimension and domain type as 

Returns the solution of the transposed system with i = 1, …, n. 
Vector of the same domain type as y
.
The Vandermonde matrix
generated by v = [v_{1}, …, v_{n}] is invertible if and only if the v_{i} are distinct.
The vector returned
by linalg::vandermondeSolve(x, y)
is the unique
solution of .
The vector x returned
by linalg::vandermondeSolve(x, y, Transposed)
is
the unique solution of .