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_dx=abs(i*kk*2*pi); % FD Stencil's norders=4; ncoef=zeros(norders); ccoef=zeros(25,norders); ncoef(1)=3; ccoef(1:ncoef(1),1)=[-1 0 1]/(2*dx); ncoef(2)=5; ccoef(1:ncoef(2),2)=[1 -8 0 8 -1]/(12*dx); ncoef(3)=7; ccoef(1:ncoef(3),3)=[-1 9 -45 0 45 -9 1]/(60*dx); ncoef(4)=9; ccoef(1:ncoef(4),4)=[3 -32 168 -672 0 672 -168 32 -3]/(840*dx); hcoef=(ncoef-1)/2; % Fourier Transform of FD stencils fd_dx=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_dx(ii,ij)=fd_dx(ii,ij)+ccoef(jj,ij)*dx*exp(-i*2*pi*kk(ii)*xx(jj)); end; end; end; % Amplitude Spectrum fd_dx=abs(fd_dx)/dx; % Pimp this Plot FS=15; figure; hold on; plot(kk/Kn,op_dx/(Kn*2*pi),'r','LineWidth',2); for ij=1:norders; plot(kk/Kn,fd_dx(:,ij)/(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})','FontSize',FS);