2

I want to solve equations with vector variables and vector/matrix parameters symbolically.

As a basic example I would like to be able to solve something like $[I-aG]x=b$ where $a,b \in \mathbb{R}^l$ are parameters, $x \in \mathbb{R}^l$ is the variable to be solved for, and $I$ and $G$ are $l \times l$ matrices. Namely, I would simply like Mathematica to output: $x=[I-aG]^{-1}b$.

Ultimately I would like to be able to solve symbolic systems of two linear simultaneous equations in two unknowns $x$ and $y$ such as \begin{align} Ax + By & = a \\ Cx + Dy & = b, \end{align} where all the capital objects are $l \times l$ matrices and all the lower case objects are vectors in $\mathbb{R}^l$. In this case I would like Mathematica to output something like (if my algebra is right): \begin{align} x & = (A-BD^{-1}C)^{-1}a - A^{-1}B(D-CA^{-1}B)^{-1}b \\ y & = -D^{-1}C(A-BD^{-1}C)^{-1}a + (D-CA^{-1}B)^{-1} b. \end{align}

I have been looking around here and could not really find anything addressing plain and simple algebraic manipulation of vectors and matrices. Really, the only things that differs from manipulating scalars is making sure to get the commutativity rules right, understand transposes, and write inverses rather than divisions. Is what I am talking about possible to do in Mathematica? Thank you!

Matteo
  • 21
  • 3
  • Have you written any code you would like to share ? – Sektor Feb 13 '15 at 21:58
  • 1
    Not really, sorry. I just could not find any way of telling Mathematica "these objects are matrices and these are vectors" and then use the Solve command. All I have are solutions to systems of equations with scalars, with which I have no issues. – Matteo Feb 13 '15 at 22:03
  • This will get you started. – Sektor Feb 13 '15 at 22:16
  • Thank you for the link. To my understanding, however, the 'Solving Linear Systems' documentation page addresses the problem of solving linear systems with scalar objects by turning them into matrix form. This is a different problem to the one I am faced with. I am trying to manipulate algebraically equations whose elements are multidimensional to obtain a closed form symbolic expression of the solution. – Matteo Feb 13 '15 at 23:04
  • Welcome to Mathematica.SE! I suggest that: 1) You take the introductory Tour now! 2) When you see good questions and answers, vote them up by clicking the gray triangles, because the credibility of the system is based on the reputation gained by users sharing their knowledge. Also, please remember to accept the answer, if any, that solves your problem, by clicking the checkmark sign! 3) As you receive help, try to give it too, by answering questions in your area of expertise. – bbgodfrey Feb 14 '15 at 04:45
  • You need to be able to manipulate non-commuting objects. One possibility is to use the NCAlgebra package which can be found at http://math.ucsd.edu/~ncalg/. – Stephen Luttrell Feb 14 '15 at 11:00
  • @bbgodfrey Thank you for the tips! – Matteo Feb 14 '15 at 11:54
  • @Stephen Thanks! I will check out the package. Just to be clear, do you think what I am trying to do is not feasible with the basic mathematica environment? – Matteo Feb 14 '15 at 11:56
  • You can do some things with Mathematica; see answers to 3242 as well as Symbolic Tensors. So, with $Assumptions = {(A | B | C | D) \[Element] Matrices[{l, l}], (a | b | x) \[Element] Matrices[{l}]}, you can compute TensorExpand[Inverse[A].(A.x + B.y - a)] to be x - MatrixPower[A, -1].a + MatrixPower[A, -1].B.y. But, solving your matrix equations in this way would be difficult. UCLA package looks promising. – bbgodfrey Feb 14 '15 at 14:23
  • Google Mathematica symbolic matrix algebra to find other external packages and somewhat relevant StackExchange questions. – bbgodfrey Feb 14 '15 at 14:27

0 Answers0