Mathematica:Matrix Multiplication of five 6x6 matrices

  • Context: Mathematica 
  • Thread starter Thread starter parazit
  • Start date Start date
  • Tags Tags
    Matrices Multiplication
Click For Summary

Discussion Overview

The discussion revolves around the multiplication of five 6x6 matrices in Mathematica, focusing on the challenges faced in obtaining meaningful results from the matrix operations. Participants explore various methods to achieve the desired matrix multiplication and subsequent calculations involving unknown variables.

Discussion Character

  • Technical explanation
  • Mathematical reasoning
  • Debate/contested

Main Points Raised

  • One participant describes difficulties in obtaining a logical result from matrix multiplication using the Dot[] command and the . symbol in Mathematica.
  • Another participant suggests using parentheses to enforce the order of operations in matrix multiplication.
  • A participant expresses confusion over the results obtained from the matrix multiplication and the subsequent calculations needed to derive specific values (sf and βex).
  • Concerns are raised about the interpretation of results when using MatrixForm, which may affect how the matrix is assigned and displayed.
  • One participant shares a successful adjustment to the matrix multiplication method, leading to further calculations involving the FindRoot function.
  • Another participant notes the periodic nature of the solutions for βex and expresses a desire for small, meaningful values for both βex and sf.
  • There is a suggestion to ensure proper syntax in the notebook to avoid errors, emphasizing the importance of semicolons between expressions.

Areas of Agreement / Disagreement

Participants do not reach a consensus on the best approach to matrix multiplication and subsequent calculations, as multiple methods and interpretations are discussed. Some participants find success with specific adjustments, while others continue to express confusion and seek clarification.

Contextual Notes

Participants mention the need for specific values and meaningful results, indicating that the calculations depend heavily on the definitions and assumptions made in their matrices and equations. There are unresolved mathematical steps and dependencies on the structure of the code used in Mathematica.

Who May Find This Useful

This discussion may be useful for users of Mathematica who are working with matrix operations, particularly in the context of physics or engineering problems involving multiple matrices and unknown variables.

parazit
Messages
75
Reaction score
3
Hi,
I have five 6x6 matrices defined on mathematica with some unknowns and I need the final matrix let's say, mf.

When I tried to find out mf with Dot[] command, it works but the result won't be so logic. On the other hand, when I tried to do this multiplication with . symbol, there exists a result but when I asked the program let's say mf[[1,1]] it prints the entire row.

Lets say my matrices are m1,m2,m3,m4 and m5.( Notation is just for assumption)

What should I do to calculate if mf is written like following on the paper;
mf=m1.m2.m3.m4.m5

I tried a way like this also,

aa=m5.m4;
bb=aa.m3;
cc=bb.m2;
mf=cc.m1;

However, this is not logic. There sould be some way to define more than 2 matrices multiplication in one time.

If you need or request, I can upload my studies too.

Best.
 
Physics news on Phys.org
What do you mean by so logic? Can you attach an example mathematica file?

for me m1.m2.m3 works fine. Or try m1.(m2.m3) to force order of operations.
 
I mean the result is not so useful for further calculations.

I am trying to calculate the sf value that shown on the Dsf matrix. To do that I need to multiply that five 6x6 matrice and than use the Ts[[1,2]]=0 and Ts[[3,4]]=0 statements to find βex. After that, I can calculate sf. βex also sf must be some meanfull result compared to the reference values.

For example, If I take βin=βex=0 than ψin=ψex=0.001939 rad and than alpha will be 90 degree which is also 1.57 rad. From there,ρ will be 0.075 m. The other variables will not change. Than when I made the calculations I got sf as positive and negative two values however it should have a single, small, positive value.

I am so so confused even this is just a simple problem...
 

Attachments

Ts = Dsi.Medgein.Mbody.Medgeex.Dsf // MatrixForm

is not doing a matrix multiply
then assigning that matrix to TS
THEN changing the result into MatrixForm to display it.

Instead it
is doing a matrix multiply
then changing the result into MatrixFormwhich is different from a matrix
THEN assigning that to to Ts and finally displaying that.

Instead of this
Ts = Dsi.Medgein.Mbody.Medgeex.Dsf // MatrixForm
Ts[[1, 2]]
Ts[[3, 4]]
do this
Ts = Dsi.Medgein.Mbody.Medgeex.Dsf;
Ts // MatrixForm
Ts[[1, 2]]
Ts[[3, 4]]

See if your results are meaningful after this change
 
Thank you Bill Simpson, it worked for the matrix multiplication.

Then I tried to solve the rest that I mentioned. If you don't mind please share the results if it's possible. I would like to compare them with mine and try to find a way.

Thank you.
 
Using your multiplication.nb notebook that you posted with this small change:
...
Ts = Dsi.Medgein.Mbody.Medgeex.Dsf
Ts // MatrixForm
Ts[[1, 2]]
Ts[[3, 4]]
FindRoot[{Ts[[1, 2]] == 0, Ts[[3, 4]] == 0}, {{βex, 0}, {sf, 1}}]

returns

{βex -> 0.135322, sf -> -0.258422}

Since you have trig functions there will be many solutions for βex.

For example, this shows the repeating solutions for both equations for repeating values of βex given a fixed value for sf:

Plot[Evaluate[{Ts[[1, 2]], Ts[[3, 4]]} /. sf -> -0.2584215664919408], {βex, -2 Pi, 2 Pi}]

I have not explored whether there are other values of sf which yield solutions, but I would not be surprised if there were whole parametric curves for values of {βex, sf} that are solutions to your pair of equations.

Note: It is dangerous and error prone to not use a semicolon between each expression in a notebook. Sometimes you can do this and still have it work. But this has been a source of difficult to track down errors for many years. I suggest ending each expression in your notebook with a semicolon and using Print[] if you need to have an expression displayed when evaluating a notebook.
 
Last edited:
Bill Simpson,
Thank you so much for your advise and help. I know that the function is periodic but actually expect a small value for βex and also a small value for sf since the final result which I have to reach is multiplication of Ts[[1,1]] and 0.01 must be a positive and really really small number.

I will check the whole code today and rewrite it in a form that you mentioned. Also I will add some notes that indicates the meaning of each value.

Thank you so much for your kind and helpfull messages.

 

Similar threads

  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
Replies
5
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 3 ·
Replies
3
Views
3K
  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 13 ·
Replies
13
Views
8K
  • · Replies 6 ·
Replies
6
Views
3K
Replies
1
Views
3K
  • · Replies 15 ·
Replies
15
Views
4K