Home > リソース > MBDynモデル集 > 4. ２重剛体振り子（２）
MBDynモデル集

## 4. ２重剛体振り子（２）

### 入力ファイル

```# double_rigid_pendulum_2.mbd

begin: data;
problem: initial value;
end: data;

begin: initial value;
initial time:   0.;
final time:     5.;
time step:      1.e-3;
max iterations: 10;
tolerance:      1.e-6;
end: initial value;

begin: control data;
structural nodes: 2;
rigid bodies:     2;
joints:           2;
gravity;
end: control data;

# Design Variables

set: real theta1 = pi/6.; # Initial angle of Link1 w.r.t vertical line
set: real theta2 = pi/6.; # Initial angle of Link2 w.r.t Link1

# Reference Labels

# Node Labels

# Body Labels

# Joint Labels

# Reference
null,                        # absolute position
euler, 0., pi/2.-theta1, 0., # absolute orientation
null,                        # absolute velocity
null;                        # absolute angular velocity

reference, Ref_Link1, L, 0., 0.,              # absolute position
reference, Ref_Link1, euler, 0., -theta2, 0., # absolute orientation
reference, Ref_Link1, null,                   # absolute velocity
reference, Ref_Link1, null;                   # absolute angular velocity

begin: nodes;
reference, Ref_Link1, 1./2.*L, 0., 0., # absolute position
reference, Ref_Link1, eye,             # absolute orientation
reference, Ref_Link1, null,            # absolute velocity
reference, Ref_Link1, null;            # absolute angular velocity

reference, Ref_Link2, 1./2.*L, 0., 0., # absolute position
reference, Ref_Link2, eye,             # absolute orientation
reference, Ref_Link2, null,            # absolute velocity
reference, Ref_Link2, null;            # absolute angular velocity

end: nodes;

begin: elements;
M,                                # mass
null,                             # relative center of mass
diag, 0., M*L^2./12., M*L^2./12.; # inertia matrix

M,                                # mass
null,                             # relative center of mass
diag, 0., M*L^2./12., M*L^2./12.; # inertia matrix

revolute pin,
reference, Ref_Link1, null,                                # relative offset
hinge, reference, Ref_Link1, 1, 1., 0., 0., 3, 0., 1., 0., # relative axis orientation
reference, Ref_Link1, null,                                # absolute pin position
hinge, reference, Ref_Link1, 1, 1., 0., 0., 3, 0., 1., 0.; # absolute pin orientation