2021-07-14 20:23:00 +02:00
|
|
|
function plotCaptureVelocityVsAngle(OvenObj, MOTObj)
|
2021-07-03 10:19:27 +02:00
|
|
|
|
2021-07-14 20:23:00 +02:00
|
|
|
theta = linspace(0, OvenObj.ExitDivergence, 1000);
|
2021-07-03 10:19:27 +02:00
|
|
|
CaptureVelocity = zeros(length(theta),3);
|
|
|
|
|
|
|
|
for i=1:length(theta)
|
2021-07-14 20:23:00 +02:00
|
|
|
CaptureVelocity(i,:) = MOTObj.calculateCaptureVelocity(OvenObj, [-OvenObj.OvenDistance,0,0], [cos(theta(i)),0,sin(theta(i))]);
|
2021-07-03 10:19:27 +02:00
|
|
|
end
|
|
|
|
|
|
|
|
f_h = Helper.getFigureByTag('Capture Velocity');
|
|
|
|
set(groot,'CurrentFigure',f_h);
|
|
|
|
a_h = get(f_h, 'CurrentAxes');
|
|
|
|
if ~isempty(get(a_h, 'Children'))
|
|
|
|
clf(f_h);
|
|
|
|
end
|
|
|
|
f_h.Name = 'Capture Velocity';
|
|
|
|
f_h.Units = 'pixels';
|
|
|
|
|
|
|
|
set(0,'units','pixels');
|
|
|
|
screensize = get(0,'ScreenSize');
|
|
|
|
f_h.Position = [[screensize(3)/3.5 screensize(4)/3.5] 750 600];
|
|
|
|
|
2021-07-11 06:00:08 +02:00
|
|
|
plot(theta .* 1e+03, sqrt(CaptureVelocity(:,1).^2+CaptureVelocity(:,2).^2+CaptureVelocity(:,3).^2), 'Linewidth', 1.5)
|
2021-07-03 10:19:27 +02:00
|
|
|
|
2021-07-11 06:00:08 +02:00
|
|
|
hXLabel = xlabel('\theta (mrad)');
|
2021-07-03 10:19:27 +02:00
|
|
|
hYLabel = ylabel('Velocity (m/s)');
|
2021-07-11 06:00:08 +02:00
|
|
|
hTitle = sgtitle('Capture velocity for different angles of divergence');
|
2021-07-03 10:19:27 +02:00
|
|
|
|
|
|
|
set([hXLabel, hYLabel] , ...
|
|
|
|
'FontSize' , 14 );
|
|
|
|
set( hTitle , ...
|
2021-07-11 06:00:08 +02:00
|
|
|
'FontSize' , 14 );
|
2021-07-03 10:19:27 +02:00
|
|
|
|
|
|
|
grid on
|
|
|
|
Helper.bringFiguresWithTagInForeground();
|
|
|
|
|
|
|
|
end
|