Questions tagged [event-detection]

Questions on events in differential equations, which may arise from WhenEvent or discontinuous coefficients in the commands NDSolve and DSolve.

Questions on events in differential equations, which may arise from WhenEvent or discontinuous coefficients in the commands NDSolve and DSolve. Before V9, WhenEvent did not exist, and events were handled by the "EventLocator" method (in NDSolve only).

Useful links

Example questions

143 questions
2
votes
1 answer

Understanding WhenEvent option: "DiscontinuitySignature"

Trying to understand WhenEvent I modified a simple Example (Help WhenEevent) {X, V} = NDSolveValue[{Derivative[1][x][t] == v[t], x[0] == 2 , WhenEvent[1 == x[t], v[t] -> "DiscontinuitySignature"] , v[0] == 1}, {x, v}, {t, 0, 2},…
Ulrich Neumann
  • 53,729
  • 2
  • 23
  • 55
0
votes
0 answers

Mod[] does not work correctly in WhenEvent

From the expression we know Mod[t,1]==0 and Sin[2 [Pi] t] > 0 are equivalent in WhenEvent. This can be seen from the results below. {sol, data} = Reap@NDSolve[{x'[t] == Cos[t], x[0] == 0, WhenEvent[x[t] > 0, Sow[{t, x[t]}]]}, x, {t, 0,…
metroidman
  • 545
  • 7
0
votes
0 answers

How to use WhenEvent?

I am trying to locate the time when $R=1,T=0,P=0$ in my system of equations, but I get the following errors: here is the code: m = 1; q = 1; V[t_] := 1; B0[t_] := 1; \[CapitalOmega] = 1/27; Br[t_, r_, \[Theta]_, \[Phi]_] := B0[t]/r^2; Bt[t_, r_,…
mattiav27
  • 6,677
  • 3
  • 28
  • 64