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


Groups > comp.soft-sys.math.mathematica > #7139 > unrolled thread

Terminate NDSolve by a condition

Started bySam Takoy <sam.takoy@yahoo.com>
First post2011-12-12 11:42 +0000
Last post2011-12-12 11:42 +0000
Articles 1 — 1 participant

Back to article view | Back to comp.soft-sys.math.mathematica


Contents

  Terminate NDSolve by a condition Sam Takoy <sam.takoy@yahoo.com> - 2011-12-12 11:42 +0000

#7139 — Terminate NDSolve by a condition

FromSam Takoy <sam.takoy@yahoo.com>
Date2011-12-12 11:42 +0000
SubjectTerminate NDSolve by a condition
Message-ID<jc4pbm$cfv$1@smc.vnet.net>
Hi,

Suppose I'm solving a system of ODE's for x[t] and y[t] and I know
that there is a periodic solution, but beyond that I know nothing, not
even how long the period is. So I want to stop NDSolve when x repeats
a certain value. Here's an example:

sol = NDSolve[{x'[t] == -Sin[t], y'[t] == Cos[t], x[0] == 1, y[0] ==
0}, {x, y}, {t, 0, 6}];
ParametricPlot[Evaluate[{x[t], y[t]} /. sol], {t, 0, 6}]

This solution goes from 0 to 6, but I want it to go from 0 until x(t)
= 1 again.

What's the best way to accomplish this?

Many thanks in advance,

Sam

[toc] | [standalone]


Back to top | Article view | comp.soft-sys.math.mathematica


csiph-web