0
|
431 Views
|
5 Replies
|
4 Total Likes
View groups...
Share

# 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} 
5 Replies
Sort By:
Posted 27 days ago
 See here for MoreRegards M.I.
Posted 26 days ago
 it seems like whenever i include sol= at the beginning of the equation, i get this error
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 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 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