This repository has been archived on 2025-04-18. You can view files and clone it, but cannot push or open issues or pull requests.
Files
phd-nass-fem/matlab/src/initializeCylindricalStruts.m
Thomas Dehaeze 48d16f07f5 All analysis is performed
- Matlab models are working
- Figures are computed
2025-02-25 19:05:33 +01:00

70 lines
2.7 KiB
Matlab

function [stewart] = initializeCylindricalStruts(stewart, args)
% initializeCylindricalStruts - Define the mass and moment of inertia of cylindrical struts
%
% Syntax: [stewart] = initializeCylindricalStruts(args)
%
% Inputs:
% - args - Structure with the following fields:
% - Fsm [1x1] - Mass of the Fixed part of the struts [kg]
% - Fsh [1x1] - Height of cylinder for the Fixed part of the struts [m]
% - Fsr [1x1] - Radius of cylinder for the Fixed part of the struts [m]
% - Msm [1x1] - Mass of the Mobile part of the struts [kg]
% - Msh [1x1] - Height of cylinder for the Mobile part of the struts [m]
% - Msr [1x1] - Radius of cylinder for the Mobile part of the struts [m]
%
% Outputs:
% - stewart - updated Stewart structure with the added fields:
% - struts_F [struct] - structure with the following fields:
% - M [6x1] - Mass of the Fixed part of the struts [kg]
% - I [3x3x6] - Moment of Inertia for the Fixed part of the struts [kg*m^2]
% - H [6x1] - Height of cylinder for the Fixed part of the struts [m]
% - R [6x1] - Radius of cylinder for the Fixed part of the struts [m]
% - struts_M [struct] - structure with the following fields:
% - M [6x1] - Mass of the Mobile part of the struts [kg]
% - I [3x3x6] - Moment of Inertia for the Mobile part of the struts [kg*m^2]
% - H [6x1] - Height of cylinder for the Mobile part of the struts [m]
% - R [6x1] - Radius of cylinder for the Mobile part of the struts [m]
arguments
stewart
args.Fsm (1,1) double {mustBeNumeric, mustBePositive} = 0.1
args.Fsh (1,1) double {mustBeNumeric, mustBePositive} = 50e-3
args.Fsr (1,1) double {mustBeNumeric, mustBePositive} = 5e-3
args.Msm (1,1) double {mustBeNumeric, mustBePositive} = 0.1
args.Msh (1,1) double {mustBeNumeric, mustBePositive} = 50e-3
args.Msr (1,1) double {mustBeNumeric, mustBePositive} = 5e-3
end
stewart.struts_M.type = 1;
%% Compute the properties of the cylindrical struts
Fsm = args.Fsm;
Fsh = args.Fsh;
Fsr = args.Fsr;
Msm = args.Msm;
Msh = args.Msh;
Msr = args.Msr;
I_F = [1/12 * Fsm * (3*Fsr^2 + Fsh^2), ...
1/12 * Fsm * (3*Fsr^2 + Fsh^2), ...
1/2 * Fsm * Fsr^2];
I_M = [1/12 * Msm * (3*Msr^2 + Msh^2), ...
1/12 * Msm * (3*Msr^2 + Msh^2), ...
1/2 * Msm * Msr^2];
stewart.struts_M.I = I_M;
stewart.struts_F.I = I_F;
stewart.struts_M.M = args.Msm;
stewart.struts_M.R = args.Msr;
stewart.struts_M.H = args.Msh;
stewart.struts_F.type = 1;
stewart.struts_F.M = args.Fsm;
stewart.struts_F.R = args.Fsr;
stewart.struts_F.H = args.Fsh;
end