Matrix Calculator Tools

739 Views Asked by At

Does there exist any such software/online calculator where I can enter a matrix and am able to obtain the formula for an arbitrary power of the matrix?

It would be an added benefit if the entries of the matrix are allowed to be variables.

In case this question belongs somewhere else, I would be glad to be pointed in the direction.

Edit 1: I would like to add more detail as to what my aim is. I have a set of matrices consisting of two variables $a \in \mathbb{N}, b \in \mathbb{R}.$ I want to know whether for infinitely many of them the $a^{\text{th}}$ power is positive.

Right now I'm just handpicking some matrices and checking for them to see whether this is true. I would be happy to be suggested better methods for the same.

Edit 2: The matrices are as follows:

$$A(a,b)=\begin{pmatrix}\frac{a}{b}-1&-1&-1&-1\\ -1&\frac{a}{b}-1&-1&-1\\ 1&-1&\frac{a}{b}-1&-1&\\ -1&0&-1&\frac{a}{b}-1\end{pmatrix};\ a\in \mathbb{N}, b \in \mathbb{R}$$

I want to check whether every entry of $A(a,b)^a$ is positive for infinitely many $a$ and $b.$

3

There are 3 best solutions below

8
On BEST ANSWER

You can use Wolfram Alpha.

The general syntax is matrixpower[matrix in matrix form, power] and below are examples.

Here is one with only numbers.

Here is one with variables.

If you want to give a matrix $A$ and find $A^n$, you can also use this same approach and here is an example.

When a matrix is diagonalizable, you can use $A^n = P D^n P^{-1}$ from the Jordan Normal Form.

You should also consider using some of the free CAS tools like SAGE or Python.

Of course, professional CAS programs have things like Mathematica - MatrixPower.

You can also consider a free cloud account on the Wolfram Cloud, which gives you access to Mathematica commands, which are not all in Wolfram Alpha.

Update

$A^n(a, b) = \begin{pmatrix} \dfrac{-b n \left(\dfrac{a}{b}-1\right)^n+a \left(\dfrac{a}{b}\right)^n-b \left(\dfrac{a}{b}\right)^n}{a-b} & \dfrac{2 a \left(\dfrac{a}{b}-2\right)^n-2 b \left(\dfrac{a}{b}-2\right)^n-a \left(\dfrac{a}{b}-1\right)^n-a \left(\dfrac{a}{b}\right)^n+b \left(\dfrac{a}{b}-1\right)^n+b \left(\dfrac{a}{b}\right)^n+2 b n \left(\dfrac{a}{b}-1\right)^n}{a-b} & \dfrac{2 a \left(\dfrac{a}{b}-2\right)^n-2 b \left(\dfrac{a}{b}-2\right)^n-2 a \left(\dfrac{a}{b}-1\right)^n+2 b \left(\dfrac{a}{b}-1\right)^n+b n \left(\dfrac{a}{b}-1\right)^n}{a-b} & -\dfrac{b n \left(\dfrac{a-b}{b}\right)^n}{a-b} \\ -\dfrac{b n \left(\dfrac{a-b}{b}\right)^n}{a-b} & \dfrac{2 a \left(\dfrac{a}{b}-2\right)^n-2 b \left(\dfrac{a}{b}-2\right)^n-a \left(\dfrac{a}{b}-1\right)^n+b \left(\dfrac{a}{b}-1\right)^n+2 b n \left(\dfrac{a}{b}-1\right)^n}{a-b} & \dfrac{2 a \left(\dfrac{a}{b}-2\right)^n-2 b \left(\dfrac{a}{b}-2\right)^n-2 a \left(\dfrac{a}{b}-1\right)^n+2 b \left(\dfrac{a}{b}-1\right)^n+b n \left(\dfrac{a}{b}-1\right)^n}{a-b} & -\dfrac{b n \left(\dfrac{a-b}{b}\right)^n}{a-b} \\ \dfrac{b n \left(\dfrac{a-b}{b}\right)^n}{a-b} & \dfrac{-a \left(\dfrac{a}{b}-2\right)^n+b \left(\dfrac{a}{b}-2\right)^n+a \left(\dfrac{a}{b}-1\right)^n-b \left(\dfrac{a}{b}-1\right)^n-2 b n \left(\dfrac{a}{b}-1\right)^n}{a-b} & \dfrac{-a \left(\dfrac{a}{b}-2\right)^n+b \left(\dfrac{a}{b}-2\right)^n+2 a \left(\dfrac{a}{b}-1\right)^n-2 b \left(\dfrac{a}{b}-1\right)^n-b n \left(\dfrac{a}{b}-1\right)^n}{a-b} & \dfrac{b n \left(\dfrac{a-b}{b}\right)^n}{a-b} \\ \left(\dfrac{a}{b}-1\right)^n-\left(\dfrac{a}{b}\right)^n & \left(\dfrac{a}{b}-2\right)^n-2 \left(\dfrac{a}{b}-1\right)^n+\left(\dfrac{a}{b}\right)^n & \left(\dfrac{a}{b}-2\right)^n-\left(\dfrac{a}{b}-1\right)^n & \left(-\dfrac{b-a}{b}\right)^n \\ \end{pmatrix}$

Now, you have to do cases based on $a, b$ to determine if things are positive. It may be easier to choose $a, b$ prior to taking the matrix to the $n-th$ power and seeing if you can determine it from that.

1
On

If you can diagonalize the matrix. (Not all matrices can be diagonalized but most can)

$A = P^{-1}DP\\ A^2 = P^{-1}DPP^{-1}DP = P^{-1}D^2P\\ A^n = P^{-1}D^nP$

The diagonal matrix is easy to multiply by itself.

0
On

The answer is yes. We may take $b=a$ and then for the matrix $$ A=A(a,a)=\begin{pmatrix}0 &-1&-1&-1\\ -1& 0 &-1&-1\\ 1&-1&0 &-1&\\ -1&0&-1&0\end{pmatrix} $$ we see that $A^a$ is positive (all entries positive) if and only if $$ a=6k \quad \text{ for } \; k\in \Bbb N. $$ So we have infinitely many such $a$, and hence infinitely many such matrices.