-1

I am trying to export a matrix from Mathematica into Maple. I have tried using the following calling sequence in Maple to no avail

with(MmaTranslator):
MmaToMaple();

After which I simply select the notebook that I need and am able to translate it to Maple language. This worked phenomenally when I first tried to transfer one matrix, yet for the inverse of said matrix I was unable to do so. Is there anyway I can translate the inverse matrix. Below I shall write the code of what I have attempted in Mathematica

x1 = {{1, 0, 0, 0}, {0, (1/(
   4 (x^2 + 
      z^2)))(4 z^2 Sqrt[(-1 + K (x^2 + y^2 + z^2))/(-1 + 
       K r^2)] + (Sqrt[2]
         x^4 (Sqrt[(-2 + 
           K (x^2 + 2 y^2 - Sqrt[x^4 + 4 x^2 y^2 + 4 y^2 z^2]))/(-1 + 
           K r^2)] - 
          Sqrt[(-2 + 
           K (x^2 + 2 y^2 + Sqrt[x^4 + 4 x^2 y^2 + 4 y^2 z^2]))/(-1 + 
           K r^2)]))/(Sqrt[x^4 + 4 x^2 y^2 + 4 y^2 z^2]) + 
     Sqrt[2] x^2 (Sqrt[(-2 + 
         K (x^2 + 2 y^2 - Sqrt[x^4 + 4 x^2 y^2 + 4 y^2 z^2]))/(-1 + 
         K r^2)] + 
        Sqrt[(-2 + 
         K (x^2 + 2 y^2 + Sqrt[x^4 + 4 x^2 y^2 + 4 y^2 z^2]))/(-1 + 
         K r^2)])), (x y (Sqrt[(-2 + 
         K (x^2 + 2 y^2 - Sqrt[x^4 + 4 x^2 y^2 + 4 y^2 z^2]))/(-1 + 
         K r^2)] - 
        Sqrt[(-2 + 
         K (x^2 + 2 y^2 + Sqrt[x^4 + 4 x^2 y^2 + 4 y^2 z^2]))/(-1 + 
         K r^2)]))/(Sqrt[2] Sqrt[x^4 + 4 x^2 y^2 + 4 y^2 z^2]), (1/(
   4 (x^2 + z^2)))
   x z (-4 Sqrt[(-1 + K (x^2 + y^2 + z^2))/(-1 + K r^2)] + 
      Sqrt[(-4 + 
       2 K (x^2 + 2 y^2 - Sqrt[x^4 + 4 x^2 y^2 + 4 y^2 z^2]))/(-1 + 
       K r^2)] + 
      Sqrt[(-4 + 
       2 K (x^2 + 2 y^2 + Sqrt[x^4 + 4 x^2 y^2 + 4 y^2 z^2]))/(-1 + 
       K r^2)] + (Sqrt[2]
          x^2 (Sqrt[(-2 + 
            K (x^2 + 2 y^2 - Sqrt[x^4 + 4 x^2 y^2 + 4 y^2 z^2]))/(-1 +
             K r^2)] - 
           Sqrt[(-2 + 
            K (x^2 + 2 y^2 + Sqrt[x^4 + 4 x^2 y^2 + 4 y^2 z^2]))/(-1 +
             K r^2)]))/(Sqrt[
        x^4 + 4 x^2 y^2 + 4 y^2 z^2]))}, {0, (x y (Sqrt[(-2 + 
         K (x^2 + 2 y^2 - Sqrt[x^4 + 4 x^2 y^2 + 4 y^2 z^2]))/(-1 + 
         K r^2)] - 
        Sqrt[(-2 + 
         K (x^2 + 2 y^2 + Sqrt[x^4 + 4 x^2 y^2 + 4 y^2 z^2]))/(-1 + 
         K r^2)]))/(Sqrt[2] Sqrt[x^4 + 4 x^2 y^2 + 4 y^2 z^2]), (1/(
   2 Sqrt[2]))(Sqrt[(-2 + 
      K (x^2 + 2 y^2 - Sqrt[x^4 + 4 x^2 y^2 + 4 y^2 z^2]))/(-1 + 
      K r^2)] + 
     Sqrt[(-2 + 
      K (x^2 + 2 y^2 + Sqrt[x^4 + 4 x^2 y^2 + 4 y^2 z^2]))/(-1 + 
      K r^2)] + (x^2 (-Sqrt[((-2 + 
            K (x^2 + 2 y^2 - Sqrt[x^4 + 4 x^2 y^2 + 4 y^2 z^2]))/(-1 +
             K r^2))] + 
          Sqrt[(-2 + 
           K (x^2 + 2 y^2 + Sqrt[x^4 + 4 x^2 y^2 + 4 y^2 z^2]))/(-1 + 
           K r^2)]))/(Sqrt[
       x^4 + 4 x^2 y^2 + 
        4 y^2 z^2])), (y z (Sqrt[(-2 + 
         K (x^2 + 2 y^2 - Sqrt[x^4 + 4 x^2 y^2 + 4 y^2 z^2]))/(-1 + 
         K r^2)] - 
        Sqrt[(-2 + 
         K (x^2 + 2 y^2 + Sqrt[x^4 + 4 x^2 y^2 + 4 y^2 z^2]))/(-1 + 
         K r^2)]))/(Sqrt[2] Sqrt[x^4 + 4 x^2 y^2 + 4 y^2 z^2])}, {0, (
   1/(4 (x^2 + z^2)))
   x z (-4 Sqrt[(-1 + K (x^2 + y^2 + z^2))/(-1 + K r^2)] + 
      Sqrt[(-4 + 
       2 K (x^2 + 2 y^2 - Sqrt[x^4 + 4 x^2 y^2 + 4 y^2 z^2]))/(-1 + 
       K r^2)] + 
      Sqrt[(-4 + 
       2 K (x^2 + 2 y^2 + Sqrt[x^4 + 4 x^2 y^2 + 4 y^2 z^2]))/(-1 + 
       K r^2)] + (Sqrt[2]
          x^2 (Sqrt[(-2 + 
            K (x^2 + 2 y^2 - Sqrt[x^4 + 4 x^2 y^2 + 4 y^2 z^2]))/(-1 +
             K r^2)] - 
           Sqrt[(-2 + 
            K (x^2 + 2 y^2 + Sqrt[x^4 + 4 x^2 y^2 + 4 y^2 z^2]))/(-1 +
             K r^2)]))/(Sqrt[
        x^4 + 4 x^2 y^2 + 4 y^2 z^2])), (y z (Sqrt[(-2 + 
         K (x^2 + 2 y^2 - Sqrt[x^4 + 4 x^2 y^2 + 4 y^2 z^2]))/(-1 + 
         K r^2)] - 
        Sqrt[(-2 + 
         K (x^2 + 2 y^2 + Sqrt[x^4 + 4 x^2 y^2 + 4 y^2 z^2]))/(-1 + 
         K r^2)]))/(Sqrt[2] Sqrt[x^4 + 4 x^2 y^2 + 4 y^2 z^2]), (1/(
   4 (x^2 + 
      z^2)))(4 x^2 Sqrt[(-1 + K (x^2 + y^2 + z^2))/(-1 + 
       K r^2)] + (Sqrt[2]
         x^2 z^2 (Sqrt[(-2 + 
           K (x^2 + 2 y^2 - Sqrt[x^4 + 4 x^2 y^2 + 4 y^2 z^2]))/(-1 + 
           K r^2)] - 
          Sqrt[(-2 + 
           K (x^2 + 2 y^2 + Sqrt[x^4 + 4 x^2 y^2 + 4 y^2 z^2]))/(-1 + 
           K r^2)]))/(Sqrt[x^4 + 4 x^2 y^2 + 4 y^2 z^2]) + 
     Sqrt[2] z^2 (Sqrt[(-2 + 
         K (x^2 + 2 y^2 - Sqrt[x^4 + 4 x^2 y^2 + 4 y^2 z^2]))/(-1 + 
         K r^2)] + 
        Sqrt[(-2 + 
         K (x^2 + 2 y^2 + Sqrt[x^4 + 4 x^2 y^2 + 4 y^2 z^2]))/(-1 + 
         K r^2)]))}}
y2 = Inverse[x1]

Which I neglect to add as it is incredibly long. I want to be able to export this y2 into Maple. Any help would be greatly appreciated.

lastgunslinger
  • 150
  • 2
  • 11

1 Answers1

0

See if you can export the y2 matrix to a file, in Mathematica's InputForm, in a string (ie. within double-quotes).

Then you could read that string into Maple using its read command, and then apply the MmaTranslator[FromMma] command.

acer
  • 6,671
  • 15
  • 15