       Retrieving some results out of an approximate solution of a ballistics

• To: mathgroup at smc.vnet.net
• Subject: [mg131979] Retrieving some results out of an approximate solution of a ballistics
• From: sigismond kmiecik <sigismond.kmiecik at wanadoo.fr>
• Date: Fri, 8 Nov 2013 16:24:25 -0500 (EST)
• Delivered-to: l-mathgroup@mail-archive0.wolfram.com
• Delivered-to: l-mathgroup@wolfram.com
• Delivered-to: mathgroup-outx@smc.vnet.net
• Delivered-to: mathgroup-newsendx@smc.vnet.net

```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' == v*Cos[\[Theta]],
x == 0, y''[t] == -g - \[Kappa] y'[t], y' == v*Sin[\[Theta]],
y == 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

```

• Prev by Date: Re: Manipulate semi-share
• Next by Date: Re: Unit conversion of a list of quantities
• Previous by thread: Re: Unit conversion of a list of quantities
• Next by thread: Mathematica 9 crashes on Start up, after trying to initialse the