1
$\begingroup$

I need help with my code. I need to calculate E^At (differential equations).

This is my code for solvig the equation:

sol = DSolve[{x'[t] == -x[t]/2 - y[t] + 64*z[t], y'[t] == -y[t]/4 - 16*z[t], z'[t] == y[t] - z[t]/4, x[0] == 1, y[0] == -1, z[0] == 0}, {x[t], y[t], z[t]}, t]

Also this is my matrix:

A = {{-1/2, -1, 64}, {0, -1/4, -16}, {0, 1, -1/4}} // MatrixForm

I'll be very thankful if you could provide me any help on how to approach this exercise. Thanks!!

$\endgroup$
2
  • 1
    $\begingroup$ MatrixExp. $\endgroup$ Jun 5, 2018 at 0:21
  • 1
    $\begingroup$ Welcome to Mathematica.SE! I suggest the following: 1) As you receive help, try to give it too, by answering questions in your area of expertise. 2) Take the tour and check the faqs! 3) When you see good questions and answers, vote them up by clicking the gray triangles, because the credibility of the system is based on the reputation gained by users sharing their knowledge. Also, please remember to accept the answer, if any, that solves your problem, by clicking the checkmark sign! $\endgroup$
    – Chris K
    Jun 5, 2018 at 1:20

1 Answer 1

4
$\begingroup$
A = {{-1/2, -1, 64}, {0, -1/4, -16}, {0, 1, -1/4}};

X[t_] := {x[t], y[t], z[t]};

Eqns = Thread[D[X[t], t] == A.X[t]]

sol = DSolve[{Eqns, x[0] == 1, y[0] == -1, z[0] == 0}, X[t], t]

Or just use MatrixExp as suggested in the comment.

Lets first extract the matrix A from the equations,

Eqns = {x'[t] == -x[t]/2 - y[t] + 64*z[t], y'[t] == -y[t]/4 - 16*z[t],
    z'[t] == y[t] - z[t]/4};

A = -CoefficientArrays[Eqns, {x[t], y[t], z[t]}][[2]] // Normal   

MatrixExp[A*t, {1, -1, 0}]
$\endgroup$

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