Discrete Event handling in Mathematica
- To: mathgroup at smc.vnet.net
- Subject: [mg67982] Discrete Event handling in Mathematica
- From: "Raj" <rajanikanth at gmail.com>
- Date: Thu, 20 Jul 2006 06:04:15 -0400 (EDT)
- Sender: owner-wri-mathgroup at wolfram.com
Hi!
Could somebody tell me if Mathematica can handle discrete events in
Ordinary Differential Equations.
For example in the following code
Clear[\[Theta], \[Theta]l, tl]
\[Theta]l = Sin[0.5]
tl = 0;
Reap[NDSolve[{\[Theta]'[t] == Sin[\[Theta][t]], \[Theta][0] ==
0.5}, \[Theta], {t, 0, 100},
Method -> {EventLocator, "Event" -> \[Theta]l (t - tl) - 0.01,
"EventAction" :> Sow[{tl = t, \[Theta]l = Sin[\[Theta][t]]}]}]]
I want Mathematica to print out tl and \[Theta]l everytime the "Event"
condition is met.
Thanks,
Raj