Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask MATLAB Expert

Numerical Methods Assignment

Answer ALL QUESTIONS.

Question 1 - Consider the polynomial f(x) = x5 - 16.5x4 + 102.85x3 - 299.475x2 + 401.1634x - 193.5612 - 0.a, where a is the digit taken from your URN (so if your a is 1, the constant term in your polynomial would be -193.5612 - 0.1 = -193.6612)

i) Using the graphical method with Matlab to estimate the subinterval(s) in which the roots of f(x) lie over the initial interval -10 + b ≤ x ≤ 10 where b is the digit taken from your URN. You need to include the matlab script and the graph you plotted with the matlab script in your submission.

ii) By hand/using calculator, starting at x = -1 and continuing up to x = 9 carry out an interval searching procedure with intervals of 1 to establish in which subintervals the roots of the polynomial lie. Tabulate your results and explain the basis of the method.

iii) Use the bisection method and a calculator to find the smallest root from the subintervals you identified in (ii), working to 4 decimal places at every stage of the calculation and performing no more than 5 iterations of the method. Present your results in the tabulated form.

iv) Explain the basis of the Newton-Raphson method, using a sketch if helpful, and indicate what the formulae and process would be for the function above.

v) Write a Matlab program (a script .m file, NOT a function .m file) to use the following Newton-Raphson algorithm to calculate a root estimate for f(x) above, with initial guess x1 taking the 2 different values with x1 = 3.9 + 0.0b and x1 = 3.8 - 0.0b where the . is a decimal point and the is the digit from your URN. (Name your matlab program using "yoursurname_nr.m", e.g. wu_nr.m)

2327_figure.png

1) Iterate until the approximate relative percentage error in your estimate(s) is less than 10-6, and the maximum iteration is no more than 106.

2) You should probably test your programme on a simple example with known roots first.

3) A very basic program might set the start value and various other parameters, and define the function and its derivative, within the program.

4) A more sophisticated program will allow user input from the keyboard, and would seek to 'trap' division by zero with consequent output of a message before program termination.

5) Your final output should include final root estimate, the final approximate percentage error in each case and the number of iterations taken, in each case, with suitable annotation.

6) What intermediate results you output in the final version of the code are up to you, but whereas while testing the code, it might be useful to see the results of all calculations, once you know it is working properly, you should output only those calculated vales that you really think are necessary.

7) As always your program should be adequately, but not excessively, commented to guide the user.

vi) Perform a critical analysis of the four methods for finding the roots of equations: 1) the graphical method; 2) the bisection method; 3) the simple (one-point) iteration method, and 4) the Newton Raphson method. i.e. the strength and limitation of these methods. You can use graphs or example to enhance your explanation/discussion.

Question 2 - Consider the set of linear equations

12x1 - 3x2 + 5x3 - x4 = 37

-2x1 + x2 - x3 + 11x4 = -51

4x1 - 10x2 + x3 - x4 = 31

4x1 + 6x2 - 12x3 + x4 = -48

i) Write a program in Matlab which will solve any set of n linear equations in n unknowns, of the form AX = B in matrix notation, by the Gauss Seidel method, provided the matrix A is diagonally dominant. Your program should

1) Use a coefficient matrix A and a right hand matrix B and these should be requested by the program as input.

2) Ideally determine the number of equations from the size of the matrix/matrices input

3) Ideally request the user to input starting guesses for the variables x1, . . . . . , xn in a matrix X.

4) Iterate until the approximate percentage error in each of the n variables is less than Es% but also do no more than a maximum number of iterations to prevent inadvertent infinite looping; Es and nmax ideally should be input from the keyboard on request.

5) As usual be suitably (but not excessively) commented to guide the user.

6) Output the final results for all the variables and all the approximate relative % errors , with suitable annotations, and also the number of iterations taken.

7) Name your matlab program as "yoursurname_gs.m", e.g. wu_gs.m

ii) Use your program to solve the above set of equations if and when they are in a form where Gauss-Seidel is guaranteed to converge. Use starting guesses of x1 = -(100 + a), x2 = 100 + b, x3 = -100, x4 = 100 where, as before, the a, b are the relevant digits from your URN.

iii) Repeat the calculation with starting guess of x1 = x2 = x3 = x4 = 0 and also with x1 = 100, x2 = -100, x3 = 100, x4 = -100 and comment on the apparent sensitivity or otherwise of the results to the starting guesses.

iv) Discuss the strength and limitation of 1) naïve Gauss elimination; 2) Gauss elimination with partial pivoting, 3) Jacobi iteration and 4) Gauss-Seidel method in solving the set of linear equations, in terms of error and convergence.


Attachment:- Assignment File.rar

MATLAB, Engineering

  • Category:- MATLAB
  • Reference No.:- M92745207
  • Price:- $65

Guranteed 36 Hours Delivery, In Price:- $65

Have any Question?


Related Questions in MATLAB

Recitation problems -1 determine the highest real root of

Recitation Problems - 1. Determine the highest real root of f(x) = 2x 3 - 11.7x 2 + 17.7x - 5 using the Newton-Raphson method with at least four iterations. Start with an initial guess of x 0 = 3. 2. Determine the real r ...

Assignment - matlab programmingusing appropriate matlab

Assignment - MatLab Programming Using appropriate MatLab syntax, write the code required to analyse and display the data as per the problem description. The order of the MatLab Program should be as follows: Variables and ...

Assignment -data is given on which want to do computational

Assignment - Data is given on which want to do computational production planning using Metaheuristic MATLAB Programming: 1) Ant Colony Algorithm on both Partial and Total Flexible Problem. 2) Bee Algorithm on both Partia ...

What comparison of means test was used to answer the

What comparison of means test was used to answer the question

Discrete optimisation- solve the following two problems

Discrete Optimisation - Solve the following two problems with both exhaustive enumeration and branch and bound - Problem 1 is a mixed integer linear optimisation problem (the problem has both discrete and continuous vari ...

Assignment matlab programmingusing appropriate matlab

Assignment: MatLab Programming Using appropriate MatLab syntax, write the code required to analyse and display the data as per the problem description. The order of the MatLab Program should be as follows: Variables and ...

Assignment details -need to write a code for connecting

Assignment Details - Need to write a code for connecting segments (Lines) a special case of TSP. The problem is to connect lines in 2d/ 3d space with path obstructions. Can you help me write the code for this? Hope you m ...

Lab assignment - matlab matrix relationallogical operators

Lab Assignment - MATLAB Matrix, Relational/Logical Operators and Plotting This laboratory exercise/assignment will involve you 1) practicing multiplication operators in MATLAB; 2) practicing relational and logical operat ...

Question 1 manipulate spectral imagehyperspectral images

Question 1. Manipulate spectral image Hyperspectral images can be seen as a generalisation of normal colour images such as RGB images. In a normal RGB colour image, there are 3 channels, i.e. channels for red colour, gre ...

Question a safe prime is a prime number that can be written

Question : A safe prime is a prime number that can be written in the form 2p + 1 where p is also a prime number. Write a MATLAB script file that finds and displays all safe primes between 1 and 1000.

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As