0001
0002
0003 clear all,
0004 close all,
0005
0006 npar0 = 1.8;
0007 dnpar = 0.1;
0008 dnpar0 = 0.5;
0009
0010 nnpar = 10001;
0011 fnpar = sqrt(log(100));
0012
0013 snpar = 4i;
0014
0015 opt = 2;
0016
0017
0018
0019 [nP0n,nnpar0] = varspectrum_jd(1,npar0,dnpar,dnpar0,snpar,fnpar,opt);
0020
0021 dnparb = sqrt(dnpar^2 + dnpar0^2);
0022
0023 nparmin = npar0 - fnpar*dnparb;
0024 nparmax = npar0 + fnpar*dnparb;
0025
0026 nn = length(nP0n);
0027
0028 xnpar = linspace(nparmin,nparmax,nnpar);
0029 dxnpar = xnpar(2) - xnpar(1);
0030
0031 xP = exp(-(xnpar - npar0).^2/dnpar^2)/sqrt(pi)/dnpar;
0032 xf = exp(-(xnpar - npar0).^2/dnpar0^2)/sqrt(pi)/dnpar0;
0033 xPb = exp(-(xnpar - npar0).^2/dnparb^2)/sqrt(pi)/dnparb;
0034
0035 xnnpar = repmat(xnpar.',[1,nn]);
0036 xnnpar0 = repmat(nnpar0,[nnpar,1]);
0037 xnP0n = repmat(nP0n,[nnpar,1]);
0038
0039 xnPn = xnP0n.*exp(-(xnnpar - xnnpar0).^2/dnpar^2)/sqrt(pi)/dnpar;
0040 xPn = sum(xnPn,2);
0041
0042 SP0n = sum(nP0n);
0043 IP = sum(dxnpar.*xP);
0044 If = sum(dxnpar.*xf);
0045 IPb = sum(dxnpar.*xPb);
0046 IPn = sum(dxnpar.*xPn);
0047
0048
0049
0050 disp(['- sum on P0n : ',num2str(SP0n)]);
0051 disp(['- integral on P : ',num2str(IP)]);
0052 disp(['- integral on f : ',num2str(If)]);
0053 disp(['- integral on Pb : ',num2str(IPb)]);
0054 disp(['- integral on Pn : ',num2str(IPn)]);
0055
0056 style = '-';
0057 marker = 'none';
0058 color1 = 'b';
0059 color2 = 'r';
0060 color3 = 'g';
0061 color4 = 'm';
0062 color5 = 'k';
0063 width0 = 0.5;
0064 width = 2;
0065 siz = 20 + 14i;
0066 red = 0.9;
0067 lspace = 0.5;
0068 bspace = 0.7;
0069
0070 figure(1),clf
0071
0072 xlab = 'n_{||}';
0073 ylab = '';
0074 tit = '';
0075
0076 xlim = [nparmin,nparmax];
0077 ylim = NaN;
0078
0079 leg = {'P(n_{||})','f(n_{||0})','<P(n_{||})>','Sum[ P_n(n_{||}) ]'};
0080
0081 graph1D_jd(xnpar,xP,0,0,'','','',NaN,xlim,ylim,style,marker,color1,width,siz,gca);
0082 graph1D_jd(xnpar,xf,0,0,'','','',NaN,xlim,ylim,style,marker,color2,width,siz,gca);
0083 graph1D_jd(xnpar,xPb,0,0,'','','',NaN,xlim,ylim,style,marker,color3,width,siz,gca);
0084 graph1D_jd(xnpar,xPn,0,0,xlab,ylab,tit,leg,xlim,ylim,style,marker,color4,width,siz,gca,red,lspace,bspace);
0085 for in = 1:nn,
0086 graph1D_jd(xnpar,xnPn(:,in),0,0,'','','',NaN,xlim,ylim,style,marker,color5,width0,siz,gca);
0087 end
0088
0089
0090
0091