Numerical Methods

0 comments

Part 1

 Write a MATLAB script file that calculates f(x)=2sin(πx) using the Taylor series with the number of terms n=1, 3, 6, 20, without using the built-in sum function.

 Plot the four approximations along with the exact function on the range x=[-4, 4].

 Plot the absolute true error for each of the approximations over the range x=[-4, 4].

 How many terms are necessary for an error E<.000001?

Part 2

 Write a MATLAB script file that calculates f(x)=5ex using the Taylor series with the number of terms n=1, 3, 6, 20, without using the built-in sum function.

 Plot the four approximations along with the exact function on the range x=[-4, 4].

 Plot the absolute true error for each of the approximations over the range x=[-4, 4].

 How many terms are necessary for an error E<.000001?

Part 3

 Examine the differences in approximating an exponential function and a trigonometric function. Is one more accurate than the other or require fewer terms?

Extra Credit (10 points)

 Write a script that takes in either a binary or decimal and converts it to either decimal or binary respectively. The program should first ask whether to convert to binary or decimal and should not use the built in bin2dec or dec2bin functions.

About the Author

Follow me


{"email":"Email address invalid","url":"Website address invalid","required":"Required field missing"}