1. Home
2. MPOWER procedure

# MPOWER procedure

Forms integer powers of a square matrix (P.W. Lane).

### Parameters

`MATRIX` = matrices, symmetric matrices or diagonal matrices Matrix from which to form the power Power to which each matrix is to be raised Structure to store the result

### Description

`MPOWER` forms powers of a square matrix, using as few matrix operations as possible in order to save time and decrease rounding errors. The square matrix is specified using the `MATRIX` parameter, and can be either an ordinary matrix structure (with an equal number of rows and columns), a symmetric matrix or a diagonal matrix. The required power, which must be a positive integer, is specified using the `POWER` parameter. The `RESULT` parameter supplies the identifier of the structure to save the results; this will be declared automatically to be of the same type as the input structure.

Options: none.

Parameters: `MATRIX`, `POWER`, `RESULT`.

### Method

For general matrices, successive powers of two of the matrix are formed by matrix products, and the result formed by taking the product of those that are needed to achieve the specified power. Diagonal matrices are dealt with using simple exponentiation of the diagonal values. Symmetric matrices are spectrally decomposed, and the result formed as a product of the matrix containing the latent vectors (`V`) with the simple power of the diagonal matrix containing the latent roots (`R`):

`RESULT = V *+ R**POWER *+ TRANSPOSE(V)`.

Function: `MPOWER `.

Commands for: Calculations and manipulation.

### Example

```CAPTION 'MPOWER example',\
!t('Calculate the 65th power of a transition matrix to',\
'find the state of a process after 65 transitions.'); STYLE=meta,plain
MATRIX  [ROWS=7; COLUMNS=7] Tprob