**3.4. Algorithm**

In order to use the Cayley–Hamilton theorem as a tool to find the *n* dimensional generalized eigenvalue system problem based on knowledge of desired eigenvalues and/or physical parameters, 2*n*<sup>2</sup> − *n additional* pieces of design information are required in addition to the *n*desired eigenvalues. An algorithm for solving Problem B is as follows:

ALGORITHM. *Given the n*-*desired eigenvalues λ*1, …, *λ<sup>n</sup> of an nth order generalized eigenvalue system*

**1.** *Generate the characteristic polynomial*:

$$p\left(\mathcal{X}\right) = \left(\mathcal{X} - \mathcal{X}\_1\right) \dots \left(\mathcal{X} - \mathcal{X}\_{n-1}\right) \left(\mathcal{X} - \mathcal{X}\_n\right) = \mathcal{C}\_n \mathcal{X}^n + \mathcal{C}\_{n-1} \mathcal{X}^{n-1} + \dots + \mathcal{C}\_1 \mathcal{X} + \mathcal{C}\_0$$


$$p\left(K,M\right) = \mathcal{c}\_{\boldsymbol{n}}\left(M^{-1}K\right)^{\boldsymbol{n}} + \mathcal{c}\_{\boldsymbol{n}-1}\left(M^{-1}K\right)^{\boldsymbol{n}-1}...+\mathcal{c}\_{1}\left(M^{-1}K\right) + \mathcal{c}\_{0}I = 0$$

*or for commuting M and K matrices*:

$$p\left(K,M\right) = \mathcal{c}\_n K^n + \mathcal{c}\_{n-1} K^{n-1} M \dots + \mathcal{c}\_1 K M^{n-1} + \mathcal{c}\_0 M = 0$$


*The output consists of the n matrix entries of the M and K matrices*.
