Write a MATLAB script program that finds both the minimum and maximum of three dimensional functions using the Steepest Ascent Method. Your inputs should be the function and an x and y range from which you will choose multiple starting guesses. Your outputs should be the location of maxima and minima.
- First, create a matrix of at least four starting guesses based on the range
- Evaluate the partial derivatives numerically using the Central Difference Method (not analytically) to determine the direction of maximum gradient
- Use the Golden Search Method to evaluate the maximum of your 2D direction function
- Use the Hessian matrix to determine if you’ve reach a local minimum or maximum.
- Your test script should also plot the locations of the minima and maxima on a 3D plot.
- To evaluate your program, use the function,
Write a MATLAB script program that calculates the Fast Fourier Transform using the Sande-Tukey Algorithm. Use only MATLAB math functions, ie +,-,cos,sin, and the functions imag and real to complete the algorithm in addition to standard logic/loop operators.
- The first part of the script should calculate the algorithm for the real and imaginary parts.
- The second part of the program should employ a bit reversal routine to unscramble the result Fourier coefficients.
- Validate your script with a problem of interest to your field, e.g. NMR, Seismic spectral analysis.
Guidelines for the report:
Each report should include three sections and a working m-file. You do not need to include the entire body of code in your written report, only in your m-file, but you may wish to reference parts of it in the report.
I. Theory and Background
a. A description of the assignment
b. A description of any applicable theory or background
II. Description of Code
a. A description of the content of your code and how it works
b. Discussion of any coding decisions made, i.e. choice of one type of logic
a. Any numerical results that came from the code with a description of their importance and meaning
b. Any plots that were created
IV. Code (m-file)
a. Include a working m-file in your submission.
b. At the beginning of your script, include a comment with your name, date, assignment number, and a description of the assignment
c. Comment your code throughout the body of the code so that it is easy to understand if you come back to this code months later.
This material may consist of step-by-step explanations on how to solve a problem or examples of proper writing, including the use of citations, references, bibliographies, and formatting. This material is made available for the sole purpose of studying and learning - misuse is strictly forbidden.function xmin=goldensection(f,a,b,tol)
%approximates the minimum of the function f on the interval [a,b]
%using the golden search method with precision tol
%to find a maximum apply the function to -f
k=1; %number of loop counts
s=sqrt(5)/2-1/2; %s is approximately 0.618