Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Flash XML Applications Use AS2 And AS3 To Create Photo Galleries Menus And Databases

Authors: Joachim Schnier

1st Edition

0240809173, 978-0240809175

More Books

Students also viewed these Databases questions

Question

5. Discuss the role of the Web in career management.

Answered: 1 week ago