ROOT is a data analysis framework developed by CERN that is well-suited for the analysis of certain large scientific data sets such as particle collision events and astronomical data. One useful ROOT feature are the histograms. A simple program that histograms 100,000 Gaussian random numbers is shown here: It’s output is shown here: A second […]

ROOT is a data analysis framework developed by CERN that is well-suited for the analysis of certain large scientific data sets such as particle collision events and astronomical data. One useful part of ROOT is their TLorentzVector class—objects that store and can work with relativistic four-vectors such as the space-time 4-vector or the energy-momentum 4-vector. […]

This program computes all the prime numbers up to 10,000 using an efficient algorithm. Instead of checking if a number n is prime by dividing by all previous numbers, or even all previous primes, this program only divides by all previous primes less than or equal to the square root of n.

This simple program shows an animation of a two-pendulum version of Newton’s cradle. One pendulum begins at some starting angle and the other pendulum is stationary. When the moving pendulum slams into the stationary one, its momentum is transferred to the other pendulum. If you want to include damping, you can change the line to […]

One option for creating animated GIFs from your visual python program is add the pillow package that allows you to export images of your vpython window from within your program. You can then use GIMP to create an animation such as the one shown here. To use python’s image library, you can install the “pillow” […]

I am currently a student at Florida State University majoring in physics as well as applied and computational mathematics. I have posted most of my class notes at http://www.leonhostetler.com/classnotes/. If you are looking for math and science class notes, be sure to take a look at them.