Message Boards Message Boards

NDSolve error inside Plot: $RecursionLimit :Recursion depth of 1024 exceeded

Posted 27 days ago

hello, i have been trying to plot the maximum range for theta for a projectile motion experiencing linear drag, but i keep getting errors regarding the written code. when trying to transform y[t] to a function yy[t_] rather than the replacement rule there seems to be no wolfram language translation found and when rooting i get a message:$RecursionLimit :Recursiondepthof1024exceeded.

tfinal[theta_]:=[s=NdSolve[{x' ' [t] == b x' [t] , y' ' [t] == -b y' [t] - g, x[0] == 0, y[0] == 0, x'[0] == v Cos [theta], y'[0] == v Sin[theta]}, {x,y}, {t, 0, 10}]; 
    yy[t_] := y[t] /. s[[1]]; 
    xx[t_] := x[t] /. s[[1]]; 
    xfinal[theta_]:=x[tfinal[theta]]
    plot[xfinal[theta], {theta,0.01,2.5}
POSTED BY: jony will
5 Replies

See here for More

Regards M.I.

POSTED BY: Mariusz Iwaniuk
Posted 26 days ago

it seems like whenever i include sol= at the beginning of the equation, i get this error enter image description here

POSTED BY: jony will
Posted 26 days ago

That looks like you're trying to use the free-form input, which attempt to interpret natural language input. On Mac you get this by typing "Ctrl-=", is that what you're doing? What you want is just a plain input cell.

POSTED BY: Eric Rimbey
Posted 26 days ago

im not even on mac, and im using the online version of wolfram, but it seems to be using free format input none less

POSTED BY: jony will
Posted 27 days ago

Maybe this will help you a little

sol=Simplify[{x[t],y[t]}/.DSolve[{x''[t]==b x'[t],y''[t]==-b y'[t]-g,x[0]==0,y[0]==0,x'[0]==v Cos[theta],y'[0]==v Sin[theta]},{x,y},t][[1]]];
yy[t_]:=sol[[2]];yy[t]
xx[t_]:=sol[[1]];xx[t]

which displays

(g*(1-E^(-b*t)-b*t)+b*(1-E^(-b*t))*v*Sin[theta])/b^2

and

((-1+E^(b*t))*v*Cos[theta])/b
POSTED BY: Bill Nelson
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