Warning: Declaration of action_plugin_columns::register(&$controller) should be compatible with DokuWiki_Action_Plugin::register(Doku_Event_Handler $controller) in /customers/a/2/f/geophysicist.nl/httpd.www/lib/plugins/columns/action.php on line 141 Warning: Cannot modify header information - headers already sent by (output started at /customers/a/2/f/geophysicist.nl/httpd.www/lib/plugins/columns/action.php:141) in /customers/a/2/f/geophysicist.nl/httpd.www/inc/auth.php on line 424 Warning: Cannot modify header information - headers already sent by (output started at /customers/a/2/f/geophysicist.nl/httpd.www/lib/plugins/columns/action.php:141) in /customers/a/2/f/geophysicist.nl/httpd.www/inc/fetch.functions.php on line 30 Warning: Cannot modify header information - headers already sent by (output started at /customers/a/2/f/geophysicist.nl/httpd.www/lib/plugins/columns/action.php:141) in /customers/a/2/f/geophysicist.nl/httpd.www/inc/fetch.functions.php on line 48 Warning: Cannot modify header information - headers already sent by (output started at /customers/a/2/f/geophysicist.nl/httpd.www/lib/plugins/columns/action.php:141) in /customers/a/2/f/geophysicist.nl/httpd.www/inc/fetch.functions.php on line 49 Warning: Cannot modify header information - headers already sent by (output started at /customers/a/2/f/geophysicist.nl/httpd.www/lib/plugins/columns/action.php:141) in /customers/a/2/f/geophysicist.nl/httpd.www/inc/httputils.php on line 28 Warning: Cannot modify header information - headers already sent by (output started at /customers/a/2/f/geophysicist.nl/httpd.www/lib/plugins/columns/action.php:141) in /customers/a/2/f/geophysicist.nl/httpd.www/inc/httputils.php on line 29 Warning: Cannot modify header information - headers already sent by (output started at /customers/a/2/f/geophysicist.nl/httpd.www/lib/plugins/columns/action.php:141) in /customers/a/2/f/geophysicist.nl/httpd.www/inc/fetch.functions.php on line 72 Warning: Cannot modify header information - headers already sent by (output started at /customers/a/2/f/geophysicist.nl/httpd.www/lib/plugins/columns/action.php:141) in /customers/a/2/f/geophysicist.nl/httpd.www/inc/httputils.php on line 108 Warning: Cannot modify header information - headers already sent by (output started at /customers/a/2/f/geophysicist.nl/httpd.www/lib/plugins/columns/action.php:141) in /customers/a/2/f/geophysicist.nl/httpd.www/inc/httputils.php on line 141 Warning: Cannot modify header information - headers already sent by (output started at /customers/a/2/f/geophysicist.nl/httpd.www/lib/plugins/columns/action.php:141) in /customers/a/2/f/geophysicist.nl/httpd.www/inc/httputils.php on line 162 % Spectra of Finite Difference Operators % % Sjoerd A.L. de Ridder. % Zurich Airport, February 26th, 2015. clear all; clc; close all; % Spatial grid dx=10; % Derived wavenumber grid nk=128; dk=1/(nk*dx); kk=[-nk/2:nk/2]*dk; Kn=1./(2*dx); % Ideal Amplitude Spectrum op_dxdx=abs(-(kk*2*pi).^2); % FD Stencil's norders=4; ncoef=zeros(norders); ccoef=zeros(25,norders); ncoef(1)=3; ccoef(1:ncoef(1),1)=[1 -2 1]/(dx*dx); ncoef(2)=5; ccoef(1:ncoef(2),2)=[-1/12 4/3 -5/2 4/3 -1/12]/(dx*dx); ncoef(3)=7; ccoef(1:ncoef(3),3)=[1/90 -3/20 3/2 -49/18 3/2 -3/20 1/90]/(dx*dx); ncoef(4)=9; ccoef(1:ncoef(4),4)=[-1/560 8/315 -1/5 8/5 -205/72 8/5 -1/5 8/315 -1/560]/(dx*dx); hcoef=(ncoef-1)/2; % Fourier Transform of FD stencils fd_dxdx=zeros(nk+1,norders); for ij=1:norders; nx=ncoef(ij)-1; xx=[-nx/2:nx/2]*dx; % Fourier Kernel for ii=1:nk+1; for jj=1:nx+1; fd_dxdx(ii,ij)=fd_dxdx(ii,ij)+ccoef(jj,ij)*dx*exp(-i*2*pi*kk(ii)*xx(jj)); end; end; end; % Amplitude Spectrum fd_dxdx=abs(fd_dxdx)/dx; % Pimp this Plot FS=15; figure; hold on; plot(kk/Kn,op_dxdx/(Kn*2*pi)/(Kn*2*pi),'r','LineWidth',2); for ij=1:norders; plot(kk/Kn,fd_dxdx(:,ij)/(Kn*2*pi)/(Kn*2*pi),'b','LineWidth',2); end set(gca,'FontSize',FS); grid on;plot([0 0],[0 1],'k'); axis([-1 1 0 1]); xlabel('Wavenumber (1/K_{nyq})','FontSize',FS); ylabel('Operator Spectrum (1/K_{nyq}/K_{nyq})','FontSize',FS);