# $Header: /var/cvs/mbdyn/mbdyn/mbdyn-web/documentation/examples/chain,v 1.1 2008/11/05 20:52:04 masarati Exp $ # # MBDyn (C) is a multibody analysis code. # http://www.mbdyn.org # # Copyright (C) 1996-2008 # # Pierangelo Masarati # Paolo Mantegazza # # Dipartimento di Ingegneria Aerospaziale - Politecnico di Milano # via La Masa, 34 - 20156 Milano, Italy # http://www.aero.polimi.it # # Changing this copyright notice is forbidden. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation (version 2 of the License). # # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # # Title: four link chain, falling after 1s # Authors: Pierangelo Masarati # Sylvain Mazet # Date: July 29, 2008 begin: data; problem: initial value; end: data; begin: initial value; initial time: 0.; final time: 10.; time step: 1e-3; tolerance: 1e-6; max iterations: 10; derivatives tolerance: 1e-6; derivatives max iterations: 10; derivatives coefficient: 1e-5; nonlinear solver: newton raphson, modified, 5; # method: ms, .6; # output: iterations; end: initial value; begin: control data; structural nodes: +1 # ground +4 ; rigid bodies: +4 ; joints: +1 # ground +4 # hinges +1 # grasp +4 # damping ; gravity; end: control data; set: integer GROUND = 1; set: integer POINT_0 = 1000; set: integer POINT_1 = 1100; set: integer POINT_2 = 1200; set: integer POINT_3 = 1300; set: integer POINT_4 = 1400; set: integer BODY_1 = 2100; set: integer BODY_2 = 2200; set: integer BODY_3 = 2300; set: integer BODY_4 = 2400; set: real R = 1.; set: real M = 1.; set: real DAMPING = 1e-1; set: real J_x = 1.; set: real J_y = 1.e-1; set: real J_z = 1.e-2; set: real X_POINT_0 = R; set: real Z_POINT_0 = 0.; set: real X_POINT_1 = R/sqrt(2.); set: real Z_POINT_1 = -R/sqrt(2.); set: real X_POINT_2 = 0.; set: real Z_POINT_2 = -R; set: real X_POINT_3 = -R/sqrt(2.); set: real Z_POINT_3 = -R/sqrt(2.); set: real X_POINT_4 = -R; set: real Z_POINT_4 = 0.; /* POINT_4 POINT_0 * -o-------------------------------------o- * \ / * \ BODY_4 / BODY_1 * \ / * \ / * o POINT_3 o POINT_1 * \ / * \ BODY_3 / BODY_2 * \ / * o POINT_2 */ reference: POINT_0, reference, global, X_POINT_0, 0., Z_POINT_0, reference, global, eye, reference, global, null, reference, global, null; reference: POINT_1, reference, global, X_POINT_1, 0., Z_POINT_1, reference, global, eye, reference, global, null, reference, global, null; reference: POINT_2, reference, global, X_POINT_2, 0., Z_POINT_2, reference, global, eye, reference, global, null, reference, global, null; reference: POINT_3, reference, global, X_POINT_3, 0., Z_POINT_3, reference, global, eye, reference, global, null, reference, global, null; reference: POINT_4, reference, global, X_POINT_4, 0., Z_POINT_4, reference, global, eye, reference, global, null, reference, global, null; reference: BODY_1, reference, global, (X_POINT_0 + X_POINT_1)/2., 0., (Z_POINT_0 + Z_POINT_1)/2., reference, global, 2, 0., 1., 0., 1, X_POINT_0 - X_POINT_1, 0., Z_POINT_0 - Z_POINT_1, reference, global, null, reference, global, null; reference: BODY_2, reference, global, (X_POINT_1 + X_POINT_2)/2., 0., (Z_POINT_1 + Z_POINT_2)/2., reference, global, 2, 0., 1., 0., 1, X_POINT_1 - X_POINT_2, 0., Z_POINT_1 - Z_POINT_2, reference, global, null, reference, global, null; reference: BODY_3, reference, global, (X_POINT_2 + X_POINT_3)/2., 0., (Z_POINT_2 + Z_POINT_3)/2., reference, global, 2, 0., 1., 0., 1, X_POINT_2 - X_POINT_3, 0., Z_POINT_2 - Z_POINT_3, reference, global, null, reference, global, null; reference: BODY_4, reference, global, (X_POINT_3 + X_POINT_4)/2., 0., (Z_POINT_3 + Z_POINT_4)/2., reference, global, 2, 0., 1., 0., 1, X_POINT_3 - X_POINT_4, 0., Z_POINT_3 - Z_POINT_4, reference, global, null, reference, global, null; begin: nodes; structural: GROUND, static, reference, global, null, reference, global, eye, reference, global, null, reference, global, null; structural: BODY_1, dynamic, reference, BODY_1, null, reference, BODY_1, eye, reference, BODY_1, null, reference, BODY_1, null; structural: BODY_2, dynamic, reference, BODY_2, null, reference, BODY_2, eye, reference, BODY_2, null, reference, BODY_2, null; structural: BODY_3, dynamic, reference, BODY_3, null, reference, BODY_3, eye, reference, BODY_3, null, reference, BODY_3, null; structural: BODY_4, dynamic, reference, BODY_4, null, reference, BODY_4, eye, reference, BODY_4, null, reference, BODY_4, null; end: nodes; begin: elements; joint: GROUND, clamp, GROUND, node, node; body: BODY_1, BODY_1, # mass of the link M, null, diag, J_x, J_y, J_z; body: BODY_2, BODY_2, # mass of the link M, null, diag, J_x, J_y, J_z; body: BODY_3, BODY_3, # mass of the link M, null, diag, J_x, J_y, J_z; body: BODY_4, BODY_4, condense, 2, # mass of the link M, null, diag, J_x, J_y, J_z, # extra mass at the free end of the link 20., reference, POINT_4, null, null; # hinges; spherical and revolute are equivalent, # since the problem is plane joint: POINT_0, spherical hinge, GROUND, position, reference, POINT_0, null, orientation, reference, BODY_1, eye, BODY_1, position, reference, POINT_0, null, orientation, reference, BODY_1, eye; joint: POINT_1, spherical hinge, BODY_1, position, reference, POINT_1, null, orientation, reference, BODY_2, eye, BODY_2, position, reference, POINT_1, null, orientation, reference, BODY_2, eye; joint: POINT_2, spherical hinge, BODY_2, position, reference, POINT_2, null, orientation, reference, BODY_3, eye, BODY_3, position, reference, POINT_2, null, orientation, reference, BODY_3, eye; joint: POINT_3, spherical hinge, BODY_3, position, reference, POINT_3, null, orientation, reference, BODY_4, eye, BODY_4, position, reference, POINT_3, null, orientation, reference, BODY_4, eye; # add damping joint: POINT_0 + 1, deformable hinge, GROUND, orientation, reference, BODY_1, eye, BODY_1, orientation, reference, BODY_1, eye, linear viscous isotropic, DAMPING; joint: POINT_1 + 1, deformable hinge, BODY_1, orientation, reference, BODY_2, eye, BODY_2, orientation, reference, BODY_2, eye, linear viscous isotropic, DAMPING; joint: POINT_2 + 1, deformable hinge, BODY_2, orientation, reference, BODY_3, eye, BODY_3, orientation, reference, BODY_3, eye, linear viscous isotropic, DAMPING; joint: POINT_3 + 1, deformable hinge, BODY_3, orientation, reference, BODY_4, eye, BODY_4, orientation, reference, BODY_4, eye, linear viscous isotropic, DAMPING; gravity: 0., 0., -1., 9.81; # release after 1 second driven: GROUND + 1, string, "Time < 1.", joint: GROUND + 1, inline, GROUND, reference, POINT_4, null, reference, global, 3, 0., 1., 0., 1, 1., 0., 0., BODY_4, offset, reference, POINT_4, null; end: elements;