Question: Problem 1: Write/make a MATLAB script file that uses Taylor series expansion to calculate sin(x) where x is in radians using for loop/loops element by

Problem 1:

Write/make a MATLAB script file that uses Taylor series expansion to calculate sin(x) where x is in radians using

  1. for loop/loops

  2. element by element operations

for x = 0 rad and h = a rad

The x-axis should have different step sizes, h written on x-axis. You can select the same step size values as used in Lecture 7b example video. Similarly, the code should be for different order of accuracies. You can select the same order of accuracies as shown in the video Lecture 7b example. The y-axis should have error.

Note: You can use a piece of paper to find Taylor series of sin(x) and double check the expression you get from a Mathematics book or online source.

Formula: f(x+h) = f(x)+h/1! f'(x)+h^2/2! f''x+h^3/3! f'''x + O(h^4)

Problem 2:

Write/make a MATLAB script file that uses Taylor series expansion to calculate cos(x) where x is in radians using

  1. for loop/loops

  2. element by element operations

for x = 0 rad and h = a rad

The x-axis should have different step sizes, h written on x-axis. You can select the same step size values as used in Lecture 7b example video. Similarly, the code should be for different order of accuracies. You can select the same order of accuracies as shown in the video Lecture 7b example. The y-axis should have error.

Note: Please do note that Taylor series for cos(x) and sin(x) for the same x and h are different. Note: You can use a piece of paper to find Taylor series of cos(x) and double check the expression you get from a Mathematics book or online source.

Formula: f(x+h) = f(x)+h/1! f'(x)+h^2/2! f''(x)+h^3/3! f'''(x) + O(h^4)

Problem 3:

Write/make a MATLAB script file that uses Taylor series expansion to calculate ln(x)

  1. for loop/loops

  2. element by element operations

for x = 1 and h = a

The x-axis should have different step sizes, h written on x-axis. You can select the same step size values as used in Lecture 7b example video. Similarly, the code should be for different order of accuracies. You can select the same order of accuracies as shown in the video Lecture 7b example. The y-axis should have error.

Note: If you want to calculate ln(x) on MATLAB you will write log(x).

Note: If you want to calculate log(x) on MATLAB you will write log10(x).

Formula: f(x+h) = f(x)+h/1! f'(x)+h^2/2! f''(x)+h^3/3! f'''(x) + O(h^4)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!