2

I don't get any answer when I evaluate the following expression:

DSolve[{x'[t] == -0.5*y[t] + 1 + 3*(e^(-2*t)), 
        y'[t] == 2*x[t] - y[t] - 4 - 4* (e^(-t)), 
        y[0] == 0, x[0] == 0}, {x[t], y[t]} , t]

Did I go wrong somewhere?

I tried solving this equation set with Laplace as well, but I didn't get any answer from that either.

m_goldberg
  • 107,779
  • 16
  • 103
  • 257
DSaad
  • 1,173
  • 2
  • 14
  • 19

2 Answers2

6

Try replacing the .5by 1/2 and the e by E. Also, the asterisks aren't needed in Mathematica.

s = DSolve[
 {x'[t] == -1/2 y[t] + 1 + 3 E^(-2 t),
  y'[t] == 2 x[t] - y[t] - 4 - 4 E^(-t),
  y[0]  == 0, 
  x[0]  == 0}, {x[t], y[t]}, t]

ParametricPlot[{x[t], y[t]} /. s, {t, 0, 10}, AxesOrigin -> {0, 0}]  

Mathematica graphics

Dr. belisarius
  • 115,881
  • 13
  • 203
  • 453
3

Two problems here are e instead of E and 0.5 instead of 1/2. For a larger system it would be more reasonable to use Rationalize instead of substituting all numbers by hand. To get a wider class of solutions we could define a function being a solution of the system of differential equations, where the initial values are parametrized by x0:

ds[x0_] = Simplify @ DSolve[ Rationalize @ {x'[t] == -0.5*y[t] + 1 + 3*(E^(-2*t)),
                                            y'[t] == 2*x[t] - y[t] - 4 - 4*(E^(-t)), 
                                            y[0] == 0, 
                                            x[0] == x0},     {x[t], y[t]}, t]

enter image description here

originally x0 == 0, i.e.

ds[0]

enter image description here

To plot the wider class of solutions we could use ParametricPlot as in belisarius answer with Show emphasizing ds[0] solution as a red thick curve :

Show[
      ParametricPlot[{x[t], y[t]} /. Table[ds[x0], {x0, -2, 4, 0.2}],
                                                   {t, -1, 10}, Evaluated -> True], 
      ParametricPlot[{x[t], y[t]} /. ds[0], {t, -1, 10}, 
                                             PlotStyle -> {Darker@Red, Thickness[0.007]}],
      AxesOrigin -> {0, 0}, PlotRange -> {{-1, 6}, {-4, 5}}]

enter image description here

Artes
  • 57,212
  • 12
  • 157
  • 245