pnanez / HyEQ_Toolbox

Hybrid systems equations simulator, development repository
Other
12 stars 2 forks source link

Improve the "random" rule for the behavior of solutions in the intersection of C and D #64

Open pwintz opened 2 years ago

pwintz commented 2 years ago

There is a lot of room for improvement for the "random" rule (rule=3). As it works now, at every time step in C \cap D, there is a 50% chance of flowing and 50% chance of jumping. This means that the probabilistic behavior of solutions is determined by the size of the timestep. When a smaller time step is used, then the solution is more likely to jump sooner. Regardless, in most cases, the amount of time that a solution will remain in C \cap D tends to be very short.

Instead, we should allow users to specify the probability distribution function (PDF) for the amount of time that a solution will flow in C \cap D before jumping. For example, they might want a normal distribution with a particular mean and variance. After each jump, we would update a variable T by sampling the PDF. Then, we have a timer state variable \tau such that \dot{\tau} = 1 when x\inC\cap D, and \dot\tau = 0 otherwise. Once \tau reaches T, then a jump occurs.

pwintz commented 2 years ago

One approach would be to use the current step size to adjust the probability of jumping vs. flowing: image