I've tried to solve this differential equation system, buy without any luck.
This is my code:
RSolve[{x'[t] == x[t] - y[t], y'[t] == 5 x[t] - 3 y[t], x[0] == 1, y[0] == 2}, {x[t],
y[t]}, t]
Can anyone tell me what I've done wrong?
Mathematica Stack Exchange is a question and answer site for users of Wolfram Mathematica. It only takes a minute to sign up.
Sign up to join this communityI've tried to solve this differential equation system, buy without any luck.
This is my code:
RSolve[{x'[t] == x[t] - y[t], y'[t] == 5 x[t] - 3 y[t], x[0] == 1, y[0] == 2}, {x[t],
y[t]}, t]
Can anyone tell me what I've done wrong?
I recommend using math: $\ \ \ \dot x=Ax\ \Rightarrow\ x=\text{e}^{At}\ x_0$
A = {{1, -1}, {5, -3}};
MatrixExp[A t].{1, 2} //FullSimplify
gives: $\ \ \ x_1=\text{e}^{-t}\cos{t},\ \ \ x_2=(2+\tan t)\ x_1$
$ $
edit: With one more line, in an intermediate calculation you can can eliminate all six numbers:
A = {{a, b}, {c, d}};
MatrixExp[A t].{x1, x2} // FullSimplify
% /. {a -> 1, b -> -1, c -> 5, d -> -3, x1 -> 1, x2 -> 2} // FullSimplify
MatrixExp[]
: MatrixExp[{{a, b}, {c, d}} t, {x1, x2}]
$\endgroup$
– J. M.'s ennui♦
Apr 13 '13 at 17:21
s = DSolve[{x'@t == x@t - y@t, y'@t == 5 x@t - 3 y@t, x@0 == 1, y@0 == 2}, {x, y}, t]
ParametricPlot[{x[t], y[t]} /. s, {t, 0, 5}, AspectRatio -> 1, PlotRange -> All]
Animate[Graphics[{PointSize[Large], Point[{x[t], y[t]} /. s]},
PlotRange -> {{-1, 1}, {-2, 2}}, Axes -> True], {t, 0, 10, .01}]
DSolve
.RSolve
is not for differential equations. $\endgroup$ – m0nhawk Apr 13 '13 at 13:24RSolve[]
is for difference equations;DSolve[]
is for differential equations. A matter of continuous versus discrete. $\endgroup$ – J. M.'s ennui♦ Apr 13 '13 at 13:52