next up previous contents
Next: Execution Up: tutorials Previous: Basic Syntax   Contents

Free Rigid Body

A very simple example is presented: a free rigid body. Consider a free rigid body subject to a dead load. A body in MBDyn is made of three distinct entities:

The first entity is called a node; it is placed somewhere in the global inertial frame, and its position and orientation become degrees of freedom of the problem. The second entity is not called at all, unless strictly necessary. It is automatically generated whenever a ``dynamic node'' is required. It simply makes dynamic degrees of freedom (momentum and momenta moment) available to the simulation. The last entity is called a body; it adds an inertial contribution to the dynamic degrees of freedom of the node. This separation has been introduced to allow the definition of kinematic degrees of freedom regardless of any inertia, and to allow multiple sources of inertia to contribute independently to the dynamic degrees of freedom of one node.

In the present implementation, MBDyn must be informed since the very beginning about the number of entities of each type that it will be required to read. Although such approach introduces an additional checksum on the consistency of the model, it may be very annoying when dealing with very large models, and it will be eliminated in the future. However, for backwards compatibility, the checksum will remain available, and, if present, it will be authoritative.

The input file for our simple example is:

    begin: data;
        problem: initial value; # the default
    end: data;

    begin: initial value;
        initial time: 0.;
        final time: 1.;
        time step: 1.e-3;

        max iterations: 10;
        tolerance: 1.e-6;
    end: initial value;

    begin: control data;
        structural nodes: 1;
        rigid bodies: 1;
        forces: 1;
    end: control data;

    begin: nodes;
        # in zero, with no speed
        structural: 1, dynamic, null, eye, 0.,1.,0., null;
    end: nodes;

    begin: elements;
        body: 1, 1, 1., null, eye;
        force: 1, absolute,
            1, 0.,0.,1., null, const, -9.81;
        /*
         * we have better ways to define gravity, though
         */
    end: elements;
Let's have a look at the problem: we have
        structural: 1, dynamic, null, eye, 0.,1.,0., null;
that is a ``dynamic'' node in ``null'', ``eye'', ``0.,1.,0.'', ``null''; what does it mean? The keyword ``dynamic'' means the node will have dynamic degrees of freedom in excess of the kinematic ones; the first ``null'' means it is placed in 0., 0., 0. with respect to the global inertial frame, the ``eye'' means the rotation matrix that defines its orientation is the identity 3 by 3 matrix, the three number sequence ``0.,1.,0.'' means that an initial velocity of 1 m/s in the Y direction of the global inertial frame is set; the last ``null'' means that the node has 0., 0., 0. angular velocity with respect to the global inertial frame. Notice that the node is first labeled with a ``1''. This is the name of the node.

Then we have a ``body''

        body: 1, 1, 1., null, eye;
which is also labeled ``1'' (the first occurrence) and it is attached to the structural node ``1'' (the second occurrence). It has ``1.'' (i.e. unit) mass, which is located at the origin of the reference frame defined by the node (the ``null'' takes the place of a possible offset) and the inertia matrix at the offset is again the 3 by 3 identity matrix (``eye''). Take a look at the input manual for all the ways a 3 by 3 matrix can be defined.

Finally, we have the force

        force: 1, absolute,
            1, 0.,0.,1., null, const, -9.81;
also labeled as ``1'', which is absolute (i.e. its direction does not change with the orientation of the node), attached to node ``1'' and directed as axis 3 in the reference frame defined by the node. It also has ``null'' arm with respect to the node, and the amplitude is constant and equal to the gravity acceleration (the ``const, '' is optional, as a number is interpreted as a constant by default).

Notice how each statement is terminated by a semicolon ``;'', each argument is separated by a comma ``,'' while the card is separated from its arguments by a colon ``:''. The one-line comments start with a ``#'', while the multiline comments follow the C language style: ``/* ... */''.



Subsections
next up previous contents
Next: Execution Up: tutorials Previous: Basic Syntax   Contents
MBDyn: MultiBody Dynamics Software
Document version:
Last update: Wed Jul 15, 2009
Maintained by mbdyn@aero.polimi.it