58 lines
1.5 KiB
Mathematica
58 lines
1.5 KiB
Mathematica
|
function [ry] = initializeRy(args)
|
||
|
|
||
|
arguments
|
||
|
args.type char {mustBeMember(args.type,{'none', 'rigid', 'flexible'})} = 'flexible'
|
||
|
args.Ry_init (1,1) double {mustBeNumeric} = 0
|
||
|
end
|
||
|
|
||
|
ry = struct();
|
||
|
|
||
|
switch args.type
|
||
|
case 'none'
|
||
|
ry.type = 0;
|
||
|
case 'rigid'
|
||
|
ry.type = 1;
|
||
|
case 'flexible'
|
||
|
ry.type = 2;
|
||
|
end
|
||
|
|
||
|
% Ry - Guide for the tilt stage
|
||
|
ry.guide.density = 7800; % [kg/m3]
|
||
|
ry.guide.STEP = 'Tilt_Guide.STEP';
|
||
|
|
||
|
% Ry - Rotor of the motor
|
||
|
ry.rotor.density = 2400; % [kg/m3]
|
||
|
ry.rotor.STEP = 'Tilt_Motor_Axis.STEP';
|
||
|
|
||
|
% Ry - Motor
|
||
|
ry.motor.density = 3200; % [kg/m3]
|
||
|
ry.motor.STEP = 'Tilt_Motor.STEP';
|
||
|
|
||
|
% Ry - Plateau Tilt
|
||
|
ry.stage.density = 7800; % [kg/m3]
|
||
|
ry.stage.STEP = 'Tilt_Stage.STEP';
|
||
|
|
||
|
% Z-Offset so that the center of rotation matches the sample center;
|
||
|
ry.z_offset = 0.58178; % [m]
|
||
|
|
||
|
ry.Ry_init = args.Ry_init; % [rad]
|
||
|
|
||
|
ry.K = [3.8e8; 4e8; 3.8e8; 1.2e8; 6e4; 1.2e8];
|
||
|
ry.C = [1e5; 1e5; 1e5; 3e4; 1e3; 3e4];
|
||
|
|
||
|
if exist('./mat', 'dir')
|
||
|
if exist('./mat/nass_model_stages.mat', 'file')
|
||
|
save('mat/nass_model_stages.mat', 'ry', '-append');
|
||
|
else
|
||
|
save('mat/nass_model_stages.mat', 'ry');
|
||
|
end
|
||
|
elseif exist('./matlab', 'dir')
|
||
|
if exist('./matlab/mat/nass_model_stages.mat', 'file')
|
||
|
save('matlab/mat/nass_model_stages.mat', 'ry', '-append');
|
||
|
else
|
||
|
save('matlab/mat/nass_model_stages.mat', 'ry');
|
||
|
end
|
||
|
end
|
||
|
|
||
|
end
|