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


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

NDSolve and conditions

From Niles <niels.martinsen@gmail.com>
Newsgroups comp.soft-sys.math.mathematica
Subject NDSolve and conditions
Date 2012-03-16 11:31 +0000
Organization Steven M. Christensen and Associates, Inc and MathTensor, Inc.
Message-ID <jjv8b5$peb$1@smc.vnet.net> (permalink)

Show all headers | View raw


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.

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


Thread

NDSolve and conditions Niles <niels.martinsen@gmail.com> - 2012-03-16 11:31 +0000

csiph-web