isCacheVariableValid Error:

Provide easy-to-use, extensible software for modeling, simulating, controlling, and analyzing the neuromusculoskeletal system.
POST REPLY
User avatar
Musa Audu
Posts: 47
Joined: Mon Nov 24, 2008 11:30 am

isCacheVariableValid Error:

Post by Musa Audu » Mon Sep 18, 2017 12:52 pm

Hi,
I was running an optimization with newly defined muscle actuators that had associated path points and got the following run-time error: "ModelComponent::isCacheVariableValid: ERR- name not found.
for component '' of type GeometryPath". The function isCacheVariableValid is called by the method 'updateGeomtry' of the GeometryPath class. The second argument of that call has the name: "current_display_path". Can anyone kindly point me in the direction on how to assign that name so that I will avoid this error?
Thanks.
Musa

User avatar
Thomas Uchida
Posts: 1789
Joined: Wed May 16, 2012 11:40 am

Re: isCacheVariableValid Error:

Post by Thomas Uchida » Tue Sep 19, 2017 3:29 pm

I suggest looking at how other muscle classes (e.g., Millard2012EquilibriumMuscle) have been implemented to make sure you are satisfying the requirements of the API.

User avatar
Musa Audu
Posts: 47
Joined: Mon Nov 24, 2008 11:30 am

Re: isCacheVariableValid Error:

Post by Musa Audu » Wed Sep 20, 2017 9:59 am

Thanks Tom. I followed your advise and picked one of the model files that came with OpenSim 3.3. I realized the error was arising when I tried to compute moment arms; and with the OpenSim model file also I got the same error! The following is a snippet of the code:

Model osimModel("gait10dof18musc.osim");
State& si = osimModel.initSystem();

const CoordinateSet& coords = osimModel.getCoordinateSet();
numGenCoords = coords.getSize();
for (int i = 0; i < numGenCoords; ++i)
{
coords.setValue(si, 0.0);
coords.setSpeedValue(si, 0.0);
}

const Set<Muscle> &muscleSet = osimModel.getMuscles();
for(int i=0; i< num_controls; ++i)
{
GeometryPath gp = muscleSet.getGeometryPath();
MomentArmSolver mas = MomentArmSolver(osimModel);
for(int j=0; j<numGenCoords; ++j)
momentArm[j] = mas.solve(si, coords[j], gp);
}

The error is triggered by one of the functions in the path pf mas.solve. It takes the form:

Loaded model gait10dof18musc.osim from file gait10dof18musc.osim
ModelComponent::isCacheVariableValid: ERR- name not found.
for component '' of type GeometryPath
Press any key to continue . . .

Any ideas?
Thanks.
Musa

User avatar
Musa Audu
Posts: 47
Joined: Mon Nov 24, 2008 11:30 am

Re: isCacheVariableValid Error:

Post by Musa Audu » Wed Sep 20, 2017 2:04 pm

I solved this problem by replacing 'Muscle' with 'PathActuator'. I don't know why it did not work with muscle though.

POST REPLY