function [stewart] = initializeJointDynamics(stewart, args)
    arguments
        stewart
        args.type_F   char   {mustBeMember(args.type_F,{'2dof', '3dof', '2dof_a', '3dof_a', '6dof'})} = '2dof'
        args.type_M   char   {mustBeMember(args.type_M,{'2dof', '3dof', '2dof_a', '3dof_a', '6dof'})} = '3dof'
        args.Kf (1,1) double {mustBeNumeric, mustBeNonnegative} = 0 % Bending stiffness
        args.Cf (1,1) double {mustBeNumeric, mustBeNonnegative} = 0
        args.Kt (1,1) double {mustBeNumeric, mustBeNonnegative} = 0 % Torsional stiffness
        args.Ct (1,1) double {mustBeNumeric, mustBeNonnegative} = 0
        args.Ka (1,1) double {mustBeNumeric, mustBeNonnegative} = 0 % Axial stiffness
        args.Ca (1,1) double {mustBeNumeric, mustBeNonnegative} = 0
        args.Ks (1,1) double {mustBeNumeric, mustBeNonnegative} = 0 % Shear stiffness
        args.Cs (1,1) double {mustBeNumeric, mustBeNonnegative} = 0
    end

    switch args.type_F
      case '2dof'
        stewart.joints.type_F = 1;
      case '3dof'
        stewart.joints.type_F = 2;
      case '2dof_a'
        stewart.joints.type_F = 3;
      case '3dof_a'
        stewart.joints.type_F = 4;
      case '6dof'
        stewart.joints.type_F = 5;
      otherwise
        error("joints are not correctly defined")
    end

    switch args.type_M
      case '2dof'
        stewart.joints.type_M = 1;
      case '3dof'
        stewart.joints.type_M = 2;
      case '2dof_a'
        stewart.joints.type_M = 3;
      case '3dof_a'
        stewart.joints.type_M = 4;
      case '6dof'
        stewart.joints.type_M = 5;
      otherwise
        error("joints are not correctly defined")
    end

    %% Axial Stiffness
    stewart.joints.Ka = args.Ka;
    stewart.joints.Ca = args.Ca;

    %% Bending Stiffness
    stewart.joints.Kf = args.Kf;
    stewart.joints.Cf = args.Cf;

    %% Torsional Stiffness
    stewart.joints.Kt = args.Kt;
    stewart.joints.Ct = args.Ct;

    %% Shear Stiffness
    stewart.joints.Ks = args.Ks;
    stewart.joints.Cs = args.Cs;
end
