numerical analysis using matlab
Need help with this assignment?Get an original answer from a qualified tutor — from $10/page.
Get it written →MINISTRY OF EDUCATION IMAM ABDULRAHMAN BIN FAISAL UNIVERSITY COLLEGE OF COMPUTER SCIENCE & INFORMATION TECHNOLOGY وزارة التعليم جامعة اإلمام عبدالرحمن بن فيصل كلية علوم الحاسب وتقنية المعلومات Note: • Using the MATLAB platform, answer the following questions and try to use variation in your code as well. • You need to submit a softcopy of the code and report through Blackboard and hardcopy of the reports • The report must (a pdf file) contain the code and screenshots of the MATLAB output. You must provide a clear/readable screenshot in the report. Question 1: [2 Marks] The series for log 𝑒 (1 + 𝑥) is given by log 𝑒 (1 + 𝑥) = 𝑥 − 𝑥2 2 + 𝑥3 3 − …+ (−1)𝑘+1 𝑥 𝑘 𝑘 . Where 𝑘 is an integer. Write a MATLAB script to input a value for 𝑥 and sum the series while the value of the current term is greater than or equal to the variable 𝑡𝑜𝑙. Use values of 𝑥 = 0.5 and 0.82 and 𝑡𝑜𝑙 = 0.005 and 0.0005. The result should be checked by using the MATLAB function 𝑙𝑜𝑔. The script should display the value of 𝑥 and 𝑡𝑜𝑙 and the value of log 𝑒 (1 + 𝑥) obtained. Use 𝑖𝑛𝑝𝑢𝑡 and 𝑑𝑖𝑠𝑝 functions to obtain clear output and prompts. Question 2: [1 Marks] For computers, the machine epsilon ε can also be thought of as the smallest number that when added to 1 gives a number greater than 1. An algorithm based on this idea can be developed as MINISTRY OF EDUCATION IMAM ABDULRAHMAN BIN FAISAL UNIVERSITY COLLEGE OF COMPUTER SCIENCE & INFORMATION TECHNOLOGY وزارة التعليم جامعة اإلمام عبدالرحمن بن فيصل كلية علوم الحاسب وتقنية المعلومات Write your own M-file based on this algorithm to determine the machine epsilon. Validate the result by comparing it with the value computed with the built-in function eps. Question 3: [3.5 Marks] Use the Bisection method, Newton’s method, Secant 𝟐 method, and False position method to approximate a solution of 𝒙𝟐 − 𝟏 − 𝒆(𝟏−𝒙 ) = 𝟎 in [0, −2] within the accuracy 10−5 . (a) Find the number of iterations needed for each method to get this accuracy. (b) In each iteration, display the iteration number, approximation, and accuracy for all methods. (c) In which method the approximation converges faster? (2 marks for the final results of 4 methods, 1 marks for the presentation of the results as expected in part (b) and 0.5 for part (c)) Question 4: [3.5 Marks] MINISTRY OF EDUCATION IMAM ABDULRAHMAN BIN FAISAL UNIVERSITY COLLEGE OF COMPUTER SCIENCE & INFORMATION TECHNOLOGY وزارة التعليم جامعة اإلمام عبدالرحمن بن فيصل كلية علوم الحاسب وتقنية المعلومات Let 𝑓(𝑥) = 𝑥 4 − 2𝑥 3 + 𝑥 2 − 3; 𝑥0 = 0; 𝑥1 = 0.5; 𝑥2 = 1; 𝑥3 = 1.5. a) Compute the Lagrange interpolating polynomial, 𝑃3 (𝑥), of degree at most 3 for 𝑓(𝑥) using the given nodes. b) Find the maximum error in using 𝑃3 (𝑥) to approximate 𝑓(𝑥) on the interval [0, 2]. c) Write MATLAB script to solve and check the results of parts (a) and (b).
Get a plagiarism-free answer to this question
Send us your instructions and we’ll match you with the best writer in your subject.
- 100% human-written, zero AI
- Turnitin report included
- Confidential — we never share your data
- Free revisions & refunds
