Question: Please make code clear and easy to understand PART 1 One way to evaluate a 6 is to use the Newton Raphson method to find

Please make code clear and easy to understand
PART 1
One way to evaluate a6 is to use the Newton Raphson method to find the zeros of the function
f(x)=x3-a, starting at x0=a. Use this approach to find the sixth root of 25.
NOTE: To obtain full points for this question, you must include all code with your answer. You should include in
your code i) tests that stop the iterative procedure when convergence is reached and ii) a maximum number of
iterations in your code to avoid your code getting into an infinite loop. iii) a check for derivatives close to zero to
avoid division by zero, so that your code exits elegantly if that happens. iv) an alternative update method that is
used in case the derivative becomes close to zero.
A.[5 points] Write Python code to show how you can implement the Newton Raphson method to find the sixth
roots of f, starting at x0=25. Plot your estimate of 256 as a function of iteration number. How many
iterations were needed for the sequence to converge within your specified tolerance level?
B.[4 points] Does the process work if you start at x0=-25? Modify your code to start at this initial guess
and plot your findings as a function of iteration number. How many iterations did this take?
C.[1 point] What happens if you specify x0=0? Why does this happen?
PART 2
You are asked to write onboard code for a new interactive pacemaker system that monitors ECG to determine
the right time to defibrillate the heart. The monitoring part of the system requires you to analyze voltage data
gathered from an electrode placed in the right atrium and figure out the times between zero crossings in the
data to estimate the heart rate. To make sure the pacemaker pulses are applied exactly when needed it is
important to do this as efficiently as possible. The processing power of the microprocessor is very small, and
while it can perform multiplication, division, subtraction and addition, it cannot calculate derivatives or perform
Fourier transforms. The signal is (very approximately) sinusoidal.
A.[2 points] of the four methods presented in the module (bisection, false position, secant and Newton
Raphson) which would you use to try to find zero crossings, given the processor and time limitations? In
your answer, briefly describe why you chose the method.
B.[5 points] You are not able to make a plot of the data recorded by the board. Given that you know the signal
is approximately sinusoidal, and that the frequency of the signal is around 1 Hz , suggest a method you could
use for bracketing zeros (Bisection, False Position methods) or choosing starting point(s) for Newton
Raphson or Secant methods.
C.[3 points] Write pseudocode outlining the process you chose in part B.
Please make code clear and easy to understand

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Finance Questions!