source: ETALON/CLIO/CTR+gfw/GFWnew/simulate_SP_at_CLIO_different_profiles_2.m @ 737

Last change on this file since 737 was 737, checked in by delerue, 7 years ago

Added double gaussian to GFWnew

File size: 2.8 KB
Line 
1%%% Smith-Purcell simulations for DACTOMUS
2
3global Profile
4global time
5
6%sum_tr=cell(100);
7
8set(0,'DefaultAxesFontSize',22)
9%set(gca,'FontSize',16)
10
11colors={ ':b', '.-g' , '--r' , 's-m', 'o-c', '+:k' , '-y' };
12
13el_mm_vals=[ 5 ];
14%el_mm_vals=[ 2 3 4 5 6 7 8 ];
15gamma_vals=70;
16x0_mm_vals=[ 7 ];
17epsl_vals=[1];
18
19pulse_len_ps_vals=[ 5 ];
20
21multivals={'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
23el_mm=el_mm_vals(1);
24gamma=gamma_vals(1);
25x0_mm=x0_mm_vals(1);
26pulse_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
31for 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]
42end % multivals
43
44
45
46figure(100)
47legend_txt={};
48clf
49hold on
50title( [ 'Pulse length ' num2str(pulse_len_ps) ' ps'  ' gamma = ' num2str(gamma) ] )
51figure(101)
52legend_txt={};
53clf
54hold on
55title( [ 'Pulse length ' num2str(pulse_len_ps) ' ps'  ' gamma = ' num2str(gamma) ] )
56for 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
75end % 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
Note: See TracBrowser for help on using the repository browser.