AnyOptStudy optimises only the last DesVar

Dear AnyBody,

I am running a relatively straightforward optimization, using AnyOptStudy (if needed, details are below). Currently, I use all the default settings, although I have tried playing around with different Solvers and Tolerances.

When I use only one design variable at the time, it works like a charm for each of them. However, as soon as I add one or more design variables, it doesn’t. At first I though my object function was not good enough, but when I look at the results during the optimization (both in AnyBodyStudy and AnyOptStudy), the optimal search direction seems quite clear.

The oddest thing is, that it seems as if only the last entered design variable is the focus of the optimization. I discoverd this when I started changing the order of the design variables. It is not that other desing variables are completely ignored though. It is just that their change of value are at least a factor 100 lower. Also, most of the time (or all, I’m not sure), they all have the same value.

I tried to keep an eye on the targets of the AnyDesVar’s, and it seems that they are correctly updated before each run of the AnyBodyStudy.

Any idea what is going wrong here?

Kind regards,

Bart Koning

I am using AnyBody version : 6. 0. 4. 4327 (64-bit version), Build : 16344.54480

Short summary of the optimization
(Details below are applied twice, as I have used two force plates)

During the kinematics of the ‘StudyRef’ two different force vectors ‘slide’ over the horizontal plane;
[li] The forceplate CoP vector (for which I reconstructed the CoP-ball myself, so I can use it during kinematics analysis)[/li][li] A second, my own, CoP vector.[/li][/ol]

My aim is to repostition the force plate in the horizontal plane, so that i get the best fit beween the both CoP’s. So the design variables are the X and Y position of the force plate origin (Main.ModelSetup.ForcePlates.Translation.PlateName); which I added in a slightly altered “ForcePlateType4AutoDetection”:

AnyFixedRefFrame Corners ={
AnyVar CoordinateSystemSize= 0.1;
Origin = Main.ModelSetup.ForcePlates.Translation.PlateName;

AnyDesVar FP1x = {
Val = Main.ModelSetup.ForcePlates.Translation.Plate1[0];
Min = -0.5;
Max = 0.5;
AnyDesVar FP1y = {
Val = Main.ModelSetup.ForcePlates.Translation.Plate1[1];
Min = -0.5;
Max = 0.5;

For the Objective I use the total moment that is intruduced around my own CoP, by taking the crossproduct of the global vector bewteen both CoP’s and the global force vector of the forceplate:

AnyOutputFun MomentAroundShoeCoPNorm = {
Val = vnorm(.MomentAroundShoeCoP);
AnyVec3 MomentAroundShoeCoP = cross(vecFP_Shoe,…CoPForcePlate2.Fglobal);
AnyVec3 vecFP_Shoe = {DistanceX,DistanceY,0};
AnyFloat DistanceX = (refFP.Vx-refShoe.Vx)*refFP.OnOff;
AnyFloat DistanceY = (refFP.Vy-refShoe.Vy)*refFP.OnOff;

AnyDesMeasure OBJ = {
Val = MomentAroundShoeCoPNormFP1.Val; //
Type = ObjectiveFun;
AnyOutputFun MomentAroundShoeCoPNormFP1 = {
Val = mean(…StudyRef.EnvironmentModel.compareCoP.ForcePlate1.MomentAroundShoeCoPNorm());

Dear Bart,

We have managed to reproduce this problem, but are not sure whether this is a bug or a normal behaviour yet. It looks that due to the change of order initial guess of the optimization or first iteration directions change a little and the solver finds another local minimum. We have managed to get a better behaviour by varying solver parameters in our test problem and changing optimizer type to the complex one. So one thing would be to try that and the second one (possibly a better start) would be to run a parametric study and plot the objective function surface vs design variables to see how it looks like.

We will keep looking into the problem and let you know when we have something.

Kind regards,

Dear Pavel,

Thank you for your reply.

I already tried using the OptComplexPenalty optimization in the meantime, which works fine. I mainly created the post because I was surprised that the Feasible directions search algorithm did not work properly.

Just for your information, I have plotted the object funtion surface for one of the force plates, along with the result of the Feasible directions search algorithm (in black). As you can see the surface is very smooth and the optimization only finds the local minimum for the last design variable.

Kind regards,

Bart Koning