- Create a function that implements the calculation of a mathematical function in the given time range with time interval sufficient to get enough smooth plot of the function. Function accepted the following parameters:
a) period T (ω = 2π/T)
b) damping decrement λ which is the ration of two successive amplitudes of the oscillating quantity y in one direction, that is, λ = y(t1)/y(t2). Of course, you first need to derive the relation β(λ).
c) positive independent variable (t > 0). - Create another function to add a normally distributed random noise with a given variance (accepted by function as input parameters) to the previously calculated function values.
Plot a colored figure of the noisy data (dots) along with the original function data (line). The figure should contain: legend, grid, x-axis label (“time, s”). Save the figure as pdf file in the working directory (directory where the script is running) - Calculate the definite integral of the function under consideration (without noise) within the given limits analytically.
- Create a function that calculates the integral of the function under study (without noise) using the Monte Carlo method. In addition to the period (T) and damping decrement (λ), this function should accept:
a) integration limits
b) number of random points. - Compare the results of different methods for calculating the integral. Estimate the number of random points that give a reasonably accurate result.