0

I'm trying to create an ODE for motion in 2 dimensions. What I have so far is:

x0 = {1.5, -4.}; 
v = {0, 8}; 
DSolve[{x'[t] == v, x[0] == x0}, x[t], t]

This works with one dimension, but when I try and expand the idea for a vector/matrix, I get:

DSolve::nolist: List encountered within {(x^\[Prime])[t]=={0,8}}. There should be no lists on either side of the equations.

How do I fix this?

Quark Soup
  • 1,610
  • 9
  • 14

1 Answers1

5

MMa doesn't know x[t] is a vector, so try this.

x0 = {1.5, -4.};
v = {0, 8};
x[t_] = {x1[t], x2[t]}

eq = x'[t] == v // Thread
(*{x1'[t] == 0, x2'[t] == 8}*)

init = x[0] == x0 // Thread
(*{x1[0] == 1.5, x2[0] == -4.}*)

DSolve[{eq, init}, x[t], t]
(*{{x1[t] -> 1.5, x2[t] -> 8 t - 4.}}*)

x[t] /. %
(*{{1.5, 8 t - 4.}}*)
Bill Watts
  • 8,217
  • 1
  • 11
  • 28