2020-01-13 11:42:31 +01:00
|
|
|
function [sample] = initializeSample(sample)
|
|
|
|
arguments
|
2020-01-16 11:49:29 +01:00
|
|
|
sample.radius (1,1) double {mustBeNumeric, mustBePositive} = 100 % [mm]
|
|
|
|
sample.height (1,1) double {mustBeNumeric, mustBePositive} = 300 % [mm]
|
|
|
|
sample.mass (1,1) double {mustBeNumeric, mustBePositive} = 50 % [kg]
|
|
|
|
sample.freq (1,1) double {mustBeNumeric, mustBePositive} = 100 % [Hz]
|
|
|
|
sample.offset (1,1) double {mustBeNumeric} = 0 % [mm]
|
2020-01-13 11:42:31 +01:00
|
|
|
sample.color (1,3) double {mustBeNumeric} = [0.45, 0.45, 0.45]
|
2018-06-16 22:57:54 +02:00
|
|
|
end
|
2019-07-15 11:07:24 +02:00
|
|
|
|
2018-10-25 11:00:30 +02:00
|
|
|
%%
|
2020-01-16 11:49:29 +01:00
|
|
|
sample.k.x = sample.mass * (2*pi * sample.freq)^2;
|
2019-11-22 10:36:26 +01:00
|
|
|
sample.c.x = 0.1*sqrt(sample.k.x*sample.mass);
|
2018-06-16 22:57:54 +02:00
|
|
|
|
2020-01-16 11:49:29 +01:00
|
|
|
sample.k.y = sample.mass * (2*pi * sample.freq)^2;
|
2019-11-22 10:36:26 +01:00
|
|
|
sample.c.y = 0.1*sqrt(sample.k.y*sample.mass);
|
2018-10-25 11:00:30 +02:00
|
|
|
|
2020-01-16 11:49:29 +01:00
|
|
|
sample.k.z = sample.mass * (2*pi * sample.freq)^2;
|
2019-11-22 10:36:26 +01:00
|
|
|
sample.c.z = 0.1*sqrt(sample.k.z*sample.mass);
|
2018-10-25 11:00:30 +02:00
|
|
|
|
|
|
|
%% Save
|
2018-10-11 10:25:57 +02:00
|
|
|
save('./mat/stages.mat', 'sample', '-append');
|
2018-06-16 22:57:54 +02:00
|
|
|
end
|