I want to simulate a hybrid system with many different parameters. They all have the same event function but the location is dependent on the parameters given. Let’s say we have inverted pendulum and I want to give a reverse rotation at some different angles(parameter). For one pendulum, event condition is like
cond(u,t,integ) = abs(u[1]) - integ.p
For many pendulum, one may do
cond(u,t,integ, ith) = abs(u[ith, 1]) - integ.p[ith]
and add as many callbacks as there are pendulums. However, although this same calculations over many pendulums(1000 or up maybe) can be done in vectorized form, the separate callbacks cannot do them in vectorized form (I think). Is there a way that we can return an array from the event condition and get which entries are up(down)-crosses in the affect!
function? Or is there an API to follow for ourselves to define such callbacks?