nass-simscape/src/initializeGranite.m

65 lines
2.0 KiB
Matlab

% Granite
% :PROPERTIES:
% :header-args:matlab+: :tangle ../src/initializeGranite.m
% :header-args:matlab+: :comments org :mkdirp yes
% :header-args:matlab+: :eval no :results none
% :END:
% <<sec:initializeGranite>>
% This Matlab function is accessible [[file:../src/initializeGranite.m][here]].
function [granite] = initializeGranite(opts_param)
%% Default values for opts
opts = struct('rigid', false);
%% Populate opts with input parameters
if exist('opts_param','var')
for opt = fieldnames(opts_param)'
opts.(opt{1}) = opts_param.(opt{1});
end
end
%%
granite = struct();
%% Static Properties
granite.density = 2800; % [kg/m3]
granite.volume = 0.749; % [m3] TODO - should
granite.mass = granite.density*granite.volume; % [kg]
granite.color = [1 1 1];
granite.STEP = './STEPS/granite/granite.STEP';
granite.mass_top = 4000; % [kg] TODO
%% Dynamical Properties
if opts.rigid
granite.k.x = 1e12; % [N/m]
granite.k.y = 1e12; % [N/m]
granite.k.z = 1e12; % [N/m]
granite.k.rx = 1e10; % [N*m/deg]
granite.k.ry = 1e10; % [N*m/deg]
granite.k.rz = 1e10; % [N*m/deg]
else
granite.k.x = 4e9; % [N/m]
granite.k.y = 3e8; % [N/m]
granite.k.z = 8e8; % [N/m]
granite.k.rx = 1e4; % [N*m/deg]
granite.k.ry = 1e4; % [N*m/deg]
granite.k.rz = 1e6; % [N*m/deg]
end
granite.c.x = 0.1*sqrt(granite.mass_top*granite.k.x); % [N/(m/s)]
granite.c.y = 0.1*sqrt(granite.mass_top*granite.k.y); % [N/(m/s)]
granite.c.z = 0.5*sqrt(granite.mass_top*granite.k.z); % [N/(m/s)]
granite.c.rx = 0.1*sqrt(granite.mass_top*granite.k.rx); % [N*m/(deg/s)]
granite.c.ry = 0.1*sqrt(granite.mass_top*granite.k.ry); % [N*m/(deg/s)]
granite.c.rz = 0.1*sqrt(granite.mass_top*granite.k.rz); % [N*m/(deg/s)]
%% Positioning parameters
granite.sample_pos = 0.8; % Z-offset for the initial position of the sample [m]
%% Save
save('./mat/stages.mat', 'granite', '-append');
end