Sinusoidal series ================= A sinusoidal series is defined as: .. math:: \begin{array}{l} x_0 = 1 \\ x_{i+1} = 2 \sin x_i+ 3 \cos x_i, i>=0 \end{array} This sequence begins with two positive terms and continues with negative terms. The first 10 values (rounded to 2 decimals) are: 1, 3.30, -3.28, -2.69, -3.57, -1.89, -2.83, -3.47 -2.21 -3.39. Save both functions into file ``sinusoidal.py``. #. Write the function :py:func:`sinusoidal1` that given an integer :math:`k`, computes the sum of the elements of the previous series to the *kth* term (included), that is, :math:`x_0 +x_1 +...+x_k`. Examples: .. literalinclude:: test-sinusoidal1.txt :language: python3 :lines: 3- .. note:: You can download the file with tests :download:`test-sinusoidal1.txt ` #. Write the function :py:func:`sinusoidal2` that given a real value ``smax``, tolerance ``epsilon``, returns the position of the term in the previous series that is equal to the given ``value`` with tolerance ``epsilon``. To determine the equality between two real numbers you must check if the absolute value of the difference between them is less than epsilon. Examples: .. literalinclude:: test-sinusoidal2.txt :language: python3 :lines: 3- .. note:: You can download the file with tests :download:`test-sinusoidal2.txt ` .. rubric:: Solution A solution of these functions is provided in file :download:`sinusoidal.py `