Octave Exercises

  1. 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).
  2. 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)
  3. Calculate the definite integral of the function under consideration (without noise) within the given limits analytically.
  4. 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.
  5. Compare the results of different methods for calculating the integral. Estimate the number of random points that give a reasonably accurate result.
find the cost of your paper

This question has been answered.

Get Answer