Question: 1) Write a function to use the Secant method (like Newton but with approximate derivative) to obtain the root for the following two functions: f(t)

1) Write a function to use the Secant method (like Newton but with approximate derivative) to obtain the root for the following two functions:

f(t) = tan (t) t [with x0 = 7] g(t) = exp (t/2) sqrt(t + 12) [with x0 = 2]

Where x0 is the starting guess. YOU MUST FIRST ATTEMPT THE STARTING GUESSES I PROVIDE.

I recommend using the local derivative form of the Secant method (i.e. at each location, use a small increment h to compute the derivative). Print each iterate (xi) and its accompanying function value (f(xi)), then print the converged root (x) value - that is, if it converges. If not, explain why it diverges and choose a new starting guess (for example, x0= 7.65 for the first one) and try again to find the root near the starting point. Require an error of less than 1e-6.

Note: you can, of course, check your own code's results against those of fzero() to increase your confidence in your own work.

2) Use the MATLAB function fsolve (Links to an external site.)Links to an external site. to solve the 2-dimensional root problem

y2 = - x2 + 34

y = x2 - 6

The steps for this are:

  • Develop a "zeros" function for the two equations as shown in the example problem for fsolve. Note that you will have to use a single vector to pass x and y, that is, rename these as x = [x1, x2]
  • Use an initial guess of x0 = [2, 2]
  • Call fsolve with a handle to the function you created and the initial guess.

Note that you can (fairly easily) get an idea where the true roots are by graphing the functions.

3) Perform some summary statistics on the data in RV_data.csv1) Write a function to use the Secant method (like Newton but. You can import this using commands of your own making or you may use the GUI import (drag and drop it into MATLAB; in the resulting popup window, choose to import as vectors instead of as a table under "Output Type", then click "Import Selection").

  • Find the means and standard deviations of: HR, PesP, KindNormPmax, and KindNormVVCRn using the commands mean() and std().
  • Using the function histogram(), look at the histograms of these four variables. Do they appear to conform to a bell-shaped curve, or not (yes or no as an answer will suffice)? The default bins for the histograms should be sufficient, but if you choose to refine the bin sizes, go ahead...
  • Using corrcoef(), determine if there is any correlation between PesP and the two KindNorm variables. Interpret (one sentence each) the off-diagonal values of the correlation matrix.

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 Databases Questions!