The Math Forum

Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Math Forum » Discussions » Inactive » comp.soft-sys.math.mathematica

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: Retrieving some results out of an approximate solution of a ballistics
Replies: 0  

Advanced Search

Back to Topic List Back to Topic List  
Sigismond Kmiecik

Posts: 14
Registered: 4/17/06
Retrieving some results out of an approximate solution of a ballistics
Posted: Nov 8, 2013 3:44 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

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.


Sigismond Kmiecik

Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.