Numerical Methods
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.
11 years ago
35
- Psychology paper
- or MotherofWriters
- what are the major criteria for facility location?
- Do the equations x = 4y + 1 and x = 4y – 1 have the same solution? How might you explain your answer to someone who has not learned algebra?
- Ann ran 5kilometer race in 25 minutes.mark ran the 2kilometer race in 7.5 minutes which runner ran at faster...
- Solve for x 2x/3-5=-13
- for IN_THE_MIDDLE_OF_THE_NIGHT wk9 assignment 1
- 3 Questions From English Homework On the Book Beowulf
- P(prime,e)
- Though it is commonplace in some other countries, bribery is illegal in the United States—including for U.S. businesses doing business in those same countries in which it is commonplace. This practice can put U.S. business people in an awkward situation w