[WP-34S] Calculations With Complex Matrices
|
05-18-2014, 05:20 PM
(This post was last modified: 05-20-2014 12:15 PM by Thomas Klemm.)
Post: #1
|
|||
|
|||
[WP-34S] Calculations With Complex Matrices
Introduction
This article describes how to perform matrix multiplication and matrix inversion with complex matrices. Since the WP-34S lacks complex numbers the same trick as in the HP-15C is used. The complex transformation between \(Z^P\) and \(\tilde{Z}\) is provided by combining M.COPY and M.TRANSP commands. Of course this could be written down in a small program. MED: Matrix Editor This description is from matrixedit.wp34s: Code: /* HP-15C Owner's Handbook Section 12: Calculating With Matrices Calculating With Complex Matrices Inverting a Complex Matrix Example: (pp. 165) \[Z = \begin{bmatrix} 4+3i & 7-2i \\ 1+5i & 3+8i \end{bmatrix}\] \[Z^P = \begin{bmatrix}4 & 7 \\ 1 & 3 \\ 3 & -2 \\ 5 & 8\end{bmatrix}\] Enter matrix \(Z^P\): 0.0402 XEQ 'MED' 4 R/S ↓ 7 R/S ↓ 1 R/S (…) ↓ 8 R/S Calculate offset for element (1,3): 1 3 0.0802 MATRIX:M.REG 4 Calculate offset for element (1,5): 1 5 0.0802 MATRIX:M.REG 8 Copy complex 2×2 matrix: 4.0202 8 MATRIX:M.COPY 8.0202 Negate 2×2 matrix (-x = x - 2x): -2 4.0202 8.0202 MATRIX:M+x Calculate offset for element (1,1): 1 1 0.0402 MATRIX:M.REG 0 Calculate offset for element (1,7): 1 7 0.0802 MATRIX:M.REG 12 Copy real 2×2 matrix: 0.0202 12 MATRIX:M.COPY 12.0202 Transpose upper 4×2 matrix: 0.0402 MATRIX:TRANSP 0.0204 Transpose lower 4×2 matrix: 8.0402 MATRIX:TRANSP 8.0202 Transpose 4×4 matrix: 0.0404 MATRIX:TRANSP 0.0404 \[\tilde{Z}=\begin{bmatrix} 4 & 7 & -3 & 2 \\ 1 & 3 & -5 & -8 \\ 3 & -2 & 4 & 7 \\ 5 & 8 & 1 & 3 \end{bmatrix}\] Calculate the inverse: 0.0404 MATRIX:M-1 \[\tilde{Z}^{-1}=\begin{bmatrix} -0.0254 & 0.2420 & 0.2829 & 0.0022 \\ -0.0122 & -0.1017 & -0.1691 & 0.1315 \\ -0.2829 & -0.0022 & -0.0254 & 0.2420 \\ 0.1691 & -0.1315 & -0.0122 & -0.1017 \end{bmatrix}\] Solving the Complex Equation AX = B Example: (pp. 169) \[A^P=\begin{bmatrix} 10 & 0 \\ 0 & 0 \\ 200 & -200 \\ -200 & 170 \end{bmatrix}\] \[B^P=\begin{bmatrix} 5 \\ 0 \\ 0 \\ 0 \end{bmatrix}\] Calculate inverse of AP as above and multiply by BP: 0.0404 16.0401 20 MATRIX:M× 20.0401 \[\tilde{A}^{-1}\times B^P=\begin{bmatrix} 0.0372 \\ 0.0437 \\ 0.1311 \\ 0.1543 \end{bmatrix}\] Transpose 2×2 matrix: 20.0202 MATRIX:TRANSP \[\begin{bmatrix} 0.0372 & 0.1311 \\ 0.0437 & 0.1543 \end{bmatrix}\] HP-42S RPN Scientific Programming Examples and Techniques 5: Matrices Solving Simultaneous Equations That Have Complex Terms Example: (pp. 166) \[A=\begin{bmatrix} 10-i0.01 & -5 & 0 & 0 \\ -5 & 15-i0.01 & -5 & 0 \\ 0 & -5 & 15-i0.01 & -5 \\ 0 & 0 & -5 & 15-i0.01 \end{bmatrix}\] \[B=\begin{bmatrix} 34 \\ 0 \\ 0 \\ 0 \end{bmatrix}\] \[A^P=\begin{bmatrix} 10 & -5 & 0 & 0 \\ -5 & 15 & -5 & 0 \\ 0 & -5 & 15 & -5 \\ 0 & 0 & -5 & 15 \\ -0.01 & 0 & 0 & 0 \\ 0 & -0.01 & 0 & 0 \\ 0 & 0 & -0.01 & 0 \\ 0 & 0 & 0 & -0.01 \end{bmatrix}\] \[B^P=\begin{bmatrix} 34 \\ 0 \\ 0 \\ 0 \\ 0 \\ 0 \\ 0 \\ 0 \end{bmatrix}\] Let's assume we want to preserve registers 0-4. Thus we start with register 5 for matrix AP. Enter matrix AP: P.FCN:CLREGS 5.0804 XEQ 'MED' Calculate offset for element (1,5): 1 5 5.1604 MATRIX:M.REG 21 Calculate offset for element (1,9): 1 9 5.1604 MATRIX:M.REG 37 Copy complex 4×4 matrix: 21.0404 37 MATRIX:M.COPY 37.0404 Negate 4×4 matrix (-x = x - 2x): -2 21.0404 37.0404 MATRIX:M+x Calculate offset for element (1,1): 1 1 5.1604 MATRIX:M.REG 5 Calculate offset for element (1,13): 1 13 5.1604 MATRIX:M.REG 53 Copy real 4×4 matrix: 5.0404 53 MATRIX:M.COPY 53.0404 Transpose upper 8×4 matrix: 5.0804 MATRIX:TRANSP 5.0408 Transpose lower 8×4 matrix: 37.0804 MATRIX:TRANSP 37.0408 Transpose 8×8 matrix: 5.0808 MATRIX:TRANSP 5.0808 Enter matrix BP: 70.0801 XEQ 'MED' Invert matrix A: 5.0808 MATRIX:M-1 Multiply A by B: 5.0808 70.0801 80 MATRIX:M× 80.0801 Transpose 2×4 matrix: 80.0204 MATRIX:TRANSP 80.0402 Result: \[I=\begin{bmatrix} 4.2000 & 0.0061 \\ 1.600 & 0.0037 \\ 0.6000 & 0.0019 \\ 0.2000 & 0.0008 \end{bmatrix}\] |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 2 Guest(s)