# Dynamical system of modelling two particle collisions

**URL:** <https://discourse.julialang.org/t/dynamical-system-of-modelling-two-particle-collisions/112922>\
**Category:** Modelling & Simulations\
**Tags:** dynamical-systems\
**Created:** [April 14, 2024, 12:22pm UTC](https://discourse.julialang.org/t/dynamical-system-of-modelling-two-particle-collisions/112922 "2024-04-14T12:22:53Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![hisacro](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/hisacro/32/202631_2.png) [@hisacro](https://discourse.julialang.org/u/hisacro)\
**Post date:** [April 14, 2024, 12:22pm UTC](https://discourse.julialang.org/t/dynamical-system-of-modelling-two-particle-collisions/112922/1 "2024-04-14T12:22:53Z")

</div>

Hello, I’m trying to model a system with collision dynamics. I’m well aware of [Datseris](https://github.com/Datseris)’s [DynamicalBillards](https://github.com/JuliaDynamics/DynamicalBilliards.jl), contrary to that what I’m studying is collision between 2 particles rather than the fixed geometry as in billard dynamics, is there any sample of such models available in the Dynamicalsystems.ji All I can think is having a callback function to [CoupledODEs](https://juliadynamics.github.io/DynamicalSystems.jl/latest/tutorial/#DynamicalSystemsBase.CoupledODEs)

is there any other way to accomplish this or any resource to modelling such system. I’m struck at this point any pointers or leads will be highly helpful

---

<div class="post-metadata">

**Author:** ![Datseris](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/datseris/32/13406_2.png) [@Datseris](https://discourse.julialang.org/u/Datseris)\
**Post date:** [April 14, 2024, 1:25pm UTC](https://discourse.julialang.org/t/dynamical-system-of-modelling-two-particle-collisions/112922/2 "2024-04-14T13:25:58Z")

</div>

Does HardSphereDynamics.jl suit your needs?

CU!

George

---

<div class="post-metadata">

**Author:** ![hisacro](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/hisacro/32/202631_2.png) [@hisacro](https://discourse.julialang.org/u/hisacro)\
**Post date:** [April 14, 2024, 1:48pm UTC](https://discourse.julialang.org/t/dynamical-system-of-modelling-two-particle-collisions/112922/3 "2024-04-14T13:48:31Z")

</div>

Thanks for the your quick response Datseris, I glanced through your Billards dynamics source and found you have written conditional cases for each of the obstacle and collisions. [HardsphereDynamics.ji](https://juliahub.com/ui/Packages/General/HardSphereDynamics) has incorporated similar event driven conditions. I do remember you mentioning it was your phd thesis (in julia-con?), is it published somewhere so I can get an insight on modelling? I couldn’t find link in the repository

The current dynamical system I’m working on has an interaction potential too and I’m modelling it as hamiltonian system so I am thinking along the lines of having some threshold distance in callback function to CoupledODEs and when it’s less than that, instead of numerically evolving use momentum conservation equation to feed next set of initial conditions.

I bet you have already explored this possibility, from my limited experience of callback function it wasn’t very accurate in terms of computational cycles, energy was giggling off too.

Any opinions?

---

<div class="post-metadata">

**Author:** ![Datseris](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/datseris/32/13406_2.png) [@Datseris](https://discourse.julialang.org/u/Datseris)\
**Post date:** [April 14, 2024, 4:37pm UTC](https://discourse.julialang.org/t/dynamical-system-of-modelling-two-particle-collisions/112922/4 "2024-04-14T16:37:30Z")

</div>

Yeah DynamicalBilliards.jl was part of my PhD work, but the best description of how it works is at the docs: [Internals · DynamicalBilliards.jl](https://juliadynamics.github.io/DynamicalBilliards.jl/dev/basic/low_level/)

To combine interaction potential of particles with billiard like behavior as well the only software I know of is a c library called octo-something or something like that that had some sort of octopus in the name. Unfortunately I can’t find the name again, but it was referred to me by [‪Esa Räsänen‬ - ‪Google Scholar‬](https://scholar.google.com/citations?user=k8r4CyIAAAAJ&hl=fi) and his phd student. Sorry, it was long ago and I can’t invest the time now to find it… If you do find it please share and I will save it in my references library so I never forget it again!

---

<div class="post-metadata">

**Author:** ![BambOoxX](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bambooxx/32/22179_2.png) [@BambOoxX](https://discourse.julialang.org/u/BambOoxX)\
**Post date:** [April 14, 2024, 5:40pm UTC](https://discourse.julialang.org/t/dynamical-system-of-modelling-two-particle-collisions/112922/5 "2024-04-14T17:40:05Z")

</div>

For reference, the [SICONOS](https://nonsmooth.gricad-pages.univ-grenoble-alpes.fr/siconos/) C++ library is a very good library for non-smooth dynamical system simulation, including rigid body dynamics. It’s [bibliography](https://nonsmooth.gricad-pages.univ-grenoble-alpes.fr/siconos/z_siconos_bibtex.html) page might be of help.  
There are are for instance nonsmooth \alpha-HHT time-stepping implementations in their papers. You can also look at the Moreau-Jean or Schatzman-Paoli schemes.
