Changeset 256 in ETALON for simulations
- Timestamp:
- Aug 7, 2015, 1:29:55 PM (9 years ago)
- Location:
- simulations
- Files:
-
- 1 deleted
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
simulations/FarZoneCriterium/pw_PlotCrit.m
r244 r256 1 %{ 1 2 pw_pitch = input('Please enter the pitch(period) of the grating (in mm):\n'); 2 3 pw_stripnum = input('Please enter the number of strips in grating:\n'); 3 4 pw_plotname = input('Please enter Name of the plot:\n', 's'); 4 pw_farZoneCrit(pw_pitch,pw_stripnum,pw_plotname); 5 pw_r0 = input('Please enter distance from detector:\n'); 6 pw_th_min = input('Please enter minimum theta:\n'); 7 pw_th_max = input('Please enter maximum theta:\n'); 8 pw_farZoneCrit(pw_pitch,pw_stripnum,pw_plotname,pw_r0,pw_th_min,pw_th_max); 9 %} 10 pw_farZoneCrit(0.05,800,'Plot4',220,40,140); 11 -
simulations/FarZoneCriterium/pw_farZoneCrit.m
r244 r256 1 function result=pw_farZoneCrit(d,N,Name )1 function result=pw_farZoneCrit(d,N,Name,r0,theta_min,theta_max) 2 2 y=@(x)N^2*d*(1+cos(x)); 3 3 theta=0:180; 4 4 theta=theta*pi/180; 5 grating_size=[-(d*N/2),(d*N/2)]; 6 zone_X=[0,(r0).*cos((theta_min:(theta_max-theta_min)/100:theta_max).*pi/180),0]; 7 zone_Y=[0,(r0).*sin((theta_min:(theta_max-theta_min)/100:theta_max).*pi/180),0]; 5 8 6 9 fig = figure('visible', 'off'); 7 plot(y(theta).*cos(theta),y(theta).*sin(theta), 'LineWidth', 2); 10 plot(y(theta).*cos(theta),y(theta).*sin(theta),... 11 y(theta).*cos(theta)./5,y(theta).*sin(theta)./5,... 12 y(theta).*cos(theta)./20,y(theta).*sin(theta)./20,... 13 'LineWidth', 2); 14 set(gca, 'FontSize', 18, 'LineWidth', 2); 8 15 xlabel('Z , mm'); 9 16 ylabel('Y , mm'); 10 17 title({'Far zone criterium in ZY plane';['d =' num2str(d) 'mm N = ' num2str(N)]}); 18 legend('R far','R far/5','R Far/20'); 11 19 print( fig , '-dpng', [Name '_ZY.png']); 12 20 close(fig); 13 21 14 22 fig = figure('visible', 'off'); 15 plot(theta*180/pi,y(theta), 'LineWidth', 2); 23 plot(y(theta).*cos(theta)/20,y(theta).*sin(theta)/20,zone_X,zone_Y,grating_size,[0 0] ,'LineWidth', 2); 24 set(gca, 'FontSize', 18, 'LineWidth', 2); 25 xlabel('Z , mm'); 26 ylabel('Y , mm'); 27 title({'Far zone criterium in ZY plane, ';['d =' num2str(d) 'mm N = ' num2str(N)]}); 28 legend('Far zone criterium/20','Observation zone','Grating') 29 print( fig , '-dpng', [Name 'log_ZY.png']); 30 close(fig); 31 32 33 fig = figure('visible', 'off'); 34 semilogy(theta*180/pi,y(theta),[theta(1) theta(end)]*180/pi,[r0 r0], 'LineWidth', 2); 35 set(gca, 'FontSize', 18, 'LineWidth', 2); 16 36 xlabel('\theta , deg'); 17 37 ylabel('Criterium , mm'); 18 38 grid on; 39 legend('Far zone criterium','Observation zone'); 19 40 %grid minor; 20 41 title({'Far zone criterium related to theta';['d =' num2str(d) 'mm N = ' num2str(N)]});
Note: See TracChangeset
for help on using the changeset viewer.