Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #16195

Retrieving some results out of an approximate solution of a ballistics

From sigismond kmiecik <sigismond.kmiecik@wanadoo.fr>
Newsgroups comp.soft-sys.math.mathematica
Subject Retrieving some results out of an approximate solution of a ballistics
Date 2013-11-08 20:44 +0000
Message-ID <l5jig8$lo3$1@smc.vnet.net> (permalink)
Organization Time-Warner Telecom

Show all headers | View raw


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

Back to comp.soft-sys.math.mathematica | Previous | Next | Find similar | Unroll thread


Thread

Retrieving some  results out of  an approximate solution of a ballistics sigismond kmiecik <sigismond.kmiecik@wanadoo.fr> - 2013-11-08 20:44 +0000

csiph-web