The student competition was part of the "Maths meets Industry" workshop that took place in October 2022 at the University of Stuttgart and was organized by the Cluster of Excellence "Data-Integrated Simulation Science (SimTech)" and Robert Bosch GmbH. See the problem statement for more details.
Team: David Gekeler, Erik Scheurer and Julius Herb
- NumPy
- SciPy
- Matplotlib
-
solution.py
: Contains our basketball throw simulation, along with the hit rate estimation using a Monte Carlo simulation -
test.py
: Contains a comparison of the different ball throw solutions with and without air resistance -
optimization.py
: Contains the code for the grid search we used to find the optimum, along with another optimization method from the noisyopt package, which we did not end up using. -
presentation.pdf
: Contains further information about the problem statement, physical modeling, numerical solution, the considered uncertainties and the optimization of the ball throw parameters.
We consider a robot with arm length
The idea is now, that the ball has a certain radius and is assumed to be a perfect circle. We can then calculate the intersection of the ball with the ring and the backboard by just tracking the center of the ball. Intersection happens by adding a "buffer" of the radius of the ball and bouncing the center of the ball of this buffer.
According to the specifications, the ball is modeled as a rigid body without considering angular momentum. In addition, the collisions are assumed to be perfectly elastic and the ideal law of reflection is applied. We also incorporate air resistance based on the drag equation for a more accurate model.
Multiprocessing is available to parallelise the computation of the average hit rate and can be enabled manually. Please note that the support of multiprocessing depends on the available software and hardware setup.
At the bottom of solution.py
, some examples are given.
You can also import the korbwurf
function, which was specified in the problem statement.
simulate_throw
is the core of the simulation that also enables plotting.
hit_rate
computes the average hit rate for given parameters.
The examples at the bottom of the file are also used to create the following plots.
We obtained the following optimal parameters:
Parameter | Value |
---|---|
Hit Rate |
The following plot shows one throw with the optimal parameters:
Including uncertainties, we see different colors for each segment of the throw. Green means, the ball goes in the hoop, blue means, it bounces of the ring or the backboard. Magenta means, the ball is out of bounds.
The following plot shows the optimization landscape:
The convergence of the hit rate in the Monte Carlo simulation can be seen in the following plot: