Solve the next exercises:
1. A mass connected to a spring is moved to an initial position A from where it is released. Then the mass starts moving, consider the initial time equal to zero. Find the evolution of the system considering that obeys the following expressions
\begin{eqnarray*} X(t) &=& +A \cos(\omega t)\\ V(t) &=& -A\omega\sin(\omega t)\\ a(t) &=& -A\omega^2\cos(\omega t) \end{eqnarray*}Make a plot of the evolution of the position, velocity and acceleration of the system. Feel free to choose the parameters you prefer.
It can be also shown that the potential and kinetic energy of the system is given by
\begin{eqnarray*} E_p &=& \frac{1}{2}kX^2\\ E_k &=& \frac{1}{2}mV^2 \end{eqnarray*}Make a plot of the potential energy and the total energy obtained for every step of the iteration.
2. Write a program that evals a function $f(x) = \sin(x) \ln(1x+1) \sinh(x)$ in the interval $[0,...,10]$. The function must receive the step $dx$ for the sucesive evaluations. The result must be written in a file of 3 columns, the first one is the value i of the counter of the cycle for, the second one is x and the third one is f(x). Make the same program but using numpy arrays properties.
3. Plot the series sine and cosine using 3 different values N ( N is the last term taken of the series ). Comparing with the function sine and cosine, say which approximation, which value of N, is sufficient as an approximation.
\begin{eqnarray*} \sin(x) &=& \sum_{n=0}^{\infty} \frac{(-1)^n}{(2n+1)!}x^{2n+1} \\ \cos(x) &=& \sum_{n=0}^{\infty} \frac{(-1)^n}{(2n)!}x^{2n} \end{eqnarray*}4. Write a program that calculates the factorial of a given number.