Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- clear
- f=@(x) -cos(x);
- corr=@(x) cos(x);
- L=2*pi;
- alpha=1;
- beta=1;
- k = linspace(1,12,12);
- for i= 1:length(k);
- N(i)=2^k(i);
- end
- for j=1:length(N);
- c=linspace(0,L,N(j)+2);
- c1=0;
- y=0;
- for i= 1:N(j);
- fvec(i)=f(c(i));
- c1(i)=corr(c(i));
- end
- c1=[alpha c1 beta];
- y=twoBVP(transpose(fvec),alpha,beta,L,N(j));
- %plot(c,y);
- hold on
- err=c1-transpose(y);
- plot(L/(1+N(j)),norm(err,inf),'x');
- % %grid on
- end
- %plot(c,corr(c),'-')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement