Register to reply

MATLAB HELP - Maclaurin series

by figgy111
Tags: maclaurin, matlab, series
Share this thread:
figgy111
#1
Oct4-06, 08:35 PM
P: 3
Hi, i have absolutely no programming experience with matlab and really need it. We have been assigned 2 problems using matlab and a bunch of others that don't need matlab. I was wondering if someone could show me what to do for the two needed to be done in matlab (or send a .m file if you have one/could create one); the questions are:

The Maclaurin series expansion for cos (x) is:

cosx = 1 - (x^2)/2 + (x^4)/4! - (x^6)/6! + (x^8)/8! - .....

Starting with the simplest version, cosx = 1, add terms one at a time to estimate cos(pi/3). After each term is added, compute the true and approximate percent relative errors. Use your pocket calculator to determine the true value. Add terms until the absolute value of the approximate error estimate falls below an error criterion conforming to two significant figures.

The other question is:

Use a centered difference approximation of O(h^2) to estimate the second derivative of the function f(x) = 25x^3 - 6x^2 + 7x - 88. Perform the evaluation at x = 2 using step sizes of h = 0.25 and 0.125. Compare your estimates with the true value of the second derivative. Interpret your results on the basis of the remainder term of the taylor series expansion.

THANK YOU SO MUCH PLEASE HELP!!
Phys.Org News Partner Science news on Phys.org
Experts defend operational earthquake forecasting, counter critiques
EU urged to convert TV frequencies to mobile broadband
Sierra Nevada freshwater runoff could drop 26 percent by 2100
Andrew Mason
#2
Oct5-06, 10:16 AM
Sci Advisor
HW Helper
P: 6,679
Quote Quote by figgy111
Hi, i have absolutely no programming experience with matlab and really need it. We have been assigned 2 problems using matlab and a bunch of others that don't need matlab. I was wondering if someone could show me what to do for the two needed to be done in matlab (or send a .m file if you have one/could create one); the questions are:

The Maclaurin series expansion for cos (x) is:

cosx = 1 - (x^2)/2 + (x^4)/4! - (x^6)/6! + (x^8)/8! - .....

Starting with the simplest version, cosx = 1, add terms one at a time to estimate cos(pi/3). After each term is added, compute the true and approximate percent relative errors. Use your pocket calculator to determine the true value. Add terms until the absolute value of the approximate error estimate falls below an error criterion conforming to two significant figures.

The other question is:

Use a centered difference approximation of O(h^2) to estimate the second derivative of the function f(x) = 25x^3 - 6x^2 + 7x - 88. Perform the evaluation at x = 2 using step sizes of h = 0.25 and 0.125. Compare your estimates with the true value of the second derivative. Interpret your results on the basis of the remainder term of the taylor series expansion.

THANK YOU SO MUCH PLEASE HELP!!
You don't need MatLab. You have just have to add the first few terms. You do this by replacing x by [itex]\pi/3[/itex] in the MacLaurin/Taylor series expansion and calculating the first few terms on a calculator. Calculate [itex]cos(\pi/3)[/itex] on a calculator. Compare the two. If the difference is less than .005 then you have the answer to two significant figures. If not, keep adding more terms until you get the difference down to less than .005.

AM
Pythagorean
#3
Oct5-06, 11:27 AM
PF Gold
Pythagorean's Avatar
P: 4,287
and if you're required to use matlab, what are you having trouble with? Do you understand AM's logic? Do you need help with the commands for the .m file?

I took a matlab class and I still use the program once in a while, if you can aska specific question, or PASTE your .m file here, I'll see what I can help you with.

figgy111
#4
Oct5-06, 02:03 PM
P: 3
MATLAB HELP - Maclaurin series

i did the first one alright the second one i had some trouble with. here is my .m file for that one i know its a little of but let me know. thanks in advance
Attached Files
File Type: m p47.m (422 Bytes, 338 views)


Register to reply

Related Discussions
Matlab and Maclaurin Series Math & Science Software 8
Maclaurin series Calculus & Beyond Homework 5
Maclaurin series Calculus & Beyond Homework 3
MATLAB HELP - Maclaurin series Math & Science Software 0
MacLaurin series Calculus & Beyond Homework 4