diff --git a/simscape_subsystems/sample_environment.slx b/simscape_subsystems/sample_environment.slx index 0551b05..c47e500 100644 Binary files a/simscape_subsystems/sample_environment.slx and b/simscape_subsystems/sample_environment.slx differ diff --git a/src/initializeSample.m b/src/initializeSample.m index 5755623..c2cc4fb 100644 --- a/src/initializeSample.m +++ b/src/initializeSample.m @@ -1,20 +1,21 @@ function [sample] = initializeSample(sample) arguments - sample.radius (1,1) double {mustBeNumeric, mustBePositive} = 100 - sample.height (1,1) double {mustBeNumeric, mustBePositive} = 300 - sample.mass (1,1) double {mustBeNumeric, mustBePositive} = 50 - sample.offset (1,1) double {mustBeNumeric} = 0 + 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] sample.color (1,3) double {mustBeNumeric} = [0.45, 0.45, 0.45] end %% - sample.k.x = 1e8; + sample.k.x = sample.mass * (2*pi * sample.freq)^2; sample.c.x = 0.1*sqrt(sample.k.x*sample.mass); - sample.k.y = 1e8; + sample.k.y = sample.mass * (2*pi * sample.freq)^2; sample.c.y = 0.1*sqrt(sample.k.y*sample.mass); - sample.k.z = 1e8; + sample.k.z = sample.mass * (2*pi * sample.freq)^2; sample.c.z = 0.1*sqrt(sample.k.z*sample.mass); %% Save