Message Boards Message Boards

[?] Deal with "Encountered non-numeric value for a derivative at t == 0" ?

Posted 5 years ago

Hi, new in mathematica and im facing a problem. Im trying to solve a diferencial equation with NDSolve and but the error "Encountered non-numeric value for a derivative at t == 0" shows. I understand the nature of the error but I don't know how to manage it. The function im obtaining is defined in the small interval t around 0 to 1. Here the code:

V=NDSolve[{v'[t]==-g +(a*ve)/(mr+mw*Exp[-ve*t]) +(mw*ve*Exp[-ve*t])/(mr+mw*Exp[-ve*t])*v[t]-(b/(mr+mw*Exp[-ve*t]))*v[t]^2 ,v[0]==0.01},v[t],{t,0.01,0.4}]

Here is an screenshot: enter image description here Thank you!

POSTED BY: L GonGa

Difficult to say without the full code. You are using numerical integration so, you will have to define the parameters before integrating. This here, for example, works:

g = -9.81; a = 0.4; ve = 4.3; mr = 0.2; mw = 0.5; b = 0.1;

V = NDSolve[{v'[
     t] == -g + (a*ve)/(mr + 
        mw*Exp[-ve*t]) + (mw*ve*Exp[-ve*t])/(mr + mw*Exp[-ve*t])*
      v[t] - (b/(mr + mw*Exp[-ve*t]))*v[t]^2, v[0] == 0.01}, 
  v[t], {t, 0.01, 0.4}] 

Plot[v[t] /. V, {t, 0.01, 0.4}]

enter image description here

Cheers,

Marco

POSTED BY: Marco Thiel
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract