diff --git a/matlab/nass_model.slx b/matlab/nass_model.slx index caf701e..7a03972 100644 Binary files a/matlab/nass_model.slx and b/matlab/nass_model.slx differ diff --git a/org/simscape_subsystems.org b/org/simscape_subsystems.org index 6ac4c49..c90e6ca 100644 --- a/org/simscape_subsystems.org +++ b/org/simscape_subsystems.org @@ -1359,7 +1359,7 @@ The Simscape model of the sample environment is composed of: args.radius (1,1) double {mustBeNumeric, mustBePositive} = 0.1 % [m] args.height (1,1) double {mustBeNumeric, mustBePositive} = 0.3 % [m] args.mass (1,1) double {mustBeNumeric, mustBePositive} = 50 % [kg] - args.freq (1,1) double {mustBeNumeric, mustBePositive} = 100 % [Hz] + args.freq (6,1) double {mustBeNumeric, mustBePositive} = 100*ones(6,1) % [Hz] args.offset (1,1) double {mustBeNumeric} = 0 % [m] args.Foffset logical {mustBeNumericOrLogical} = false end @@ -1404,14 +1404,37 @@ We define the geometrical parameters of the sample as well as its mass and posit sample.offset = args.offset; % [m] #+end_src +** Compute the Inertia +:PROPERTIES: +:UNNUMBERED: t +:END: + +#+begin_src matlab + sample.inertia = [1/12 * sample.mass * (3*sample.radius^2 + sample.height^2); ... + 1/12 * sample.mass * (3*sample.radius^2 + sample.height^2); ... + 1/2 * sample.mass * sample.radius^2]; +#+end_src + ** Stiffness and Damping properties :PROPERTIES: :UNNUMBERED: t :END: #+begin_src matlab - sample.K = ones(3,1) * sample.mass * (2*pi * args.freq)^2; % [N/m] - sample.C = 0.1 * sqrt(sample.K*sample.mass); % [N/(m/s)] + sample.K = zeros(6, 1); + sample.C = zeros(6, 1); +#+end_src + +Translation Stiffness and Damping: +#+begin_src matlab + sample.K(1:3) = sample.mass .* (2*pi * args.freq(1:3)).^2; % [N/m] + sample.C(1:3) = 0.1 * sqrt(sample.K(1:3)*sample.mass); % [N/(m/s)] +#+end_src + +Rotational Stiffness and Damping: +#+begin_src matlab + sample.K(4:6) = sample.inertia .* (2*pi * args.freq(4:6)).^2; % [N/m] + sample.C(4:6) = 0.1 * sqrt(sample.K(4:6).*sample.inertia); % [N/(m/s)] #+end_src ** Equilibrium position of the each joint. @@ -1424,7 +1447,7 @@ We define the geometrical parameters of the sample as well as its mass and posit load('mat/Foffset.mat', 'Fsm'); sample.Deq = -Fsm'./sample.K; else - sample.Deq = zeros(3,1); + sample.Deq = zeros(6,1); end #+end_src diff --git a/src/initializeSample.m b/src/initializeSample.m index b970c31..bc4a757 100644 --- a/src/initializeSample.m +++ b/src/initializeSample.m @@ -5,7 +5,7 @@ arguments args.radius (1,1) double {mustBeNumeric, mustBePositive} = 0.1 % [m] args.height (1,1) double {mustBeNumeric, mustBePositive} = 0.3 % [m] args.mass (1,1) double {mustBeNumeric, mustBePositive} = 50 % [kg] - args.freq (1,1) double {mustBeNumeric, mustBePositive} = 100 % [Hz] + args.freq (6,1) double {mustBeNumeric, mustBePositive} = 100*ones(6,1) % [Hz] args.offset (1,1) double {mustBeNumeric} = 0 % [m] args.Foffset logical {mustBeNumericOrLogical} = false end @@ -28,14 +28,24 @@ sample.height = args.height; % [m] sample.mass = args.mass; % [kg] sample.offset = args.offset; % [m] -sample.K = ones(3,1) * sample.mass * (2*pi * args.freq)^2; % [N/m] -sample.C = 0.1 * sqrt(sample.K*sample.mass); % [N/(m/s)] +sample.inertia = [1/12 * sample.mass * (3*sample.radius^2 + sample.height^2); ... + 1/12 * sample.mass * (3*sample.radius^2 + sample.height^2); ... + 1/2 * sample.mass * sample.radius^2]; + +sample.K = zeros(6, 1); +sample.C = zeros(6, 1); + +sample.K(1:3) = sample.mass .* (2*pi * args.freq(1:3)).^2; % [N/m] +sample.C(1:3) = 0.1 * sqrt(sample.K(1:3)*sample.mass); % [N/(m/s)] + +sample.K(4:6) = sample.inertia .* (2*pi * args.freq(4:6)).^2; % [N/m] +sample.C(4:6) = 0.1 * sqrt(sample.K(4:6).*sample.inertia); % [N/(m/s)] if args.Foffset && ~strcmp(args.type, 'none') && ~strcmp(args.type, 'rigid') && ~strcmp(args.type, 'init') load('mat/Foffset.mat', 'Fsm'); sample.Deq = -Fsm'./sample.K; else - sample.Deq = zeros(3,1); + sample.Deq = zeros(6,1); end save('./mat/stages.mat', 'sample', '-append');