I am trying to solve an equation of the form $dv=F\cdot dV$ where $dv$ and $dV$ are matrices derived from the row vectors $dx$, $dy$, $dz$ and $dX$, $dY$, $dZ$ respectively. If it helps, $F$ is the deformation gradient operating on material vectors to get spatial.

Problem setup:

dX = {1, 0, 0};
dY = {1, 1, 0};
dZ = {1, 1, 1};
dx = {1, 0, 0};
dy = {0, 1, 1};
dz = {0, 0, 1};

dV = {dX, dY, dZ};
dv = {dx, dy, dz};

F = Table[Subscript[Ff, i, j], {i, 1, 3}, {j, 1, 3}]
varList = Flatten[F]


I saw a video on Youtube where someone took the approach:

Solve[{F.dX == dX, F.dY == dy, F.dZ == dz}, varList]

I rewrote it as:

Solve[{Transpose[F].dV == dv}, varList]

But ultimately went with this approach:

LinearSolve[dV, dv] //Transpose

I knew to add the //Transpose after comparing the output with previous results so my question is whether there a logical reason why the result is transposed though I know that LinearSolve is meant to solve equations of the form $Ax=b$ for $x$ but in this case I am trying to solve for $A$, supplying $x$ and $b$ as arguments.

Please any pointers in the right direction would be greatly appreciated as I might not be able to visually inspect results in more complicated cases.

  • 1
    $\begingroup$ Um, note that LinearSolve solves Ax==b. In your case, the equation is b==xA. Teake's solution solves the problem. $\endgroup$ Sep 14, 2014 at 8:40
  • $\begingroup$ Thanks @Gregory, I didn't quite catch that distinction :) $\endgroup$
    – seyisulu
    Sep 14, 2014 at 9:19

1 Answer 1


You have to be a bit careful here; your last approach does not give the desired matrix F:

(LinearSolve[dV, dv] // Transpose).dV === dv

Then what does give the correct output? We can use the fact that for generic matrices $A$ and $B$ we have $A.B = (B^T.A^T)^T$ and write

F = Transpose @ LinearSolve[Transpose @ dV, Transpose @ dv]

And indeed, we've now got the correct output:

F.dV === dv

Note whenever dV is invertible, you may also simply do

F = dv.Inverse[dV]

to get the same result.

  • $\begingroup$ Thank you @Teake Nutma for your insightful answer. I will revise my work accordingly. $\endgroup$
    – seyisulu
    Sep 14, 2014 at 9:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.