Range of x1 is form 0 to 0.016. (0\le x1\le 0.016). This is the maximum distance between the electromagnet EM1 and ball. I have mistake in my source code. Ball diameter is 0.06 meter
The initial value:
x1 = 0.009
x2 = 0
x3 = 0.9345
x4 = 0
It means that the ball velocity is equal zero. The ball is levitating kept at the 9 mm distance from the bottom of the upper electromagnet. The 0.9345 A current flowing through the magnetic coil is the appropriate value to balance the gravity force of the ball.