# Questions tagged [event-detection]

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

140 questions
Filter by
Sorted by
Tagged with
1 vote
70 views

### Discrete number does not work well in DSolve

The code below works fine. ...
74 views

### Which condition is better for WhenEvent?

I'm solving a non-linear system with NDSolve. See my previous post In the WhenEvent, which one is better for ODE solving ...
198 views

### Is there a way to improve the speed of the NDSolve in my code?

I want to tell the background before raising the question of details. My boss and I are designing synthersizer in a millimeter-wave chip. He analyzes the transient behavior with Julia. His code is ...
54 views

### Event control in delay differential equations

A delay-differential system for variables {y[t],z[t]} is defined by time-lag w {y'[t] == (r (1 - y[t] - z[t]) - 1) y[t], z'[t] == (y[t] - y[t - w])}; The ...
1 vote
82 views

### Dynamically generate system to use with NDSolve

I have a d-dimensional differential equation that I want to solve that takes the following form: When d = 1: ...
38 views

### How can I resolve the error in using WhenEvent to solve the cooling of liquid, where the cooling coefficient changes for some time?

I am trying to solve the cooling of liquid in which the cooling coefficient changes for some time. I attempted to solve it using WhenEvent, but it is showing an error. ...
1 vote
60 views

### Multiple function definition inside a whenevent [closed]

I am trying to implement a whenevent inside a NdSolve such that when a particle reaches within earths radius its position becomes a constant <0,0,0>. When I set one function x[t]-> 0 it works....
209 views

### Detecting existence of period orbit

I wish to detect the existence of a periodic orbit (limit cycle). For example, the test should return FALSE (i.e. it should fail) for the left (m = 0.35) and ...
99 views

### Problem with bifurcation diagram for driven damped pendulum

I am using the following equation of motion for a driven damped pendulum: $$\frac{d^2\theta}{dt^2} = -\frac{g}{l}\sin \theta -\gamma \frac{d\theta}{dt} + A\sin(\omega_d t)$$ where $\theta$ is the ...
29 views

### Issues while using WhenEvent and HeavisideTheta inside NDSolve

What I am doing? Integrating a piece-wise ODE using NDSolve. The piece-wise part is governed by HeavisideTheta. Objective? The goal is to update numerical values when an event is detected. This is ...
1 vote
82 views

### Code involves WhenEvent and DiscreteVariables no longer works [duplicate]

Bug introduced after 10.0, in or before 10.3, persisting through 13.2.1 The exact problem I am dealing with has already been asked and answered here. Unfortunately the solution no longer seems to ...
37 views

### Why doesn't ParametricNDSolve execute the action of WhenEvent, except the first occurrence?

I'm trying to create a ParametricFunction object using ParametricNDSolve targeting a system of equations that involves WhenEvent and DiscreteVariables. For some reason I fail to discover, the ...
160 views

### How to change NDSolve equations at every Event detection?

According to this tutorial on Event Actions for NDSolve, if $x'[t]=f(t,x(t))$: it is not possible to set the derivatives x'[t], since those are determined explicitly from the function. In my case, I ...
126 views

### WhenEvent with multiple actions

I have a 'WhenEvent' where I want two actions to be performed. I thought the actions should be in a list but this does not seem to work. Here is an example there are two actions in the 'WhenEvent'. <...
1 vote
58 views

### Nminimize output of ParametricNDSolveValue

I want to minimize the time a family of ODEs vanishes. To do so, I'm using WhenEvent to extract the vanishing time and put the result inside Nminimize: ...
78 views

### Discontinuous ODE results in NDSolve::ndinid warning, initial condition is not in the range specified by the discrete variable (internal variable)

The equations and code are below. The short version is: I know the error is because NDSolve is doing something in the background to handle the discontinuous ODE. ...
94 views

### Using WhenEvent in ParametricNDSolveValue

I want to solve an ODE and find the time the function y(t) vanishes. ...
467 views

### Bifurcation diagram for Lorenz attractor

As I was following a similar question I came across a beautiful answer here. However, in that code, he used InternalBag[] which heavily depends on ram that I can't ...
254 views

### Detect an event in NDSolve that is initially true

I want to check at what time the derivative of a function converges to zero. If the function starts far from equilibrium, the event is detected correctly at ...
212 views

### Sticky Collisions (perfectly inelastic)

There is an awesome simulation https://mathematica.stackexchange.com/a/124926/87086 which shows N particles bouncing in a box (with elastic collisions), made by @Feyre https://mathematica....
1 vote
41 views

### WhenEvent to resolve NDSolve Singularity

I'm trying to use NDSolve to solve the following ODE: ...
79 views

### Using WhenEvent to stop N objects at a boundary

I am attempting to implement an event into my simulation which makes any moving particle in an electric field completely stop at the instant they pass some specified threshold. I was trying to utilize ...
151 views

### Problem with a DAE and DiscreteVariables (II)

I continue with a DAE problem similar to another one posted here some days ago. @bbgodfrey offered a solution for the DiscreteVariables problem but now I have a ...
237 views

### Problem with a DAE and DiscreteVariables

Cross-posted in Wolfram Community. I am solving an DAE problem with NDSolve. It is a physical problem related to friction forces: one mass on the X axis and ...
521 views

...
84 views

### WhenEvent for equation defined outside NDSolve

Say i want to use WhenEvent to specify a value of R[s] when my function Dsonic[s]==-3. For some reason i get an error message. Seems that mathematica cannot read my function. Here is my code. Thank ...
1 vote
305 views

### How to reset an event counter to zero after every nth evaluation while using ExperimentalValueFunction to observe for value changes in counter

Synopsis Below serves as a skeleton for a function that will track number of occurrences of a particular notebook event. The nth event will trigger a function call. After which the counter symbol must ...
1 vote
44 views

...
1 vote
85 views

### Driving along a Beziercurve with given velocity

In this model I try to describe the kinematics of a point moving along a beziercurve b[u] (bezier parameter 0<u<1) with prescribed velocity ...
127 views

65 views

### Giving variable inside WhenEvent a value

I am defining ParametricNDSolveValue in one cell and then using this in another one to find the parameter value using bisection. For clarity, I have simplified my differential equation. In order to ...
141 views

### How to increase the speed of NDsolve when using WhenEvent

I am trying to solve a set of ODE's with switching. I implemented using WhenEvents. ...