0
$\begingroup$

I do not use Mathematica for a long time and I have a question about a matrix problem.

I add here the code:

\[Omega] = 2 \[Pi]*f;
v = Sqrt[c/r];
c = Subscript[c,0] + I*\[Omega]*n1];
k1 = \[Omega]*Sqrt[r1/c];
k2 = \[Omega]*Sqrt[r2/m]]; 

y = ({{x1},{x2},{x3},{x4},{x5},{x6}});
amat = ({{e/[\[CurlyEpsilon]], e/[\[CurlyEpsilon]], 0, 0, 0, 1},
{e/[\[CurlyEpsilon]]*E^(I*k1*h1),e/[\[CurlyEpsilon]]*E^(-I*k1*h1), 0, 0, h1,1},{I*c*k1, -I*c*k1, 0, 0, e, 0},{I*c*k1*(E^(I*h1*k1)) , -I*c*k1*(E^(-I*h1*k1)), -I*k2*m*(E^(I*h1*k2)) , I*k2*m*(E^(-I*h1*k2)) , e, 0},
{E^(I*h1*k1), E^(-I*h1*k1), -E^(I* h1*k2), E^(-I* h1*k2), 0, 0},
{0, 0, E^(I*k2*(h1+h2)),-E^(-I*k2*(h1+h2)),0,0}});

bmat = ( {{\[CurlyPhi]},{-[\[CurlyPhi]},{0},{0},{0},{0}});

Solve[amat.y == bmat, {x1, x2, x3, x4, x5, x6}]

This is what I tried so far. So, for a specific value of frequency, I can take the results for column y (x1,x2,x3,x4,x5, and x6), but I want to get at the same time the results for a range of frequencies (f goes from fmin to fmax). What is the best way to do that?

P.S. When I'll get the list of the values for the y column, can I isolate the results of one of them (i.e, x2) and calculate something else with that?

Thank you in advance. :)

$\endgroup$
8
  • 3
    $\begingroup$ Pasting the code that you have tried out so far establishes a reference point for the respondents. I recommend that you include your code and explain where you got stuck to get effective responses. $\endgroup$
    – Syed
    Oct 18 at 11:40
  • $\begingroup$ How clumsy of me! I forgot to say "Welcome to the Mathematica Stack Exchange". $\endgroup$
    – Syed
    Oct 18 at 11:50
  • $\begingroup$ @Syed hello, Syed and thanks a lot. I edit my post and added the code. $\endgroup$
    – Ioanna
    Oct 18 at 13:10
  • $\begingroup$ Please use lowercase letters; I switched amat for A and bmat for B. Then: sol = Solve[amat . y == bmat, {x1, x2, x3, x4, x5, x6}]; gets these solutions into a list. In order to get individual items: e.g., x1 /. sol /. {f -> fmin, Subscript[h, q] -> 3} etc. Another note: avoid subscripts if possible. $\endgroup$
    – Syed
    Oct 18 at 13:52
  • $\begingroup$ y = {x1, x2, x3, x4, x5, x6} would work as it is considered a vector in Mma. $\endgroup$
    – Syed
    Oct 18 at 14:04

Your Answer

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

Browse other questions tagged or ask your own question.