2

Let

A(t)=(f1(t), f2(t); f3(t), f4(t)) be a 2*2 matrix

first of all how can I define the matrix A(t) as a function of t

then

I would like to define the determinant of A as a function, i.e.

d(t)=Det(A(t))

and then plot d(t).

Actually I want to write this function for n*n matrix where n>=2

thanks

Ghostman
  • 6,042
  • 9
  • 34
  • 53
asd
  • 337
  • 3
  • 5
  • 13
  • 6
    May I suggest you to review the answers you received to your previous questions? I see some very nice answers there, and you did not accept them (and sometimes not even upvote or comment on them!) – Dr. belisarius Nov 21 '11 at 13:07

1 Answers1

4

For example:

a[t_] := Table[Sin[(n + m) t], {n, 2}, {m, 2}]
d[t_] := Det[a[t]]
Plot[d[t], {t, 0, 2 Pi}]

enter image description here

If you don't have an explicit expression:

a[t_]:= {{f1[t],f2[t]},{f3[t],f4[t]}}

also works

Edit

Using the dimension as a parameter:

a[t_, n_] := Table[1/(j + k) t, {j, n}, {k, n}]
d[t_, n_] := Det[a[t, n]]
Plot[d[t, 5], {t, 0, 2 Pi}]

enter image description here

Edit

Plotting several dimensions in the same plot:

a[t_, n_] := Table[k^4/(j + k) t, {j, n}, {k, n}]
d[t_, n_] := Det[a[t, n]]
Plot[Evaluate@Table[d[t, n], {n, 2, 5}], {t, 0, 20}]

enter image description here

Dr. belisarius
  • 60,527
  • 15
  • 115
  • 190
  • @Timo We need more questions! :) – Dr. belisarius Nov 21 '11 at 13:03
  • @belisarius If that's so, could you try my question on the wave: http://stackoverflow.com/questions/7351519/instability-while-ndsolving-a-wave-equation – P. Fonseca Nov 21 '11 at 13:14
  • @P. Fonseca Sorry, there are lot of people here more versed on numerical DE solving than me here (and generally in numerical methods) ... if they couldn't help you enough I don't think I'll be able to – Dr. belisarius Nov 21 '11 at 13:28
  • @belisarius - Or this one http://stackoverflow.com/questions/8037224/how-to-create-a-mathematica-notebook-in-java-edit-ed ?? – nilo de roock Nov 21 '11 at 13:36
  • @nilo As I understand it, yours is a Java question. Seems you need to create a text file in Java. Is that so? – Dr. belisarius Nov 21 '11 at 13:41
  • It's a J/Link question actually, I provided the Java to show how far I am. I can do a command in Mathematica and get the result back as a string. But there are also methods like UseFrontEnd[] that can startup a frontend and so on from the Java program. I can find no exaomple programs for this however, and not much docs either. – nilo de roock Nov 21 '11 at 14:22