复旦大学:《Matlab》(ppt实验英文版)Chapter3 Piecewise Polynomial Interpolation

Introduction to scientific Computing A Matrix Vector Approach Using Matlab Written by Charles FVan Loan 陈文斌 Wbchen(fudan. edu. cn 复日大学
Introduction to Scientific Computing -- A Matrix Vector Approach Using Matlab Written by Charles F.Van Loan 陈 文 斌 Wbchen@fudan.edu.cn 复旦大学

Chapter3 Piecewise polynomial Interpolation Piecewise Linear Interpolation Piecewise Cubic Hermite Interpolation Cubic splines
Chapter3 Piecewise Polynomial Interpolation • Piecewise Linear Interpolation • Piecewise Cubic Hermite Interpolation • Cubic Splines

Piecewise Linear Interpolation 0.8 0.6 0.4 0.2 0.2 -0.4 -0.6 -0.8
0 1 2 3 4 5 6 7 -1 -0.8 -0.6 -0.4 -0.2 0 0.2 0.4 0.6 0.8 1 Piecewise Linear Interpolation

(x,y) L(=)=a+b(-2;) y+1-y i+1 Piecewise Linear L(=)ifx1≤z≤x l()=」L2()x,sz∠3 (=)ifxn-1≤z≤x
( ) ( ) i i i i ( , ) L z = a +b z − z i i x y i i i i i i i x x y y a y b − − = = + + 1 1 , = n− n− n L z x z x L z x z x L z x z x L z 1 1 2 2 3 1 1 2 ( ) if ( ) if ( ) if ( ) Piecewise Linear

for i=1 b(1)=(y(i+1)-y(1)/(x(i+1)-x(1) function [a, b]=pwL(x,y) end n=length(x) a=y(1:n-1) b=(y(2n)y(1:n-1)/(x(2n)-X(1n b= diff(y). /diff(x) b=diff(y). /diff(x) Test code zlinspace(0, 1, 9) la, b=pwL(z, sin(2*pi*z))
function [a,b] = pwL(x,y) n = length(x); a = y(1:n-1); b = diff(y) ./ diff(x); z=linspace(0,1,9); [a,b]=pwL(z,sin(2*pi*z)); for i=1:n-1 b(i)=(y(i+1)- y(i))/ (x(i+1)- x(i)); end b=(y(2:n)-y(1:n-1))./(x(2:n)-x(1:n- 1)) b=diff(y)./diff(x) Test code

Evalution la, B L(z)=? Problem:z∈[x,x if==x(n) - n else =sum(X<=z) end
Evalution z [, ] L(z) = ? Problem: [ , ], ? z xi xi+1 i = if z==x(n) i =n-1; else i=sum(x<=z); end

Binary search mid= floor((Left+ Right ) /2) linspace(1,100,10000),z=48.598 If z<x(mid) Right=mid Else Left =mid end N=10000一n=log2N≤13.3
Binary search mid = floor((Left+Right)/2); If z<x(mid) Right=mid; Else Left =mid; end N =10000 n = log2 N 13.3

function 1=Locate(x, z, g, %og(1-g<-=n-1)is an optional input parameter search for i begins, the value i-g is tried g·guss if nargin==3 if(x(g)<=z)&(z<x(g+1) return end: end n= length(x) ifz==x(n) else Left=1: Right=n while right Left+l Binary search end
function i = Locate(x,z,g) % g (1 Left+1 Binary_search end g: guss

function LVals- pWLEval(a, b, x, Z Vals) o Evaluates the piecewise linear polynomial defined by the column /o(n-1)-vectors m= length( Vals) m-vector LVals= zeros(m, 1) for j=l: m i=Locate(x, z vals(, g) LVals(=a(1+ b(i)*(zVals(-x(i) g end
function LVals = pwLEval(a,b,x,zVals) % Evaluates the piecewise linear polynomial defined by the column %(n-1)-vectors m = length(zVals); LVals = zeros(m,1); g = 1; for j=1:m i = Locate(x,zVals(j),g); LVals(j) = a(i) + b(i)*(zVals(j)-x(i)); g = i; end m-vector

Interpolation of humps(x) with pwL, n= 5 (x-.3)2+.01(x-92+0~6
6 ( .9)^2 .04 1 ( .3) .01 1 2 − − + + x − + x
按次数下载不扣除下载券;
注册用户24小时内重复下载只扣除一次;
顺序:VIP每日次数-->可用次数-->下载券;
- 《计算机网络基础》第7章 网络管理与网络安全.ppt
- 《计算机网络基础》第6章 网页制作技术.ppt
- 《计算机网络基础》第5章 Internet的使用.ppt
- 《小技巧让PDF文件与Word文档之间自由地转换》讲义.pdf
- 同济大学:《计算机文化》(第三版)第六章 网络基础.ppt
- 同济大学:《计算机文化》(第三版)第五章 应用软件和办公软件.ppt
- 同济大学:《计算机文化》(第三版)第四章 系统软件及其常用操作系统.ppt
- 同济大学:《计算机文化》(第三版)第一章 计算机与信息社会.ppt
- 《ASP网页数据库短训教程》第9章 Application对象与 Session对象.ppt
- 《ASP网页数据库短训教程》第8章 Request对象及其使用.ppt
- 《ASP网页数据库短训教程》第7章 ASP程序与ASP的内置对象.ppt
- 《ASP网页数据库短训教程》第6章 VBScript的对象编程.ppt
- 《ASP网页数据库短训教程》第5章 VBScript编程语言(二).ppt
- 《ASP网页数据库短训教程》第4章 VBScript编程语言(一).ppt
- 《ASP网页数据库短训教程》第3章 HTML语言介绍(二).ppt
- 《ASP网页数据库短训教程》第2章 TML语言介绍(一).ppt
- 《ASP网页数据库短训教程》第1章 ASP的基础知识.ppt
- 《ASP网页数据库短训教程》第19章 网上考试.ppt
- 《ASP网页数据库短训教程》第18章 网上搜索.ppt
- 《ASP网页数据库短训教程》第17章 网上购物.ppt
- 复旦大学:《Matlab》(ppt实验英文版)Chapte 4 Numerical Integration.ppt
- 复旦大学:《Matlab》(ppt实验英文版)Chapter 6 Linear systems.ppt
- 复旦大学:《Matlab》(ppt实验英文版)Chapter 7 The QR and Cholesky Factorizations.ppt
- 复旦大学:《Matlab》(ppt实验英文版)Chapter 8 Nonlinear Equations and Optimization.ppt
- 复旦大学:《Matlab》(ppt实验英文版)Chapter 2 Polynomial Interpolation.ppt
- 复旦大学:《Matlab》(ppt实验英文版)Chapter 9 The Initial Value Problem.ppt
- 复旦大学:《Matlab》(ppt实验英文版)Chapter 5 Matrix computations.ppt
- 复旦大学:《Matlab》(ppt实验英文版)Chapter I power tools of the trade.ppt
- 同济大学:《数据结构》课程PPT教学课件(C++描述)第1章 绪论.ppt
- 同济大学:《数据结构》课程PPT教学课件(C++描述)第2章 线性表.ppt
- 同济大学:《数据结构》课程PPT教学课件(C++描述)第3章 栈和队列.ppt
- 同济大学:《数据结构》课程PPT教学课件(C++描述)第4章 串.ppt
- 同济大学:《数据结构》课程PPT教学课件(C++描述)第5章 多维数组和广义表.ppt
- 同济大学:《数据结构》课程PPT教学课件(C++描述)第6章 树.ppt
- 同济大学:《数据结构》课程PPT教学课件(C++描述)第7章 图.ppt
- 同济大学:《数据结构》课程PPT教学课件(C++描述)第8章 查找.ppt
- 同济大学:《数据结构》课程PPT教学课件(C++描述)第9章 排序.ppt
- 同济大学:《数据结构》课程PPT教学课件(C++描述)第七章 图.ppt
- 同济大学:《数据结构》课程PPT教学课件(C++描述)第九章 排序.ppt
- 同济大学:《数据结构》课程PPT教学课件(C++描述)第八章 查找.ppt