Math 375 Fall 2005 3Functions - PowerPoint PPT Presentation

1 / 8
About This Presentation
Title:

Math 375 Fall 2005 3Functions

Description:

x=1.1;y=eval(f) y = 0.4525 % Script File: SinePlot ... ylabel(' y ') pause(1) end % Script File: SinTaylor ... y = y term; end. Topic One. Explain details ... – PowerPoint PPT presentation

Number of Views:35
Avg rating:3.0/5.0
Slides: 9
Provided by: vagelic
Category:

less

Transcript and Presenter's Notes

Title: Math 375 Fall 2005 3Functions


1
Math 375 Fall 20053-Functions
  • Vageli Coutsias

2
  • functions
  • plots
  • zeros
  • derivatives
  • integrals

3
functions and plots
  • fplot
  • eval

f '1/(1x2)'lims-5,5fplot(f,lims)
gtgt x1.1yeval(f) y 0.4525
4
Script File SinePlot Displays increasingly
smooth plots of sin(2pix) close all for n 4 8
12 16 20 50 100 200 400 xlinspace(0,1,n) y
sin(2pix) plot(x,y) title(' The function y
sin(2pix) ') xlabel(' x (in rads) ')
ylabel(' y ') pause(1) end
5
Script File SinTaylor Plots, as a function
of n, the relative error in the Taylor
approximation x - x2/2! ... (-1)n
x(2n1)/(2n1)! to sin(x) nTerms 50 err
zeros(50) for x10 5 1 -1 -5 -10 figure
term x s x f sin(x) for k250
term -x2term/((2k-2)(2k-1)) s
sterm err(k) abs(f - s10(-100))
end relerr err/abs(sin(x))
semilogy(1nTerms,relerr) ylabel('Relative
Error in Partial Sum.') xlabel('Order of
Partial Sum.') title(sprintf('x 5.2f',x))
end
6
Taylor series for exp(x)
function y expF(x,n) term 1 y 1 for k
1n x xterm/k y y term end
7
(No Transcript)
8
Topic One
  • Explain details
  • Give an example
  • Exercise to re-enforce learning
Write a Comment
User Comments (0)
About PowerShow.com