1
$\begingroup$

I am struggling to find out the option that show the final result of a matrix operations and not the necessary steps to achieve the result.

The last line of the following picture demonstrates the problem, I just want the results

problem

The code:

k1 = 1600;
k2 = 600;
k3 = 3200;
m1 = 1;
m2 = 2;
(*Matriz de rigidez*)
K2 = {{+k1 + k2, -k2}, {-k2, k2 + k3}}
(*Matriz de massa*)
M2 = {{m1, 0}, {0, m2}}
w1 = 40;
w2 = 50;
xi1 = 0.1;
xi2 = 0.1;
A = Inverse[{{1/w1, w1}, {1/w2, w2}}].{{2 xi1}, {2 xi2}}
C2 = A[[1]]*M2 + A[[2]]*K2 
$\endgroup$
7
  • 1
    $\begingroup$ post your codes instead of only a picture. $\endgroup$ – cvgmt Oct 13 '20 at 3:03
  • $\begingroup$ @cvgmt There it is $\endgroup$ – Victor Verga Oct 13 '20 at 3:06
  • $\begingroup$ What is your desired outcome? Seems that you can avoid all of the errors that are thrown (& get an understandable result) by just taking again the first Part of each portion of A. That is, using A[[1, 1]] and A[[2, 1]]. This is because you are trying to multiply a matrix by a length 1 list, and to instead have it be the scalar value, you need to again take the first Part of the list to effectively remove the curly brackets around the scalar value. $\endgroup$ – CA Trevillian Oct 13 '20 at 3:15
  • $\begingroup$ Hi Trevillian, my desired outcome is a single matrix with single elements in each position $\endgroup$ – Victor Verga Oct 13 '20 at 3:17
  • $\begingroup$ A = Inverse[{{1/w1, w1}, {1/w2, w2}}].{2 xi1, 2 xi2}; That is replace {{2 xi1}, {2 xi2}} by {2 xi1, 2 xi2} $\endgroup$ – cvgmt Oct 13 '20 at 3:29
1
$\begingroup$
Clear["Global`*"]

k1 = 1600;
k2 = 600;
k3 = 3200;
m1 = 1;
m2 = 2;
(*Matriz de rigidez*)
K2 = {{+k1 + k2, -k2}, {-k2, k2 + k3}};
(*Matriz de massa*)
M2 = {{m1, 0}, {0, m2}};
w1 = 40;
w2 = 50;
xi1 = 1/10;
xi2 = 1/10;

Modifying the definition of A to result in a vector

A = Inverse[{{1/w1, w1}, {1/w2, w2}}].{2 xi1, 2 xi2};

(C2 = A.{M2, K2}) // MatrixForm

enter image description here

C2 // N // MatrixForm

enter image description here

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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