Robotran Matlab Documentation

Coordinate partitioning

Partitionning of the generalized coordinates into independent and dependent variables (for constrained multibody systems only).
For more information, see Robotran theoritical framework.

Note
This module must be run once prior to any other module in case of multibody model containing loop and/or user-constraint.

Code sample

For running the coordinate partitioning, insert the following code in your main script and adapt it to your need :

%% 2. Coordinate partitioning [mbs_exe_part] % For constrained MBS only
%--------------------------------------------------------------------------
MBS_user.process = 'part';
[id_joint1, id_joint4, id_joint6] = mbs_get_joint_id(mbs_info,'joint1','joint4','joint6'); % Get joint indices from joint names
qu_id = [id_joint1, id_joint4, id_joint6];
mbs_data = mbs_set_qu(mbs_data,qu_id); % Set variables [qu_id] as independent
[id_joint3, id_joint5] = mbs_get_joint_id(mbs_info,'joint3','joint5'); % Get joint indices from joint names
qv_id = [id_joint3, id_joint5];
mbs_data = mbs_set_qv(mbs_data,qv_id); % Set variables [qv_id] as dependent
qc_id = mbs_get_joint_id(mbs_info,{'joint2'}); % Get joint indices from joint names
mbs_data = mbs_set_qc(mbs_data,qc_id); % Set variables [qc_id] as driven
opt.part = {'rowperm','yes','threshold',1e-9,'verbose','yes'};
% other options : 'visualize', 'clearmbsglobal' % Help about options on www.robotran.be
[mbs_part,mbs_data] = mbs_exe_part(mbs_data,opt.part); % Coordinate partitioning process
% Coordinate partitioning results
disp('Coordinate partitioning results');
disp(['Sorted independent variables = ', mat2str(mbs_part.ind_u)]);
disp(['Permutated dependent variables = ', mat2str(mbs_part.ind_v)]);
disp(['Permutated independent constraints = ', mat2str(mbs_part.hu)]);
disp(['Redundant constraints = ', mat2str(mbs_part.hv)]);

Use

The partitioning is performed by the function mbs_exe_part().

The user specifies the desired options of the partitioning in MBS_part_opt structure. The results are provided in the MBS_part structure.

The function calls successively :

See diagram below for more details :

partioning function diagram
mbs_set_qv
function mbs_set_qv(in mbs_data, in qv)
mbs_set_qu
function mbs_set_qu(in mbs_data, in qu)
count_struct::joint
count joint
number of joints
Definition: mbs_get_data.m:642
mbs_exe_part
function mbs_exe_part(in mymbs_data, in options)
executes the Coordinate Partitionning module.
mbs_get_joint_id
function mbs_get_joint_id(in mbs_info, in varargin)
MBS_dirdyn::opt
MBS_dirdyn opt
MBS_dirdyn_opt structure containing the direct dynamics options.
Definition: mbs_new_dirdyn.m:68
count_struct::driven
count driven
Definition: mbs_get_data.m:644