# driving a cos driver

hello everyBody,

We’re a group of italian students trying to make a model of the human
upper limb. In the elbow, we’re trying to drive a two-axis universal joint
with a Fourier-Cos driver.The motion should be around just one axis with:
theta(t) = (A/w^2)(1-cos(wt))

or, in terms of angular acceleration:

alpha(t) = Acos(wt)

where alpha(t) = d2(theta(t))/dt^2 and A,w are constants.

does anyone know how to write this in AnyScript?
thanks

Raphael Bartalesi

Dear Raphael,

I’ve made a simple example which shows how to write this function in an
AnyScript with use of a Fourier driver of the type cosinus.
I hope this makes things clear.

Greetings, Mark

Mark de Zee, Ph.D., Research Assistant Professor
Aalborg University, Institute of Mechanical Engineering
Pontoppidanstraede 101, Aalborg East,9220 Denmark
Phone: +4596359317, Fax: +4598151675
E-mail: mdz@ime.auc.dk
The AnyBody Group: http://anybody.auc.dk

rph@inventati.org wrote:

>hello everyBody,
>
>We’re a group of italian students trying to make a model of the human
>upper limb. In the elbow, we’re trying to drive a two-axis universal joint
>with a Fourier-Cos driver.The motion should be around just one axis with:
>theta(t) = (A/w^2)(1-cos(wt))
>
>or, in terms of angular acceleration:
>
>alpha(t) = Acos(wt)
>
>where alpha(t) = d2(theta(t))/dt^2 and A,w are constants.
>
>does anyone know how to write this in AnyScript?
>thanks
>
>Raphael Bartalesi
>
>
>
>
>To unsubscribe from this group, send an email to:
>anyscript-unsubscribe@yahoogroups.com
>
>
>
>Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>
>
>
>
>

</td></tr></table>
Main = {

// The actual body model goes in this folder
AnyFolder MyModel = {

`````` // Global Reference Frame
AnyFixedRefFrame GlobalRef = {
AnyRefNode ElbowNode = {sRel = {0,0,0};};
AnyDrawRefFrame DrwGlobalRef = {
ScaleXYZ = {0.2,0.2,0.2};
RGB = {1, 0, 0};
};
};  // Global reference frame

// Definition of a simple segment
AnySeg Arm = {
Mass = 2;
Jii = {0.1,0.01,0.1};
AnyRefNode ElbowNode = {sRel = {0,0.5,0};};
AnyDrawSeg DrwSeg = {};
};

AnyUniversalJoint Elbow = {
Axis1 = x;
Axis2 = z;
AnyRefNode &GroundNode = .GlobalRef.ElbowNode;
AnyRefNode &ArmNode = .Arm.ElbowNode;
};

/*
In the following driver I will drive the z-axis of the elbow joint with the
``````

following function:
theta(t) = (a/w2)(1-cos(wt));
= a/w2 - (a/w2)cos(wt);
The x-axis will be kept contstant. You can change this constant position for
example like this:
A = {{0.3*pi,0},{a/(w^2),-a/(w^2)}};
Within in the driver I defined two variables a and w, which I gave an
arbitrary value.

`````` w = 2*pi*Freq, therefore Freq is defined as w/(2*pi).In this example that
``````

will result in
a frequency of 1 Hz.

`````` Be aware that in this example I set the reaction type on 1, because I didn't
``````

define
any muscles. In your case it must be set to 0 (the muscles will deliver the
necessary force).
/
AnyKinEqFourierDriver ElbowMovement = {
AnyUniversalJoint &Jnt = .Elbow;
Type = Cos;
AnyVar a = pi;
AnyVar w = 2
pi;
Freq = w/(2*pi);
A = {{0,0},{a/(w^2),-a/(w^2)}};
B = {{0,0},{0,0}};
Reaction.Type = {1.0,1.0};
};

};

// The study: Operations to be performed on the model
AnyBodyStudy MyStudy = {
AnyFolder &Model = .MyModel;
RecruitmentSolver = MinMaxSimplex;
Gravity = {0.0, -9.81, 0.0};
tEnd = 10;
nStep = 500;
};

}; // Main