The world’s Largest Sharp Brain Virtual Experts Marketplace Just a click Away
Levels Tought:
Elementary,Middle School,High School,College,University,PHD
| Teaching Since: | Apr 2017 |
| Last Sign in: | 103 Weeks Ago, 3 Days Ago |
| Questions Answered: | 4870 |
| Tutorials Posted: | 4863 |
MBA IT, Mater in Science and Technology
Devry
Jul-1996 - Jul-2000
Professor
Devry University
Mar-2010 - Oct-2016
Attached is a PDF document containing the assignment that I need help with. The coding is to be done using MatLAB. Please help, If you have any questions feel free to ask.Â
Â
Â
ME 2016 Computing Techniques
Section C - Spring 2017
Computing Project One
Due Thursday, February 16th at 3:00pm
Numerical Errors and Root-Finding Algorithms
Please read all instructions (on 2 pages) before starting to write any code.
Submission of your answers
• At the end of the class on 02/07, upload any Matlab code that you have written on T-Square • By 3:00 pm on Thursday 02/16, upload your final Matlab codes on T-Square. • At the start of the class on 02/16, turn in the print-out of the codes, the print-out of the outputs of your
code and the graph. Problem statement
A shock wave, which is an extremely thin non-equilibrium region, is caused by the collision of fast moving gas
with slower moving gas (e.g., the leading edge of a supersonic wing). The following equation relates the
dimensionless velocity inside the shock wave Ï• to the various parameters of the system:
1 − = [(1 − )1 ( − 0 )]
( − ) where ξ is the dimensionless position inside the shock wave, 1 is the Mach number for the high velocity gas and α and β are constants. For = 0.32 and 1 = 2, determine ϕ at the leading edge of the shock
wave (i.e. ξ = ξ0).
Tasks
1. Write the equation to be solved in the form f(ϕ) = 0 (for the case ξ = ξ0). Plot the function f(ϕ) as a
function of Ï• to get an idea of the value of the root (you can only plot f for Ï• > 0.32).
2. Write a function for the secant algorithm. The inputs should be the function f (as an anonymous function
handle), the 1st initial guess x0, the 2nd initial guess x1, and the maximum allowable approximate percent
relative error, . The outputs of the functions should be the value of the root, xr, the value of the approximate percent relative error, , and the number of iterations, Niter. Name your function secant.
Verify that you code works by solving Example 6.6 from the textbook. 3. Based on your figure in Question 1, and appropriate values for the initial guesses so that the secant
algorithm converges to the true root 4. Using = 1 × 10−8 % find the value of ϕ using your secant algorithm 5. Verify your answer using the MATLAB fzero function (use the MATLAB help to figure out the options and
syntax for fzero)
6. Report the value of xr, Niter and . Submit your codes using a single m _le called LastnameFirstnameCP1.m where Lastname is your last name and
Firstname is your first name. This _le should include two functions: LastnameFirstnameCP1 and secant. The
function LastnameFirstnameCP1 should have no input variables and no output variables. Running the function
LastnameFirstnameCP1 should:
• solve Example 6.6 using the secant algorithm • print out xr, and after 3 iterations for example 6.6 • plot the function f •
• Solve the equation using = 1 × 10−8 % • print out xr obtained with the fzero function print out xr, Niter and . Make sure to include comments in your codes as described in class.