Homework 2 - Norbert Shao Math 104a Homework 2 2(a%Lebesgue function function LF=Lebesgue_function(x,z%x are interpolating nodes and z are evaluating

# Homework 2 - Norbert Shao Math 104a Homework 2 2(a%Lebesgue...

• Homework Help
• 16
• 100% (13) 13 out of 13 people found this document helpful

This preview shows page 1 - 6 out of 16 pages.

Norbert Shao2/1/17Math 104aHomework 22(a)%Lebesgue function function LF=Lebesgue_function(x,z) %x are interpolating nodes and z are evaluating pointsn=length(x);L=ones(1,n);for i = 1:nfor j = 1:nh7if j~=iL(i) = L(i)*((z - x(j))/(x(j)-x(i)));endendendLF=sumabs(L);end(b)clear;clc;n=4;x=zeros(1,n+1);for j=1:n+1x(j)=-1+(j-1)*(2/n);endm=1000;LF=zeros(1,m+1);z=zeros(1,m+1);for k=1:m+1z(k)=-1+(k-1)*(2/m);LF(k)=Lebesgue_function(x,z(k));endplot(z,LF);xlabel ('points'); ylabel ('Lebesgue function'); title('n=4')LC=norm(LF,Inf);disp('Lebesgue constant is');disp(LC)
Norbert Shao2/1/17Math 104a-1-0.8-0.6-0.4-0.200.20.40.60.8111.522.5pointsLebesgue functionn=4Lebesgue constant is 2.2078 for n=4-1-0.8-0.6-0.4-0.200.20.40.60.81051015202530pointsLebesgue functionn=10Lebesgue constant is 29.8981 for n=10
Norbert Shao2/1/17Math 104a-1-0.8-0.6-0.4-0.200.20.40.60.81020004000600080001000012000pointsLebesgue functionn=20Lebesgue constant is 10979 for n=20(C) Substitute function for j=1:n+1x(j)=-1+(j-1)*(2/n);endto x(j)=cos((j-1)*pi/n)
Norbert Shao2/1/17Math 104a-1-0.8-0.6-0.4-0.200.20.40.60.8111.11.21.31.41.51.61.71.8pointsLebesguefunctionn=4Lebesgue constant is1.7988 for n=4-1-0.8-0.6-0.4-0.200.20.40.60.8111.522.5pointsLebesguefunctionn=10Lebesgue constant is 2.4210 for n=10
Norbert Shao2/1/17Math 104a-1-0.8-0.6-0.4-0.200.20.40.60.8111.21.41.61.822.22.42.62.83pointsLebesguefunctionn=20Lebesgue constant is 2.8678 for n=20The behavior of Lebesgue constant of equidistributed points increase much faster than