numerical analysis using matlab
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).
Collepals.com Plagiarism Free Papers
Are you looking for custom essay writing service or even dissertation writing services? Just request for our write my paper service, and we'll match you with the best essay writer in your subject! With an exceptional team of professional academic experts in a wide range of subjects, we can guarantee you an unrivaled quality of custom-written papers.
Get ZERO PLAGIARISM, HUMAN WRITTEN ESSAYS
Why Hire Collepals.com writers to do your paper?
Quality- We are experienced and have access to ample research materials.
We write plagiarism Free Content
Confidential- We never share or sell your personal information to third parties.
Support-Chat with us today! We are always waiting to answer all your questions.