1

I am trying to solve a differential equation in Mathematica, and I don't really understand it very well. I will show the equation, my attempt and the error message below:

equation:

dp(t)/dt=rb(1-p(t))

attempt:

b = .02;
d = .015;
r = .1;
h = 1;
t = 0;
Clear[p, t]
DSolve[{p'[t] == r*b*(1 - p[t]), p[0] == .01}, p[t], t]

Error:

DSolve::deqn: Equation or list of equations expected instead of True in the first     argument {True,p[0]==0.01}. >>
user1814946
  • 181
  • 2
  • 11
  • 1
    Your code works for me, you just defined p or p' before, and have to clear it. I have no idea how, http://stackoverflow.com/questions/12454887/mathematica-clear-a-functions-derivative-definition and this doesn't help. Try to change t variable, or close mathematica and reload your workbook. – phadej Nov 11 '13 at 19:30

1 Answers1

1

You cannot set t=0 because then it is a number. On a session the following gives

b = 2/100;
d = 15/1000;
r = 1/10;
h = 1;

DSolve[{p'[t] == r*b*(1 - p[t]), p[0] == .01}, p[t], t]

Mathematica graphics

halirutan
  • 4,281
  • 18
  • 44