Message Boards Message Boards


How to solve a kinematics exercise with a differential equation?

Posted 13 days ago
13 Replies
7 Total Likes

I am wondering how to solve a kinematics exercise with a differential equation. I want to respect other author's copyright and the solution to their exercises, so I won't put the word problem here but if its okay I'll come up with a similar problem and ask for help solving that and then I'll be able to solve the problem from my textbook.

Otherwise, I think this will be taken down.

This is based on Giancoli Physics: Principles with Applications 7th edition, chapter 2 Describing Motion: Kinematics in One Dimension, page 45, problem 53, level III, which means a Challenge problem.
Douglas Giancoli states on page 43 (with Grammarly corrections applied to the quote), "The Problems at the end of each Chapter are ranked I, II, or III according to estimated difficulty, with level I Problems being easiest. Level III is meant as challenges for the best students."

This is a similar problem that I think could be reframed as a differential equation. A falling stone takes 0.2718 s (I'm choosing a time based on the digits of Euler's number) to travel past a window 2.718 m tall. From what height above the top of the window did the stone fall?

I think this could be modeled as an initial value problem for a second-order differential equation. It also might be a differential algebraic equation or a delay-differential equation that could be solved with DSolve. Once I figure out how to abstract the problem, I can make the computer do the calculations, get the result, and interpret the answer in the context of the problem.

My question is, what question should I ask in Computer-Based Maths step 1? Computer-Based Maths step 2 is abstract, which I think will be an ODE, and step 3, I think, will be DSolve and step 4 will be writing a conclusion.

POSTED BY: Peter Burbery
13 Replies

We can consider your problem a "uniform acceleration" problem, and it can be cast as a differential equations problem, as you desire. It's one of the simplest differential equations, one that was solved long before calculus was formally invented. (Applying differential equations to it is a bit like using a sledge hammer on a brad to hang a picture, only you don't really have to worry about hitting this problem too hard.) But in for a penny, in for a pound:

accelerationBVPTemplate = <|
    "System" -> {x''[t] == #acceleration},
    "BoundaryConditions" -> {x[#t1] == #x1, x[#t2] == #x2} |> &;
solutionEvent = WhenEvent[x'[t] == 0, Return[x[t], NDSolve]];
myProblem = <|
   "acceleration" -> -9.8,
   "t1" -> 0, "x1" -> 0,
   "t2" -> E/10, "x2" -> -E
fallingPastWindowProblem = {
{{{x''[t] == -9.8}, {x[0] == 0, x[E/10] == -E}}, 
 WhenEvent[x'[t] == 0, Return[x[t], NDSolve]]}
NDSolve[fallingPastWindowProblem, {}, {t, -Infinity, 0}]
(*  3.83342  *)

Sometimes NDSolve is pure magic. The object was dropped 3.83 meters above the window.


  1. The first output shows the actual equations being used by NDSolve.
  2. The Return[x[t], NDSolve] causes a return before NDSolve is finished. It returns the value of x[t] rather than the usual value that NDSolve was planning to return. The code asks NDSolve to plan to return nothing, that is, {}, since we won't use the trajectory x. You can use Throw and Catch instead of Return[] if you prefer (Throw inside WhenEvent and Catch outside NDSolve). Return[] looks neater to me.
  3. A "boundary condition" is when two quantities happen to be equal at a particular instant. You have two boundary conditions, when the object passes the top of window and when it passes the bottom. If all boundary conditions occur at the same instant, they are often called "initial conditions", and the problem is called an "initial value problem" (IVP). But in the problem at hand, they occur at different instants, and the problem is called a "boundary value problem" (BVP).
  4. When there is a relation between quantities at different times that holds for all "future" times (say, after the starting time) and not just at an instant, we have a delay differential equation, such as u'[t] = u[t-2]. That is not the case here.
  5. The object was dropped before it passed the window, which started happening at $t=0$. We don't know how long before, so we go ahead and ask NDSolve to integrate back to -Infinity trusting that Return[] will stop it. (You should see what happens if you set gravity to 9.8 instead of -9.8. It's good to know what happens when you mess up.)
  6. I assumed the object was dropped with an initial velocity of zero, hence the event at x'[t] == 0 in WhenEvent[]. If it was released with a velocity v0, change the event condition to x'[t] == v0 and fill in the number for v0 before calling NDSolve.
  7. The use of named arguments and associations was just me wanting to experiment with them to see if they make the code more readable & reusable. The first output just shows the system that is constructed. One could easily type the code directly, and probably more quickly.
  8. WhenEvent is a wonderful numerical solver. It's more finicky in DSolve. To get the solution out of dsol = DSolve[..], one can change the event to WhenEvent[x'[t] == 0, "StopIntegration"] and retrieve the value of x[t] from the result in a number of ways. For instance FunctionRange[x[t] /. dsol, t, x], or to isolate the numerical value, MaxValue[{x, FunctionRange[x[t] /. dsol, t, x]}, x].
POSTED BY: Michael Rogers

If for example the stone was thrown down at e meters per second, would this be the solution?

accelerationBVPTemplate = <|"System" -> {x''[t] == #acceleration}, 
    "BoundaryConditions" -> {x[#t1] == #x1, x[#t2] == #x2}|> &;
solutionEvent = 
  WhenEvent[x'[t] == -E(*new velocity*), Return[x[t], NDSolve]];
myProblem = <|"acceleration" -> -9.8, "t1" -> 0, "x1" -> 0, 
   "t2" -> E/10, "x2" -> -E|>;
fallingPastWindowProblem = {Values@accelerationBVPTemplate[myProblem],
NDSolve[fallingPastWindowProblem, {}, {t, -Infinity, 0}]

I put a comment to clearly indicate where I changed the code.

POSTED BY: Peter Burbery

Yes, that is correct.

You might consider why this goes wrong, if you want to think about assumptions in modeling:

solutionEvent = 
  WhenEvent[x'[t] == -4 E(*new velocity*), Return[x[t], NDSolve]];
POSTED BY: Michael Rogers

What you have written is a delay differertial equation (DDE). But it can (and should) be cast as an ODE, noting that speed changes due to constant acceleration as the stone traverses from top to bottom of the window.

POSTED BY: Daniel Lichtblau

How can I cast it as a differential equation?

POSTED BY: Peter Burbery

You are making this way to hard for a problem on page 45. In fact it does not require a differential equation.

Call the time the stone reaches the top of the window t. You are positing that it reaches the bottom at t+E/10. If the gravitational acceleration is a (I'm keeping things symbolic for now) and we call the position function s(t), then the standard physics gives s(t)=a t^2/2+constant (assuming zero initial velocity). The constant part will get removed from subtracting the position at window top from bottom.

Step 1: Figure out the time (in seconds) the stone took to reach the window top.

In[469]:= timesol = First[Solve[a/2*(t + E/10)^2 - a/2*t^2 == E, t]]

(* Out[469]= {t -> (200 - a E)/(20 a)} *)

Step 2: Plug that into the distance formula to find out how far it had traveled in that time. Here I plug in a decent approximation to the gravitational constant so we can get a number in meters.

In[471]:= a/2*t^2 /. timesol /. a -> 9.8

(* Out[471]= 3.83342 *)

Note: No DDE's were harmed in the making of this problem solution.

POSTED BY: Daniel Lichtblau

I made a Manipulate

  timeSolution = 
     a/2 (t + timetofallpastwindow)^2 - a/2 t^2 == heightOfWindow, 
     t]]; a/2 t^2 /. timeSolution /. 
   a -> 9.8], {{timetofallpastwindow, 0.2718, 
   "Time to fall past window"}, 0.1, 
  1}, {{heightOfWindow, E, "Height of Window"}, 1, 5}]
POSTED BY: Peter Burbery
  timeSolution = 
     a/2 (t + timetofallpastwindow)^2 - a/2 t^2 == heightOfWindow, 
     t]]; a/2 t^2 /. timeSolution]]
returns a symbolic answer of (-2 heightOfWindow + 
  a timetofallpastwindow^2)^2/(8 a timetofallpastwindow^2)
POSTED BY: Peter Burbery

I made a new Manipulate.

Manipulate[(-2 heightOfWindow + a timetofallpastwindow^2)^2/(
 8 a timetofallpastwindow^2), {{timetofallpastwindow, 0.2718, 
   "Time to fall past window"}, 0.1, 
  1}, {{heightOfWindow, E, "Height of Window"}, 1, 
  5}, {{a, 9.8, "Acceleration of gravity"}, 9.8, 9.82, 0.0001}]
POSTED BY: Peter Burbery

Could I make it work with a delay-differential equation? I don't understand why DSolve couldn't solve the delay-differential equation.

POSTED BY: Peter Burbery

The problem is in no way a DDE. In particular, the delay is not in the derivative, it's in the distance condition. And it is with respect to a specific time, not something that applies to all times t. Try instead (note corrected sign error)

rt = DSolveValue[{r''[t] == -9.8, r[t0 - 0.2718] - r[t0] == -2.718,  r[0] == 0}, r[t], t]

(* Out[173]= -4.9 (-1.76902 t + 1. t^2 - 2. t t0) *)

I do not claim this to be a good way to solve the problem, only that this can be used for a more indirect approach. You'd still need the initial velocity condition that was not used in the DE above in order to solve for t0.

Solve[(D[rt, t] /. t -> 0) == 0, t0]

(* {{t0 -> -0.884508}} *)

This can then be used to figure out r[t0].

POSTED BY: Daniel Lichtblau

I thought since it is a kinematics equation, the problem could be cast as a differential equation. I thought the case with a difference of 0.2718 s would make it an application of discrete shift or discrete delta.

POSTED BY: Peter Burbery

Please make sure you know the rules:
Your post is too vague. Please describe your subject extensively providing technical details, code, examples, and other relevant ideas, so it is clear what exactly you are looking for.

POSTED BY: Moderation Team
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
or Discard

Group Abstract Group Abstract