I’m about to start rewriting a physics simulation from Wolfram Client Library for Python to Julia using Symbolics.jl. The simulation consists of collisions between circles and line segments.

At each time step, I find the roots of distance formulae to find the next collision that will take place, advance the simulation to that time, perform the collision, and repeat. I’m using closed forms to compute the roots, then using Wolfram to choose the smallest positive real root from among them. Because each time step is the root of an equation, and those roots determine the variables in the next equation, the expressions end up getting pretty huge pretty fast.

My question: is Symbolics.jl able to take a list of symbolic expressions with thousands of nested terms and determine which, if any, is the smallest positive real one? What’s the best way of going about this?