
Retrieving some results out of an approximate solution of a ballistics
Posted:
Nov 8, 2013 3:44 PM


I adapted and copied below a few lines of a notebook dealing with projectile motion seen on the Wolfram Demonstration Project.
v = 10.; \[Theta] = Pi/4.; h = 0.; g = 9.8; \[Kappa] = 0.5; (* initial speed, \ angle, height, gravity constant, drag constant *)
eqns = {x''[t] == \[Kappa] x'[t], x'[0] == v*Cos[\[Theta]], x[0] == 0, y''[t] == g  \[Kappa] y'[t], y'[0] == v*Sin[\[Theta]], y[0] == h};
soln = Flatten[ Quiet@NDSolve[eqns, {x, y}, {t, 0, Infinity}, Method > {"EventLocator", "Event" > y[t], "EventAction" :> Throw[tf = t, "StopIntegration"], "Direction" > 1}, MaxSteps > Infinity]]; (* soln : approximate solution *)
Show[{ParametricPlot[{x[t], y[t]} /. soln, {t, 0, tf}, AxesOrigin > {0, 0}, ImageSize > {400, 400}, ImagePadding > All, AxesLabel > {Style["Range", Bold, "Label"], Style["Height", Italic, Bold, "Label"]}, ImagePadding > 30]}]
I would like to get other results than the ones obtained in that notebook, speed and angle of trajectory at time of maximum height (angle should then be zero ) and time of fall, using a method similar to the one below with the approximate ODE solution as input:
ymax = Quiet@FindMaximum[{y[t] /. soln, 0 <= t <= tf}, {t, 0}] (* maximum height  time of max height *) xmax = Quiet@FindMaximum[{x[t] /. soln, 0 <= t <= tf}, {t, 0}] (* horizontal distance  time of fall *)
And last question, how can I get a parametric plot speed versus range? Replacing in the Show expression above x[t] and y[t] by x'[t] and y'[t] produces a graphic with an incomprehensible line.
Thanks
Sigismond Kmiecik

