0
$\begingroup$

With this code I get an error-message:

Equation or list of equations expected instead of True in the first argument.

Apparently y'[0] == v0 gives True. The code does work if I put y'[1] == v0.

Question: what is happening here and why and how can I avoid this?

a = 1
b = 0.2
c = 4
y0 = 8.5
v0 = 0
DSolve[{a y''[t] + b y'[t] + c y[t] == 0, y[0] == y0, y'[0] == v0}, y[t], t]

By the way, if I use DSolveValue, then I get the same results, though with a different error-message:

Equation or list of equations expected in the first argument.

$\endgroup$

closed as off-topic by m_goldberg, Michael E2, user9660, MarcoB, b.gates.you.know.what May 1 '16 at 21:03

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "This question arises due to a simple mistake such as a trivial syntax error, incorrect capitalization, spelling mistake, or other typographical error and is unlikely to help any future visitors, or else it is easily found in the documentation." – m_goldberg, Community, MarcoB, b.gates.you.know.what
If this question can be reworded to fit the rules in the help center, please edit the question.

2
$\begingroup$

Here is what I get when I try your equation:

a = 1; b = 0.2; c = 4; y0 = 8.5; v0 = 0;

DSolve[{a y''[t] + b y'[t] + c y[t] == 0, y[0] == y0, y'[0] == v0}, y[t], t]

(* {{y[t] -> 8.5 E^(-0.1 t) (1. Cos[1.9975 t] + 0.0500626 Sin[1.9975 t])}} *)

You may need to restart your kernel and try again.

$\endgroup$
  • $\begingroup$ Hmmm, that indeed worked! But... why? $\endgroup$ – GambitSquared May 1 '16 at 10:58
  • 2
    $\begingroup$ @ImreVégh. It could be one of a variety of reasons. You may have previously stored a value in y'[0], so when you used y'[0] == v0 you got the result True. $\endgroup$ – RunnyKine May 1 '16 at 10:58
  • $\begingroup$ @ImreVégh If RunnyKine is right, see the answers here for further explanation. $\endgroup$ – Michael E2 May 1 '16 at 13:02

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