# $Header: /var/cvs/mbdyn/mbdyn/mbdyn-1.0/modules/module-imu/imu,v 1.2 2013/06/06 14:21:31 masarati Exp $

module load: "libmodule-imu";

begin: data;
	integrator: multistep;
end: data;

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

	tolerance: 1e-6;
	max iterations: 10;

	derivatives tolerance: 1e-6;
	derivatives max iterations: 10;
	derivatives coefficient: 1e-12;

	nonlinear solver: newton raphson, modified, 5, keep jacobian;

	method: ms, .6;

	# output: iterations, residual;
end: multistep;

begin: control data;
	structural nodes: 2;
	rigid bodies: 1;
	joints:
		+1	# ground
		+2	# viscoelastic
	;
	forces: 1;
	loadable elements: 1;
	output elements: 1;

	skip initial joint assembly;
end: control data;

set: real wz = 10.;
set: real A = 10.;
set: real W = sqrt(1000.);
set: real K = 1e3;
set: real C = 1e1;
set: real m = 1.;
set: real J = .25e0;

begin: nodes;
	structural: 0, static,
		null,
		eye,
		null,
		null,
		output, no;
	structural: 1, dynamic,
		null,
		eye,
		null,
		0.,0.,wz;
end: nodes;

begin: elements;
	joint: 0, clamp, 0, node, node;

	body: 1, 1, m, null, eye, scale, J;
	joint: 1, spherical hinge,
		0, reference, node, null,
		hinge, reference, node, eye,
		1, reference, node, null,
		hinge, reference, node, eye;
	joint: 2, deformable hinge,
		0, hinge, reference, node, eye,
		1, hinge, reference, node, eye,
		linear viscoelastic generic, diag, K,K,K, diag, C,C,C;
	couple: 1, follower, 1,
		# 0.,0.,1., sine, 0,W,A,forever,0.;
		1.,1.,1., sine, 0,W,A,one,0.;

	user defined: 1, imu,
		1,
		position, 1., 0., 0.,
		orientation, eye,
		output, yes;

	stream output: 1,
                stream name, "IMUOUT",
                create, yes,
                path, "./mbdyn.imu.sock",
		no signal,
                values, 6,
                        drive, element, 1, loadable, string, "wx", direct,
                        drive, element, 1, loadable, string, "wy", direct,
                        drive, element, 1, loadable, string, "wz", direct,
                        drive, element, 1, loadable, string, "ax", direct,
                        drive, element, 1, loadable, string, "ay", direct,
                        drive, element, 1, loadable, string, "az", direct;

end: elements;

