MathGroup Archive 2012

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

Search the Archive

NDSolve and conditions


Hi

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,
Niles.



  • 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