MathGroup Archive 2012

[Date Index] [Thread Index] [Author Index]

Search the Archive

NDSolve and conditions

  • To: mathgroup at
  • Subject: [mg125504] NDSolve and conditions
  • From: Niles <niels.martinsen at>
  • Date: Fri, 16 Mar 2012 06:31:15 -0500 (EST)
  • Delivered-to:


I wish to solve the following system of ODEs in Mathematica:

x'' = -200y - x
y'  = -2

The equations describe the equations of motion for a particle moving in 2D.  This is easily done using NDSolve:

solution = NDSolve[{x''[t] == -200y[t]-x[t], y'[t] == -2, x[0] == 0, x'[0] == 100, y[0] == 0}, {x[t], y[t]}, {t, 0, 5}]

Now, I need to solve this for a range of random initial velocities. However, there is the restriction that the particle has to stay within -5<y<5. If it goes beyond that, I can't use the solution and I want to discard it. Is there a way to implement this into NDSolve?

Best wishes,

  • Prev by Date: More powerful text processing
  • Next by Date: Re: Export Data and Decimal Separator
  • Previous by thread: Re: More powerful text processing
  • Next by thread: Symbolic tensor analysis in Mathematica 8