I’ve collcected a time series of shoulder and elbow joint angles and I would like to know the muscle activities during the arm movement.

I started with Standingmodel. It shows the muscle activities for static postures but I could not make it move.

Then I tried to use Freeposturemove. By default, there is no muslce added to this model but it seems I can add the muscles since it says:

// Selecting the include file below results in a body model with simple
// constant stength muscles. They are adequate for many purposes and have the
// advantage of not requiring calibration #include …\Body\AAUHuman\BodyModels\FullBodyModel\BodyModel.any"

However when I ran the default model without any change except for the above line, I got the error message:

ERROR(SCR.EXP10) : C:/D…s/A…r/A…a/A…y/A…x/A…3/Body/A…n/Arm/Muscle.any : ‘InitWrapPosVectors’ : Expression evaluation failed at moment ‘Const’ :
C:\Documents and Settings\Administrator\Application Data\AnyBody Technology\AnyBody.5.x.x\AMMRV1.3\Application\Examples\FreePostureMove\InitialPositionValues.any(43) : GlenohumeralAbduction : argument will not be ready for evaluation until moment ‘DesignVar’

Anyone know what happened here?

Since I am trying to see the muscle activities with known arm movement, is this model a good start for me?

Thank you in advance for any suggestions and helps.

It is the right model for you task, you did everything correctly. The problem is that there is a bug in this model. Sorry for that. We will try to fix it in a future release, and for the moment this is what you can do:

In the file InitialPositionValues.any find the following lines:
//right humerus
AnyVector Glenohumeral= …JointPos.GHFunctionRight(Main.Study.tStart);
AnyVar GlenohumeralAbduction=(180/pi)*Glenohumeral[0];
AnyVar GlenohumeralFlexion=(180/pi)*Glenohumeral[1];
AnyVar GlenohumeralExternalRotation=(180/pi)*Glenohumeral[2];

and replace it by:
//right humerus
AnyVector Glenohumeral= …JointPos.GHFunctionRight(Main.Study.tStart);
AnyVar GlenohumeralAbduction= 0;
AnyVar GlenohumeralFlexion= 0;
AnyVar GlenohumeralExternalRotation=(180/pi)*Glenohumeral[2];

Note that the 0 for flexion and abduction can be any value you want, it just has to be a constant number. Choose it so that it gives you the correct initial position.

Here are some of my follwoing questions, (Sorry for my numerous questions)

Q1: The joint angle data I have now is an excel file looking like this:
First column: Time 0.01 sec to 15.00 sec (1500 frames)
Second column: Arm abuduction angles at each time frame
Thrid column: Arm flexion angles at each time frame
...
...
Is there any way that I can import my data into FreePostureMove model so that I don't need to input them by hand?

Q2: In Mannequin.any, all 3 time series are from 0 to 1. Is the unit of the time series second? or they are normalized by the total time length?

Q3: For the interpolation function, what is interpolation frequency? Since my data sampled at 100Hz, do I still need to do the interpolation?

Q4: What the Euler angles sequencs for the rotation matrix of the upper arm?

Q5: Is it possible to add a 3 kg load in right hand in Freeposturemove model?

Q1)
Yes you can import the data automatically. Use the AnyInputFile class, it can read text files (.csv or .txt) like yours with the data stored in column. This class returns the time vector T and the data matrix Data. Then for the T and Data member of the AnyKinEqInterpolDriver you can refer directly to the ones of the AnyInputFile. Please read the reference manual for further details.

Q2)
Unit is second. It goes from 0 to 1 because in the Study start time is 0 and end time is 1 second. This you can modify to fit your data.

Q3)
You need the interpolation no matter what is the frequency sample of your data. This is simply because there will always be time steps in the Study that fall between two samples of the recorded data, and you need the interpolation to get a value there.

Q4)
Look in the file Body/AAUHuman/Arm/interface. You will see that for each joint there is a rotational measure defined with the axis sequence. GlenoHumeral joint sequence is XZY.

Q5)
It is possible, you can use an AnyForce3D. Set the application point to be the hand and the force vector to be {0,-30,0} in global.

I appreciate your detailed answers. Now I can import the measured joint angle to the Freeposturemove model and make the mannequin move. Thanks again.

However, I am still confused on AnyForce3D and come up with the follwing questions. I am a heavy Matlab user but rarely use object-oriented language, so I know some of my following questions could look too simple...

Q1: In which file should I put AnyForce3D (like Main.any, mannequin.any, etc..)?

Q2: In which folder should I put AnyForce3D in a file?

Q3: When holding a 3kg load in hand, the forces exerted on hand do not always equal to 30N downward due to the acceleration. I did measure the 3D force at each time instant (100Hz for 15sec). Is it possible to import the 3D force at each time constant?

Q4: If the force is with respect to the global coordinat syste, would referecen be EnvironmentModel.GlobalRef?

Q5: How to get the hand position at each time instant?

Q6: If I copy the "Anyfolder load" code in StandingModel to Freeposturemove, will that work for my case?

Q7: Is there any example regarding Anyforce3D that I can refer to?

In addition, After I ran inverse dynamics analysis, I got an error message saying "solver aborted due to sigular KKT matrx" at frame #6 out 150. The human movement to be analyzed is basically a free movement of right upper arm for 15 second. Since I don't know how to import external load, the current model doesn't include any external load. Does this mean the solver cannot find a feasible solution to reach the equilibrium of forces and moments?

1 and 2)
You can put it anywhere in the code. As long as you refer correctly to point of application it will work. However the keep the logic of the repository, I would choose to place it in the environment file because this is where all the external elements interacting with the body are defined.

You are right. Still, for slow movements the constant downward force is a reasonable aproximation.
If you have the force recorded you can use an interpolation function (AnyFunInterpol). You still apply it via the AnyForce3D but this time the force vector will come from the interpolation function (F=forcefunction(time)).
You can also define a segment of mass 3kg in the code and attach it to the hand segment.

Yes, the global coordinate system is EnvironmentModel.GlobalRef.

If you find the hand segment in the model, it has a menber called “r”. This is the position of the segment in the global coordinate system for each time step.

you can do that, yes. You have to take the folder in the Mannequin file, but also the AnyForce3D defined in each of the driver files.

Those mentioned in 6).

Last question:
Yes it means the solver could not find a solution. It is a quite general error and it can have many causes. You can start with simplifying the model, i mean if you don’t care about the legs you can remove them from the BodyPartSetup, etc.
Writte again if you can’t fix the solver error.