tags:

views:

61

answers:

3

I'm trying to solve a really simple problem of finding object position under force {k1+k2 * y, k3*t}. Here's what I'm entering into Mathematica 7:

DSolve[{
  x''[t]*m == k1 + k2*y[t],
  y''[t]*m == k3*t,
  y'[0] == 0,
  y[0] == 0,
  x'[0] == 0,
  x[0] == 0
}, {x[t], y[t]}, t]

and I get this error:

DSolve::deqn: Equation or list of equations expected instead of True in the first argument {-C m (x^[Prime])[t]^2==k1+k2 y[t],m (y^[Prime][Prime])[t]==k3 t,True,y[0]==0,True,x[0]==0}.

It seems that Mathematica is unhappy about boundary conditions x'[0] == 0. Why is that?

+3  A: 

It worked as you typed it ... try to do it in a fresh notebook

alt text

belisarius
+2  A: 

When I cut and paste the code you've posted into M'ma 7.0.1 and evaluate, I get the result

{{x[t] -> (60*k1*m*t^2 + k2*k3*t^5)/(120*m^2), 
     y[t] -> (k3*t^3)/(6*m)}}

Your M'ma error message tells me you actually have only one prime on x (i.e. x'[t]) in your actual M'ma input. The equation it cites, -C m (x^[Prime])[t]^2==k1+k2 y[t], does not match the first line of your code above.

I also suspect that x'[0] and y'[0] have been assigned to zero previously, which is causing x'[0]==0, ..., y'[0]==0 to both collapse to True. Best way to test: kill your kernel and re-evaluate the input above (after fixing typos).

Eric Towers
A: 

Both, belisarius and Eric Towers have suggested killing the kernel and re-evaluating. They're most likely correct in that something has a prior definition. You can check if that is true via

?<variable name>

As an alternative to killing the kernel, I'd suggest clearing their values via

Clear[x, y, k1, k2, k3, m]

Or, if you really want to rid yourself of any definition of a variable there's Remove. This way, you won't have to recalculate anything else from your current session.

rcollyer