From ff6254f8473ad297f1f42b59ffce94f78295b89e Mon Sep 17 00:00:00 2001 From: Eugeniy Mikhailov Date: Fri, 30 Dec 2011 00:46:36 -0500 Subject: fast light generator for irina --- .../Makefile | 54 ++++ .../Nlevels_no_dopler_with_z_4wm.xmds | 321 +++++++++++++++++++++ .../fast_light/Makefile | 54 ++++ .../fast_light/map2dat.m | 33 +++ .../fast_light/plot_fields_propagation_I2.gp | 15 + .../fast_light/pp_I2.m | 71 +++++ .../map2dat.m | 33 +++ .../pp.m | 190 ++++++++++++ .../pp_I2.m | 71 +++++ 9 files changed, 842 insertions(+) create mode 100644 xmds2/Nlevels_no_dopler_with_z_4wm_for_irina_pqe/Makefile create mode 100644 xmds2/Nlevels_no_dopler_with_z_4wm_for_irina_pqe/Nlevels_no_dopler_with_z_4wm.xmds create mode 100644 xmds2/Nlevels_no_dopler_with_z_4wm_for_irina_pqe/fast_light/Makefile create mode 100644 xmds2/Nlevels_no_dopler_with_z_4wm_for_irina_pqe/fast_light/map2dat.m create mode 100644 xmds2/Nlevels_no_dopler_with_z_4wm_for_irina_pqe/fast_light/plot_fields_propagation_I2.gp create mode 100644 xmds2/Nlevels_no_dopler_with_z_4wm_for_irina_pqe/fast_light/pp_I2.m create mode 100644 xmds2/Nlevels_no_dopler_with_z_4wm_for_irina_pqe/map2dat.m create mode 100644 xmds2/Nlevels_no_dopler_with_z_4wm_for_irina_pqe/pp.m create mode 100644 xmds2/Nlevels_no_dopler_with_z_4wm_for_irina_pqe/pp_I2.m (limited to 'xmds2') diff --git a/xmds2/Nlevels_no_dopler_with_z_4wm_for_irina_pqe/Makefile b/xmds2/Nlevels_no_dopler_with_z_4wm_for_irina_pqe/Makefile new file mode 100644 index 0000000..578f2b0 --- /dev/null +++ b/xmds2/Nlevels_no_dopler_with_z_4wm_for_irina_pqe/Makefile @@ -0,0 +1,54 @@ +### -*- make -*- +### This file is part of the Debian xmds package +### Copyright (C) 2006 Rafael Laboissiere +### This file is relased under the GNU General Public License +### NO WARRANTIES! + +### This makefile can be used to build and run the XMDS examples + +XMDS_FILES = $(shell ls *.xmds) +RUN_FILES = $(patsubst %.xmds,%.run,$(XMDS_FILES)) +CC_FILES = $(patsubst %.xmds,%.cc,$(XMDS_FILES)) +XSIL_FILES = $(patsubst %.xmds,%.xsil,$(XMDS_FILES)) +M_FILES = $(patsubst %.xmds,%.m,$(XMDS_FILES)) + +XMDS = xmds2 +XSIL2GRAPHICS = xsil2graphics + +all: $(M_FILES) + +%.run: %.xmds + $(XMDS) $< + mv $(patsubst %.xmds,%,$<) $@ + +%.xsil: %.run + ./$< + +%.m: %.xsil + $(XSIL2GRAPHICS) $< + +plot: $(M_FILES) + octave pp.m + +clean: + rm -f $(CC_FILES) $(RUN_FILES) $(M_FILES) $(XSIL_FILES) *.wisdom.fftw3 *.dat octave-core *.wisdom *.pdf + rm -f $(png_targets) + +eps_targets = $(wildcard *.eps) +pdf_targets = $(eps_targets:%.eps=%.pdf) +png_targets = $(pdf_targets:%.pdf=%.png) + +png: pdf $(png_targets) + +$(png_targets): %.png : %.pdf + convert -density 300 $< $@ + +pdf: $(pdf_targets) + +$(pdf_targets): %.pdf : %.eps + cat $< | ps2eps -B > __tt.eps + epspdf __tt.eps $@ + rm -f __tt.eps + #ps2eps -B $< | epspdf $< $@ +.PRECIOUS: %.run %.xsil %.m +.PHONY: all clean diff --git a/xmds2/Nlevels_no_dopler_with_z_4wm_for_irina_pqe/Nlevels_no_dopler_with_z_4wm.xmds b/xmds2/Nlevels_no_dopler_with_z_4wm_for_irina_pqe/Nlevels_no_dopler_with_z_4wm.xmds new file mode 100644 index 0000000..e0e83b3 --- /dev/null +++ b/xmds2/Nlevels_no_dopler_with_z_4wm_for_irina_pqe/Nlevels_no_dopler_with_z_4wm.xmds @@ -0,0 +1,321 @@ + + + + Nlevels_no_dopler_with_z_4wm + + Eugeniy Mikhailov + + License GPL. + + Solving 4 level atom in N-field configuration, + with field propagation along spatial axis Z + no Doppler broadening + + We assume four-wave mixing condition when w3-w4=w2-w1 i.e. fields E3 and E4 drive the same + resonance as fields E2 and E1. + + + * --------------- |4> + * \ \ + * \ E3 \ -------- |3> + * \ E4 \ / \ + * \ \ / E2 \ + * \ / \ E1 + * |2> -------------- \ + * \ \ + * \ \ + * ------------- |1> + * + + + We are solving + dE/dz+(1/c)*dE/dt=i*eta*rho_ij, where j level is higher then i. + Note that E is actually a Rabi frequency of electromagnetic field not the EM field + in xmds terms it looks like + dE_dz = i*eta*rhoij - 1/c*L[E], here we moved t dependence to Fourier space + + VERY IMPORTANT: all Rabi frequency should be given in [1/s], if you want to + normalize it to something else look drho/dt equation. + No need to renormalizes eta as long as its express through i + the upper level decay rate in the same units as Rabi frequency. + + + + + + + + + + + + + + + + + + + + + + + + + + + z + + + + + + + + E1 E2 E3 E4 + + + + + + + + + r11 r22 r33 r12 r13 r14 r23 r24 r34 r44 + + + + + + + E_field + + + + + + + + + + + + 200 200 + + + density_matrix + E_field + + + + + + + + Lt + + + E_field + density_matrix + + + + + + + + + + + + + E_field + I1_out I2_out I3_out I4_out + + + + + + + density_matrix + + r11_out r22_out r33_out r44_out + r12_re_out r12_im_out r13_re_out r13_im_out r14_re_out r14_im_out + r23_re_out r23_im_out r24_re_out r24_im_out + r34_re_out r34_im_out + + + + + + + + + diff --git a/xmds2/Nlevels_no_dopler_with_z_4wm_for_irina_pqe/fast_light/Makefile b/xmds2/Nlevels_no_dopler_with_z_4wm_for_irina_pqe/fast_light/Makefile new file mode 100644 index 0000000..76d3f5c --- /dev/null +++ b/xmds2/Nlevels_no_dopler_with_z_4wm_for_irina_pqe/fast_light/Makefile @@ -0,0 +1,54 @@ +### -*- make -*- +### This makefile can be used to build and run the XMDS examples + + +XSIL_FILES = Nlevels_no_dopler_with_z_4wm.xsil +M_FILES = $(patsubst %.xsil,%.m,$(XSIL_FILES)) +GNUPLOT_FILES = $(wildcard *.gp) + +XSIL2GRAPHICS = xsil2graphics + +# fast light +PARAMS = --delta1=0 --delta2=0 --delta3=0 --E1o=1.9e7 --E2o=3.1e5 --E3o=3.8e7 --E4o=6.3e4 +# slow light EIT +#PARAMS = --delta1=0 --delta2=0 --delta3=0 --E1o=1.9e7 --E2o=3.1e5 --E3o=0 --E4o=0 + +all: $(XSIL_FILES) Nlevels_no_dopler_with_z_4wm.xsil $(M_FILES) plot png + +Nlevels_no_dopler_with_z_4wm.xsil: ../Nlevels_no_dopler_with_z_4wm.run + $< $(PARAMS) | grep "Time elapsed for simulation is:" > exact_analysis_execution_time.txt + +%.m: %.xsil + $(XSIL2GRAPHICS) $< + +plot: $(M_FILES) $(GNUPLOT_FILES) + octave pp_I2.m + gnuplot plot_fields_propagation_I2.gp + +clean: + rm -f $(CC_FILES) $(RUN_FILES) $(M_FILES) $(XSIL_FILES) *.wisdom.fftw3 *.dat octave-core *.wisdom *.pdf + rm -f $(pdf_targets) + rm -f $(eps_targets) + +real_clean: clean + rm -f $(png_targets) + +eps_targets = $(wildcard *.eps) +pdf_targets = $(eps_targets:%.eps=%.pdf) +png_targets = $(pdf_targets:%.pdf=%.png) + +pdf: $(pdf_targets) + +$(pdf_targets): %.pdf : %.eps + cat $< | ps2eps -B > __tt.eps + epspdf __tt.eps $@ + rm -f __tt.eps + #ps2eps -B $< | epspdf $< $@ + +png: pdf $(png_targets) + +$(png_targets): %.png : %.pdf + convert -density 300 $< $@ + +.PRECIOUS: %.run %.xsil %.m +.PHONY: all clean diff --git a/xmds2/Nlevels_no_dopler_with_z_4wm_for_irina_pqe/fast_light/map2dat.m b/xmds2/Nlevels_no_dopler_with_z_4wm_for_irina_pqe/fast_light/map2dat.m new file mode 100644 index 0000000..969b6dc --- /dev/null +++ b/xmds2/Nlevels_no_dopler_with_z_4wm_for_irina_pqe/fast_light/map2dat.m @@ -0,0 +1,33 @@ +function map2dat(outfile, x,y,z, xskip, yskip) +% saves 3D data in suitable way to be drawn by gnuplot +% x,y - vectors of x,y values +% z map of z values as used by Octave/Matlab +% xskip, yskip - skip paprameters +% only every, xskip, yskip point will be written + + + +Nx=length(x); +Ny=length(y); +Nxs=Nx/xskip; +Nys=Ny/yskip; +points=zeros(1,3*Nxs*Nys); +%points=[]; +tic; +for i=1:Nxs + for k=1:Nys + %points=[points x(i*xskip) y(k*yskip) z(k*yskip,i*xskip)]; + points((i-1)*(Nys-1)*3+3*(k-1)+1) = x(i*xskip); + points((i-1)*(Nys-1)*3+3*(k-1)+2) = y(k*yskip); + points((i-1)*(Nys-1)*3+3*(k-1)+3) = z(k*yskip,i*xskip); + end +end +disp('=== points formation complete ==='); +toc +tic; +%points +fd = fopen(outfile, "wt"); +fprintf (fd, "%g %g %g\n", points); +fclose(fd); +disp('=== points saving complete ==='); +toc; diff --git a/xmds2/Nlevels_no_dopler_with_z_4wm_for_irina_pqe/fast_light/plot_fields_propagation_I2.gp b/xmds2/Nlevels_no_dopler_with_z_4wm_for_irina_pqe/fast_light/plot_fields_propagation_I2.gp new file mode 100644 index 0000000..8591d87 --- /dev/null +++ b/xmds2/Nlevels_no_dopler_with_z_4wm_for_irina_pqe/fast_light/plot_fields_propagation_I2.gp @@ -0,0 +1,15 @@ +set terminal postscript portrait enhanced color solid size 5,3.5 +set output 'fields_propagation_I2.eps' +set dgrid3d 100,100 qnorm 4 +set pm3d map +#set contour +set hidden3d +set palette rgb 10,13,31 negative + + +set xlabel "z (cm)" +set ylabel "t ({/Symbol m}S)" +set zlabel "I_2 (1/S)" +set nokey +#set view map +splot [0:1.5][-0.2:0.2] 'I2.dat' diff --git a/xmds2/Nlevels_no_dopler_with_z_4wm_for_irina_pqe/fast_light/pp_I2.m b/xmds2/Nlevels_no_dopler_with_z_4wm_for_irina_pqe/fast_light/pp_I2.m new file mode 100644 index 0000000..cb34777 --- /dev/null +++ b/xmds2/Nlevels_no_dopler_with_z_4wm_for_irina_pqe/fast_light/pp_I2.m @@ -0,0 +1,71 @@ +Nlevels_no_dopler_with_z_4wm + +%% field propagation +z_1=z_1*100; % z in cm +t_1=t_1*1e6; % time now measured in uS +figure(1) +%set(gca,'fontsize',20); +imagesc(z_1, t_1, I2_out_1); colorbar +tmin=-0.4; +tmax= 0.4; +ylim([tmin,tmax],'manual'); +xlabel('z (cm)') +ylabel('t (uS)') +zlabel('I_2') +title('I_2') + +xskip=1; +yskip=10; +map2dat('I2.dat',z_1,t_1, I2_out_1, xskip, yskip); + + + +print('-color','-depsc2', '-tight', '-S200,120', 'fields_propagation_I2.eps') + + + +%% fields before and after the cell +figure(2) +%set(gca,'fontsize',30); +plot( ... + t_1,I2_out_1(:,1),'.-;before;', "linewidth", 4, ... + t_1,I2_out_1(:,end), '-;after;', "linewidth", 4 ... + ) +xlabel('t (uS)') +ylabel('I_2 (1/s)^2') +title('I_2 before and after cell') +legend('location', 'southwest'); + +[b, a]=butter(3, 0.05); +I2_out_after=I2_out_1(:,end); +I2_out_after_filtered=filtfilt(b,a,I2_out_after); +settling_time=0.01; %uS +t_good_indx=t_1> min(t_1 + settling_time); +[m,max_pos_before]=max(I2_out_1(t_good_indx,1) ); [m,max_pos_after]=max(I2_out_after_filtered(t_good_indx)); +delay_time=t_1(max_pos_after)-t_1(max_pos_before); +printf('Second field delay time = %f uS\n',delay_time); + +%set(gca,'fontsize',40); +%set (gcf,'paperposition',[0.5 0 2.5,1.5]); % IMPORTANT to shrink eps size for readable fonts +print('-color','-depsc2', '-tight','-S200,120', 'fields_before_after_cell_I2.eps') + +figure(4) +I2_max_in=max(I2_out_1(t_good_indx,1)); +I2_max_out=max(I2_out_1(t_good_indx,end)); +I2_in_norm=(I2_out_1(:,1))/I2_max_in; +I2_out_norm=(I2_out_1(:,end))/I2_max_out; +tmin=-.05; +tmax=.05; +indx=(t_1>=tmin & t_1<=tmax); % soom in in time to this region +plot( ... + t_1(indx),I2_in_norm(indx),'.-;before;', "linewidth", 4, ... + t_1(indx),I2_out_norm(indx), '-;after;', "linewidth", 4 ... + ) +legend('location', 'southeast'); +xlim([tmin,tmax],'manual'); +xlabel('t (uS)') +ylabel('I_2') +title('I_2 before and after cell normalized') +%set (gcf,'paperposition',[0.5 0 2.5,1.5]); % IMPORTANT to shrink eps size for readable fonts +print('-color','-depsc2', '-tight','-S200,120', 'probe_before_after_cell_I2_normalized.eps') + diff --git a/xmds2/Nlevels_no_dopler_with_z_4wm_for_irina_pqe/map2dat.m b/xmds2/Nlevels_no_dopler_with_z_4wm_for_irina_pqe/map2dat.m new file mode 100644 index 0000000..969b6dc --- /dev/null +++ b/xmds2/Nlevels_no_dopler_with_z_4wm_for_irina_pqe/map2dat.m @@ -0,0 +1,33 @@ +function map2dat(outfile, x,y,z, xskip, yskip) +% saves 3D data in suitable way to be drawn by gnuplot +% x,y - vectors of x,y values +% z map of z values as used by Octave/Matlab +% xskip, yskip - skip paprameters +% only every, xskip, yskip point will be written + + + +Nx=length(x); +Ny=length(y); +Nxs=Nx/xskip; +Nys=Ny/yskip; +points=zeros(1,3*Nxs*Nys); +%points=[]; +tic; +for i=1:Nxs + for k=1:Nys + %points=[points x(i*xskip) y(k*yskip) z(k*yskip,i*xskip)]; + points((i-1)*(Nys-1)*3+3*(k-1)+1) = x(i*xskip); + points((i-1)*(Nys-1)*3+3*(k-1)+2) = y(k*yskip); + points((i-1)*(Nys-1)*3+3*(k-1)+3) = z(k*yskip,i*xskip); + end +end +disp('=== points formation complete ==='); +toc +tic; +%points +fd = fopen(outfile, "wt"); +fprintf (fd, "%g %g %g\n", points); +fclose(fd); +disp('=== points saving complete ==='); +toc; diff --git a/xmds2/Nlevels_no_dopler_with_z_4wm_for_irina_pqe/pp.m b/xmds2/Nlevels_no_dopler_with_z_4wm_for_irina_pqe/pp.m new file mode 100644 index 0000000..b88fa6e --- /dev/null +++ b/xmds2/Nlevels_no_dopler_with_z_4wm_for_irina_pqe/pp.m @@ -0,0 +1,190 @@ +Nlevels_no_dopler_with_z_4wm + +%% field propagation +z_1=z_1*100; % z in cm +t_1=t_1*1e6; % time now measured in uS +figure(1) +subplot(2,2,1); imagesc(z_1, t_1, I1_out_1); colorbar +xlabel('z (cm)') +ylabel('t (uS)') +zlabel('I_1') +title('I_1') +subplot(2,2,2); imagesc(z_1, t_1, I2_out_1); colorbar +xlabel('z (cm)') +ylabel('t (uS)') +zlabel('I_2') +title('I_2') +subplot(2,2,3); imagesc(z_1, t_1, I3_out_1); colorbar +xlabel('z (cm)') +ylabel('t (uS)') +zlabel('I_3') +title('I_3') +subplot(2,2,4); imagesc(z_1, t_1, I4_out_1); colorbar +xlabel('z (cm)') +ylabel('t (uS)') +zlabel('I_4') +title('I_4') + + +print('-color','fields_propagation.eps') + + + +%% fields before and after the cell +figure(2) +subplot(2,2,1); +plot( ... + t_1,I1_out_1(:,1),'-;before;', "linewidth", 4, ... + t_1,I1_out_1(:,end), '-;after;', "linewidth", 4 ... + ) +xlabel('t (uS)') +ylabel('I_1 (1/s)^2') +title('I_1 before and after cell') +subplot(2,2,2); +plot( ... + t_1,I2_out_1(:,1),'-;before;', "linewidth", 4, ... + t_1,I2_out_1(:,end), '-;after;', "linewidth", 4 ... + ) +xlabel('t (uS)') +ylabel('I_2 (1/s)^2') +title('I_2 before and after cell') +subplot(2,2,3); +plot( ... + t_1,I3_out_1(:,1),'-;before;', "linewidth", 4, ... + t_1,I3_out_1(:,end), '-;after;', "linewidth", 4 ... + ) +xlabel('t (uS)') +ylabel('I_3 (1/s)^2') +title('I_3 before and after cell') + +[b, a]=butter(3, 0.05); +I2_out_after=I2_out_1(:,end); +I2_out_after_filtered=filtfilt(b,a,I2_out_after); +settling_time=0.8; %uS +t_good_indx=t_1> min(t_1 + settling_time); +[m,max_pos_before]=max(I2_out_1(t_good_indx,1) ); [m,max_pos_after]=max(I2_out_after_filtered(t_good_indx)); +delay_time=t_1(max_pos_after)-t_1(max_pos_before); +printf('Second field delay time = %f uS\n',delay_time); + +print('-color','fields_before_after_cell.eps') + +subplot(2,2,4); +plot( ... + t_1,I4_out_1(:,1),'-;before;', "linewidth", 4, ... + t_1,I4_out_1(:,end), '-;after;', "linewidth", 4 ... + ) +xlabel('t (uS)') +ylabel('I_3 (1/s)^2') +title('I_3 before and after cell') + +figure(4) +I2_max_in=max(I2_out_1(t_good_indx,1)); +I2_max_out=max(I2_out_1(t_good_indx,end)); +I2_in_norm=(I2_out_1(:,1))/I2_max_in; +I2_out_norm=(I2_out_1(:,end))/I2_max_out; +tmin=-0.05; +tmax=0.05; +indx=(t_1>=tmin & t_1<=tmax); % soom in in time to this region +plot( ... + t_1(indx),I2_in_norm(indx),'-;before;', "linewidth", 4, ... + t_1(indx),I2_out_norm(indx), '-;after;', "linewidth", 4 ... + ) +xlim([tmin,tmax],'manual'); +xlabel('t (uS)') +ylabel('I_2') +title('I_2 before and after cell normalized') +print('-color','probe_before_after_cell.eps') + +return; + +%% all density matrix elements in one plot +% diagonal populations, +% upper triangle real part of coherences, +% lower diagonal imaginary part of coherences +z_2=z_2*100; % z in cm +t_2=t_2*1e6; % time now measured in uS +figure(3) +subplot(4,4,1); imagesc (z_2, t_2, r11_out_2); caxis([0,1]); colorbar +xlabel('z (cm)') +ylabel('t (uS)') +zlabel('rho_{11}') +title('rho_{11}') +subplot(4,4,6); imagesc (z_2, t_2, r22_out_2); caxis([0,1]); colorbar +xlabel('z (cm)') +ylabel('t (uS)') +zlabel('rho_{22}') +title('rho_{22}') +subplot(4,4,11); imagesc (z_2, t_2, r33_out_2); caxis([0,1]); colorbar +xlabel('z (cm)') +ylabel('t (uS)') +zlabel('rho_{33}') +title('rho_{33}') +subplot(4,4,16); imagesc (z_2, t_2, r44_out_2); caxis([0,1]); colorbar +xlabel('z (cm)') +ylabel('t (uS)') +zlabel('rho_{44}') +title('rho_{44}') +% real parts of coherences +subplot(4,4,2); imagesc(z_2, t_2, r12_re_out_2); colorbar +xlabel('z (cm)') +ylabel('t (uS)') +zlabel('Real(rho_{12})') +title('Real(rho_{12})') +subplot(4,4,3); imagesc(z_2, t_2, r13_re_out_2); colorbar +xlabel('z (cm)') +ylabel('t (uS)') +zlabel('Real(rho_{13})') +title('Real(rho_{13})') +subplot(4,4,4); imagesc(z_2, t_2, r14_re_out_2); colorbar +xlabel('z (cm)') +ylabel('t (uS)') +zlabel('Real(rho_{14})') +title('Real(rho_{14})') +subplot(4,4,7); imagesc(z_2, t_2, r23_re_out_2); colorbar +xlabel('z (cm)') +ylabel('t (uS)') +zlabel('Real(rho_{23})') +title('Real(rho_{23})') +subplot(4,4,8); imagesc(z_2, t_2, r24_re_out_2); colorbar +xlabel('z (cm)') +ylabel('t (uS)') +zlabel('Real(rho_{24})') +title('Real(rho_{24})') +subplot(4,4,12); imagesc(z_2, t_2, r34_re_out_2); colorbar +xlabel('z (cm)') +ylabel('t (uS)') +zlabel('Real(rho_{34})') +title('Real(rho_{34})') +% imaginary parts of coherences +subplot(4,4,5); imagesc(z_2, t_2, r12_im_out_2); colorbar +xlabel('z (cm)') +ylabel('t (uS)') +zlabel('Imag(rho_{12})') +title('Imag(rho_{12})') +subplot(4,4,9); imagesc(z_2, t_2, r13_im_out_2); colorbar +xlabel('z (cm)') +ylabel('t (uS)') +zlabel('Imag(rho_{13})') +title('Imag(rho_{13})') +subplot(4,4,10); imagesc(z_2, t_2, r23_im_out_2); colorbar +xlabel('z (cm)') +ylabel('t (uS)') +zlabel('Imag(rho_{23})') +title('Imag(rho_{23})') +subplot(4,4,13); imagesc(z_2, t_2, r14_im_out_2); colorbar +xlabel('z (cm)') +ylabel('t (uS)') +zlabel('Imag(rho_{14})') +title('Imag(rho_{14})') +subplot(4,4,14); imagesc(z_2, t_2, r24_im_out_2); colorbar +xlabel('z (cm)') +ylabel('t (uS)') +zlabel('Imag(rho_{24})') +title('Imag(rho_{24})') +subplot(4,4,15); imagesc(z_2, t_2, r34_im_out_2); colorbar +xlabel('z (cm)') +ylabel('t (uS)') +zlabel('Imag(rho_{34})') +title('Imag(rho_{34})') + + diff --git a/xmds2/Nlevels_no_dopler_with_z_4wm_for_irina_pqe/pp_I2.m b/xmds2/Nlevels_no_dopler_with_z_4wm_for_irina_pqe/pp_I2.m new file mode 100644 index 0000000..45d4913 --- /dev/null +++ b/xmds2/Nlevels_no_dopler_with_z_4wm_for_irina_pqe/pp_I2.m @@ -0,0 +1,71 @@ +Nlevels_no_dopler_with_z_4wm + +%% field propagation +z_1=z_1*100; % z in cm +t_1=t_1*1e6; % time now measured in uS +figure(1) +%set(gca,'fontsize',20); +imagesc(z_1, t_1, I2_out_1); colorbar +tmin=-0.4; +tmax= 0.4; +ylim([tmin,tmax],'manual'); +xlabel('z (cm)') +ylabel('t (uS)') +zlabel('I_2') +title('I_2') + +xskip=1; +yskip=10; +%map2dat('I2.dat',z_1,t_1, I2_out_1, xskip, yskip); + + + +print('-color','-depsc2', '-tight', '-S200,120', 'fields_propagation_I2.eps') + + + +%% fields before and after the cell +figure(2) +%set(gca,'fontsize',30); +plot( ... + t_1,I2_out_1(:,1),'.-;before;', "linewidth", 4, ... + t_1,I2_out_1(:,end), '-;after;', "linewidth", 4 ... + ) +xlabel('t (uS)') +ylabel('I_2 (1/s)^2') +title('I_2 before and after cell') +legend('location', 'southwest'); + +[b, a]=butter(3, 0.05); +I2_out_after=I2_out_1(:,end); +I2_out_after_filtered=filtfilt(b,a,I2_out_after); +settling_time=0.8; %uS +t_good_indx=t_1> min(t_1 + settling_time); +[m,max_pos_before]=max(I2_out_1(t_good_indx,1) ); [m,max_pos_after]=max(I2_out_after_filtered(t_good_indx)); +delay_time=t_1(max_pos_after)-t_1(max_pos_before); +printf('Second field delay time = %f uS\n',delay_time); + +%set(gca,'fontsize',40); +%set (gcf,'paperposition',[0.5 0 2.5,1.5]); % IMPORTANT to shrink eps size for readable fonts +print('-color','-depsc2', '-tight','-S200,120', 'fields_before_after_cell_I2.eps') + +figure(4) +I2_max_in=max(I2_out_1(t_good_indx,1)); +I2_max_out=max(I2_out_1(t_good_indx,end)); +I2_in_norm=(I2_out_1(:,1))/I2_max_in; +I2_out_norm=(I2_out_1(:,end))/I2_max_out; +tmin=-0.05; +tmax=0.05; +indx=(t_1>=tmin & t_1<=tmax); % soom in in time to this region +plot( ... + t_1(indx),I2_in_norm(indx),'.-;before;', "linewidth", 4, ... + t_1(indx),I2_out_norm(indx), '-;after;', "linewidth", 4 ... + ) +legend('location', 'southeast'); +xlim([tmin,tmax],'manual'); +xlabel('t (uS)') +ylabel('I_2') +title('I_2 before and after cell normalized') +%set (gcf,'paperposition',[0.5 0 2.5,1.5]); % IMPORTANT to shrink eps size for readable fonts +print('-color','-depsc2', '-tight','-S200,120', 'probe_before_after_cell_I2_normalized.eps') + -- cgit v1.2.3