1 | %%% Smith-Purcell simulations for DACTOMUS |
---|
2 | |
---|
3 | global Profile |
---|
4 | global time |
---|
5 | |
---|
6 | %sum_tr=cell(100); |
---|
7 | |
---|
8 | set(0,'DefaultAxesFontSize',22) |
---|
9 | %set(gca,'FontSize',16) |
---|
10 | |
---|
11 | colors={ ':b', '.-g' , '--r' , 's-m', 'o-c', '+:k' , '-y' }; |
---|
12 | |
---|
13 | el_mm_vals=[ 5 ]; |
---|
14 | %el_mm_vals=[ 2 3 4 5 6 7 8 ]; |
---|
15 | gamma_vals=70; |
---|
16 | x0_mm_vals=[ 7 ]; |
---|
17 | epsl_vals=[1]; |
---|
18 | |
---|
19 | pulse_len_ps_vals=[ 5 ]; |
---|
20 | |
---|
21 | multivals={'pulse_len_ps=5;double_gaussian_offset=0;double_gaussian_amplitude=1;double_gaussian_sigma_factor=1;' 'pulse_len_ps=4.9;double_gaussian_offset=-0.007;double_gaussian_amplitude=0.1;double_gaussian_sigma_factor=1.2;' 'pulse_len_ps=2;double_gaussian_offset=-0.004;double_gaussian_amplitude=0.8;double_gaussian_sigma_factor=0.8;' 'pulse_len_ps=2.9;double_gaussian_offset=-0.0029;double_gaussian_amplitude=0.6;double_gaussian_sigma_factor=1.2;'} |
---|
22 | |
---|
23 | el_mm=el_mm_vals(1); |
---|
24 | gamma=gamma_vals(1); |
---|
25 | x0_mm=x0_mm_vals(1); |
---|
26 | pulse_len_ps=pulse_len_ps_vals(1); |
---|
27 | |
---|
28 | %warning('Comment the next line if you do not want to reinitialise') |
---|
29 | %run_done=[] |
---|
30 | |
---|
31 | for multivals_loop=1:length(multivals) |
---|
32 | mvals=multivals{multivals_loop} |
---|
33 | eval(mvals) |
---|
34 | irun=multivals_loop |
---|
35 | if (isempty(find(run_done==irun))) |
---|
36 | sum_tr{irun}=0 |
---|
37 | [nu_Hz{irun},SP_spec_1{irun},SP_spec_N{irun},lam{irun},E_total{irun},sum_tr{irun},thet]=GFWnew(['lgr_mm=200;wid_mm=100;el_mm=' num2str(el_mm) ';alpha1=30;Qbunch_nC=0.01;PrSelect=2;x0_mm=' num2str(x0_mm) ';fwhm_x_mm=0.5;fwhm_y_mm=0.5;pulse_len_ps=' num2str(pulse_len_ps) ';gam=' num2str(gamma) ';epsl=' num2str(epsl) ';ThetaDiv=80;phiDiv=3;' mvals ';PlotFunc=[1 1 1 1 1]']) |
---|
38 | the_profile{irun}=Profile; |
---|
39 | the_time{irun}=time; |
---|
40 | end % we run only if needed |
---|
41 | run_done=[ run_done irun] |
---|
42 | end % multivals |
---|
43 | |
---|
44 | |
---|
45 | |
---|
46 | figure(100) |
---|
47 | legend_txt={}; |
---|
48 | clf |
---|
49 | hold on |
---|
50 | title( [ 'Pulse length ' num2str(pulse_len_ps) ' ps' ' gamma = ' num2str(gamma) ] ) |
---|
51 | figure(101) |
---|
52 | legend_txt={}; |
---|
53 | clf |
---|
54 | hold on |
---|
55 | title( [ 'Pulse length ' num2str(pulse_len_ps) ' ps' ' gamma = ' num2str(gamma) ] ) |
---|
56 | for multivals_loop=1:length(multivals) |
---|
57 | irun=multivals_loop |
---|
58 | figure(100) |
---|
59 | plot(thet,sum_tr{irun},colors{multivals_loop},'linewidth',2) |
---|
60 | grid on |
---|
61 | set(gca,'FontSize',22) |
---|
62 | % legend_txt{el_loop}= [ 'Pitch= ' num2str(el_mm_vals(el_loop)) ' mm - Asym. = ' num2str(epsl_vals(1)) ]; |
---|
63 | legend_txt{multivals_loop}= multivals{multivals_loop}; |
---|
64 | xlim([30 155]) |
---|
65 | % legend(legend_txt); |
---|
66 | xlabel('Observation angle (degree)'); |
---|
67 | ylabel('Signal Intensity (J)'); |
---|
68 | figure(101) |
---|
69 | plot(the_time{irun},the_profile{irun},colors{multivals_loop},'linewidth',2) |
---|
70 | grid on |
---|
71 | set(gca,'FontSize',22) |
---|
72 | xlabel('Time (ns)'); |
---|
73 | ylabel('Intensity (J)'); |
---|
74 | |
---|
75 | end % for multivals |
---|
76 | figure(100) |
---|
77 | print('-dpng',[ '/Users/delerue/travail/smith-purcell/CLIO/simulations/shape_comparison.png' ] ); |
---|
78 | print('-depsc',[ '/Users/delerue/travail/smith-purcell/CLIO/simulations/shape_comparison.eps' ] ); |
---|
79 | |
---|
80 | |
---|