# Python #Plot

All the python study code can be found in my own repository.

## Purpose

In high school we learned how to use the energy conservation law to get the velocity for a ball slides down a 1/4 circle. However, the time needed in this process is still unknown. The period for a pendulum also uses a approximated expression. In this note, I will try to solve the time evolution for a ball slide down from a smooth semi-circle numerically via python. I will compare the oscillator approximation and accurate result in the same animated figure .

## Theory

According to the energy conservation law

We need a linear differential form and the velocity should be used. The relation between the angle and the time is

We only consider the simple case that the small ball is initially rest, that is

The x and y coordinate can be expressed as

If is near 0,then ,

This is the equation for a simple harmonic oscillator, when is small enough, this equation works well.

## The Results

I used the function “odeint” to solve the differential equations numerically. I give two examples with the angle is very big or relatively small.

• With the ball initially in the , the evolution of oscillator approximations and accurate cases are different but not so big.

• With the ball initially in the , the oscillator approximation is not a good approximation now.