Solve 2D Particle Motion: NDSolve with Non-Constant Deceleration in Mathematica

  • Context: Mathematica 
  • Thread starter Thread starter Niles
  • Start date Start date
  • Tags Tags
    2d Mathematica
Click For Summary
SUMMARY

The discussion focuses on solving a 2D particle motion problem using Mathematica's NDSolve function. The user successfully implements a 1D motion equation with constant deceleration and seeks to extend this to a 2D scenario where the deceleration in the x-direction is non-constant and depends on both x and y coordinates. The proposed equations are d^2x/dt^2 = -200y - x and dy/dt = -2. Additionally, the user inquires about implementing a condition to halt calculations when the y-coordinate exceeds 5.

PREREQUISITES
  • Familiarity with Mathematica and its NDSolve function
  • Understanding of differential equations and their applications in physics
  • Knowledge of initial conditions in solving differential equations
  • Basic concepts of parametric plotting in Mathematica
NEXT STEPS
  • Explore advanced features of NDSolve for incorporating conditional stopping criteria
  • Research methods for implementing boundary conditions in differential equations
  • Learn about parametric equations and their graphical representation in Mathematica
  • Investigate non-linear differential equations and their solutions
USEFUL FOR

Mathematics students, physicists, and engineers interested in modeling particle motion and solving complex differential equations using Mathematica.

Niles
Messages
1,834
Reaction score
0
Hi

I am succesfully using NDSolve to find the solution of a 1D equation of motion:
Code:
solution = NDSolve[{x''[t] == -200, x[0] == 0, x'[0] == 100}, x, {t, 0, 1}];
ParametricPlot[{x[t], x'[t]} /. solution, {t, 0, 1}, PlotRange -> {{0, 100}, {0, 100}}]
This is a particle decelerating constantly in the x-direction. Now, I need to extend my problem, because the deceleration along x is actually not constant. It depends on both the x- and y-coordinate of the particle.

So the total problem is
<br /> \frac{d^2x}{dt^2} = -200y - x\\<br /> \frac{dy}{dt} = -2<br />
So along x there is non-constant deceleration, and along y I have a constant velocity. Is it possible to solve such a problem in Mathematica?

Best regards and thanks in advance,
Niles.
 
Last edited:
Physics news on Phys.org
Sure:

Code:
solution = 
 NDSolve[{x''[t] == -200 y[t] - x[t], y'[t] == -2, x[0] == 0, 
   x'[0] == 100, y[0] == 0}, {x[t], y[t]}, {t, 0, 1}]
 
Thanks, that is kind of you. NDSolve is a pretty powerful tool.

The initial condition y'(0) is something that changes for different problems. However, my particle is not allowed to move further than y=5. If it does so, then it is "lost", and its solution is not relevant to my problem any longer. Is there a way to incorporate this into NDSolve, i.e. that it should stop calculating further if y(t) == 5?Niles.
 

Similar threads

  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 4 ·
Replies
4
Views
4K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 3 ·
Replies
3
Views
6K
  • · Replies 1 ·
Replies
1
Views
4K
  • · Replies 3 ·
Replies
3
Views
8K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 3 ·
Replies
3
Views
3K
  • · Replies 1 ·
Replies
1
Views
3K