Een enkelvoudige slinger, bestaande uit een puntmassa $$m$$ die via een staaf met lengte $$l$$ vrij rond een scharnier kan bewegen, wordt beschreven door onderstaand beginwaardeprobleem $$\begin{cases}l \frac{d^2 \theta}{dt^2} + g \sin{\theta} = 0\\ \theta(0) = \theta_0\\ \theta'(0) = \omega_0 \end{cases}$$
Programmeer onderstaande functies:

Deze functies hebben allen als argumenten: Het resultaat van de functie is telkens een tuple van lijsten, namelijk Als waarde voor $$g$$ neem je $$9.81$$ ($$ms^{-2}$$).

Voorbeeld

t, theta = slinger_analytisch(1.5, 2.0, 0.4, 0.01, 10000, 50)
['%4.2f' % e for e in t[::200]]     #['0.00', '1.00', '2.00', '3.00', '4.00', '5.00', '6.00', '7.00', '8.00', '9.00', '10.00', '11.00', '12.00', '13.00', '14.00', '15.00', '16.00', '17.00', '18.00', '19.00', '20.00', '21.00', '22.00', '23.00', '24.00', '25.00', '26.00', '27.00', '28.00', '29.00', '30.00', '31.00', '32.00', '33.00', '34.00', '35.00', '36.00', '37.00', '38.00', '39.00', '40.00', '41.00', '42.00', '43.00', '44.00', '45.00', '46.00', '47.00', '48.00', '49.00', '50.00']
['%4.2f' % e for e in theta[::200]] #['0.40', '-0.24', '-0.12', '0.38', '-0.34', '0.03', '0.30', '-0.39', '0.17', '0.19', '-0.40', '0.28', '0.06', '-0.35', '0.37', '-0.09', '-0.26', '0.40', '-0.22', '-0.13', '0.38', '-0.32', '0.01', '0.32', '-0.39', '0.15', '0.21', '-0.40', '0.27', '0.07', '-0.36', '0.36', '-0.07', '-0.27', '0.40', '-0.20', '-0.15', '0.39', '-0.31', '-0.01', '0.33', '-0.38', '0.13', '0.22', '-0.40', '0.25', '0.09', '-0.37', '0.35', '-0.05', '-0.29']

t, theta = slinger_numeriek_benaderd(1.5, 2.0, 0.4, 0.01, 10000, 50)
['%4.2f' % e for e in t[::200]]     #['0.00', '1.00', '2.00', '3.00', '4.00', '5.00', '6.00', '7.00', '8.00', '9.00', '10.00', '11.00', '12.00', '13.00', '14.00', '15.00', '16.00', '17.00', '18.00', '19.00', '20.00', '21.00', '22.00', '23.00', '24.00', '25.00', '26.00', '27.00', '28.00', '29.00', '30.00', '31.00', '32.00', '33.00', '34.00', '35.00', '36.00', '37.00', '38.00', '39.00', '40.00', '41.00', '42.00', '43.00', '44.00', '45.00', '46.00', '47.00', '48.00', '49.00', '50.00']
['%4.2f' % e for e in theta[::200]] #['0.40', '-0.24', '-0.12', '0.39', '-0.35', '0.03', '0.33', '-0.43', '0.18', '0.21', '-0.45', '0.32', '0.06', '-0.41', '0.43', '-0.11', '-0.32', '0.49', '-0.27', '-0.17', '0.49', '-0.42', '0.01', '0.42', '-0.52', '0.20', '0.29', '-0.55', '0.38', '0.11', '-0.52', '0.52', '-0.10', '-0.41', '0.60', '-0.31', '-0.24', '0.61', '-0.50', '-0.02', '0.54', '-0.63', '0.21', '0.38', '-0.69', '0.44', '0.17', '-0.65', '0.62', '-0.09', '-0.53']

t, theta = slinger_numeriek_exact(1.5, 2.0, 0.4, 0.01, 10000, 50)# doctest: +NEWCONTEXT
['%4.2f' % e for e in t[::200]]     #['0.00', '1.00', '2.00', '3.00', '4.00', '5.00', '6.00', '7.00', '8.00', '9.00', '10.00', '11.00', '12.00', '13.00', '14.00', '15.00', '16.00', '17.00', '18.00', '19.00', '20.00', '21.00', '22.00', '23.00', '24.00', '25.00', '26.00', '27.00', '28.00', '29.00', '30.00', '31.00', '32.00', '33.00', '34.00', '35.00', '36.00', '37.00', '38.00', '39.00', '40.00', '41.00', '42.00', '43.00', '44.00', '45.00', '46.00', '47.00', '48.00', '49.00', '50.00']
['%4.2f' % e for e in theta[::200]] #['0.40', '-0.23', '-0.14', '0.40', '-0.33', '-0.02', '0.36', '-0.40', '0.10', '0.30', '-0.45', '0.22', '0.20', '-0.46', '0.33', '0.09', '-0.44', '0.43', '-0.04', '-0.39', '0.49', '-0.17', '-0.31', '0.53', '-0.30', '-0.20', '0.53', '-0.41', '-0.08', '0.51', '-0.50', '0.05', '0.46', '-0.57', '0.18', '0.39', '-0.61', '0.30', '0.30', '-0.64', '0.41', '0.19', '-0.64', '0.52', '0.08', '-0.62', '0.60', '-0.03', '-0.58', '0.67', '-0.14']