2021-07-11 14:38:37 +02:00
|
|
|
function T = computeTimeSpentInInteractionRegion(this, r)
|
|
|
|
% INPUT:
|
|
|
|
% r : N x 3 array. N is the number of time steps
|
|
|
|
% OUTPUT
|
|
|
|
% T : gives the distribution of time spent in the interaction region
|
|
|
|
% USAGE:
|
|
|
|
% T = this.computeTimeSpentInInteractionRegion(r)
|
|
|
|
T = 0;
|
2021-07-14 20:23:00 +02:00
|
|
|
CoolingBeamObj = this.Beams{cellfun(@(x) strcmpi(x.Alias, 'Blue'), this.Beams)};
|
2021-07-11 14:38:37 +02:00
|
|
|
NumberOfTimeSteps = int64(this.SimulationTime/this.TimeStep);
|
|
|
|
for n = 1:(NumberOfTimeSteps - 1)
|
2021-07-11 14:51:17 +02:00
|
|
|
dr = Helper.calculateDistanceFromPointToLine(r(n+1, :), [0 0 0], [0 0 1]);
|
2021-07-14 20:23:00 +02:00
|
|
|
if dr < CoolingBeamObj.Radius
|
2021-07-11 14:38:37 +02:00
|
|
|
A = 1;
|
|
|
|
else
|
|
|
|
A = 0;
|
|
|
|
end
|
|
|
|
T = T + A * this.TimeStep;
|
|
|
|
end
|
|
|
|
end
|