2020-01-13 11:42:31 +01:00
|
|
|
function [] = initializeMirror(args)
|
2018-07-11 15:44:16 +02:00
|
|
|
|
2020-02-03 17:50:52 +01:00
|
|
|
arguments
|
2020-02-17 18:21:20 +01:00
|
|
|
args.type char {mustBeMember(args.type,{'none', 'rigid'})} = 'rigid'
|
|
|
|
args.shape char {mustBeMember(args.shape,{'spherical', 'conical'})} = 'spherical'
|
|
|
|
args.angle (1,1) double {mustBeNumeric, mustBePositive} = 45 % [deg]
|
2020-02-03 17:50:52 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
mirror = struct();
|
|
|
|
|
2020-02-17 18:21:20 +01:00
|
|
|
switch args.type
|
|
|
|
case 'none'
|
|
|
|
mirror.type = 0;
|
|
|
|
case 'rigid'
|
|
|
|
mirror.type = 1;
|
|
|
|
end
|
|
|
|
|
2020-02-03 17:50:52 +01:00
|
|
|
mirror.h = 50; % Height of the mirror [mm]
|
2020-02-17 18:21:20 +01:00
|
|
|
|
2020-02-03 17:50:52 +01:00
|
|
|
mirror.thickness = 25; % Thickness of the plate supporting the sample [mm]
|
2020-02-17 18:21:20 +01:00
|
|
|
|
2020-02-03 17:50:52 +01:00
|
|
|
mirror.hole_rad = 120; % radius of the hole in the mirror [mm]
|
2020-02-17 18:21:20 +01:00
|
|
|
|
2020-02-03 17:50:52 +01:00
|
|
|
mirror.support_rad = 100; % radius of the support plate [mm]
|
2020-02-17 18:21:20 +01:00
|
|
|
|
|
|
|
% point of interest offset in z (above the top surfave) [mm]
|
|
|
|
switch args.type
|
|
|
|
case 'none'
|
|
|
|
mirror.jacobian = 200;
|
|
|
|
case 'rigid'
|
|
|
|
mirror.jacobian = 200 - mirror.h;
|
|
|
|
end
|
|
|
|
|
2020-02-03 17:50:52 +01:00
|
|
|
mirror.rad = 180; % radius of the mirror (at the bottom surface) [mm]
|
|
|
|
|
|
|
|
mirror.density = 2400; % Density of the material [kg/m3]
|
2018-07-11 15:44:16 +02:00
|
|
|
|
2020-02-03 17:50:52 +01:00
|
|
|
mirror.cone_length = mirror.rad*tand(args.angle)+mirror.h+mirror.jacobian; % Distance from Apex point of the cone to jacobian point
|
2018-07-11 15:44:16 +02:00
|
|
|
|
2020-02-03 17:50:52 +01:00
|
|
|
mirror.shape = [...
|
|
|
|
0 mirror.h-mirror.thickness
|
|
|
|
mirror.hole_rad mirror.h-mirror.thickness; ...
|
|
|
|
mirror.hole_rad 0; ...
|
|
|
|
mirror.rad 0 ...
|
|
|
|
];
|
|
|
|
|
|
|
|
if strcmp(args.shape, 'spherical')
|
|
|
|
mirror.sphere_radius = sqrt((mirror.jacobian+mirror.h)^2+mirror.rad^2); % Radius of the sphere [mm]
|
|
|
|
|
|
|
|
for z = linspace(0, mirror.h, 101)
|
|
|
|
mirror.shape = [mirror.shape; sqrt(mirror.sphere_radius^2-(z-mirror.jacobian-mirror.h)^2) z];
|
|
|
|
end
|
|
|
|
elseif strcmp(args.shape, 'conical')
|
|
|
|
mirror.shape = [mirror.shape; mirror.rad+mirror.h/tand(args.angle) mirror.h];
|
|
|
|
else
|
|
|
|
error('Shape should be either conical or spherical');
|
2018-07-11 15:44:16 +02:00
|
|
|
end
|
2020-02-03 17:50:52 +01:00
|
|
|
|
|
|
|
mirror.shape = [mirror.shape; 0 mirror.h];
|
|
|
|
|
|
|
|
save('./mat/stages.mat', 'mirror', '-append');
|