how to calculate muscle force
how to calculate muscle force
hello all,
I am using MocoInverse for optimization , i want to optimize spring force for lifting task with the cost function that can minimize muscle force and joint reaction force on L5S1 joint. Can anyone help with this , i am new to MOCO. Also i am unable to find any function have can directly give muscle force file. please suggest how to find muscle force in MOCO.
I am using MocoInverse for optimization , i want to optimize spring force for lifting task with the cost function that can minimize muscle force and joint reaction force on L5S1 joint. Can anyone help with this , i am new to MOCO. Also i am unable to find any function have can directly give muscle force file. please suggest how to find muscle force in MOCO.
- Nicholas Bianco
- Posts: 1043
- Joined: Thu Oct 04, 2012 8:09 pm
Re: how to calculate muscle force
Hi Neha,
With MocoInverse, you can set the "output_paths" property and it will calculate any model quantities specified at those Output paths and include them in a table as part of the MocoInverseSolution.
Best,
Nick
With MocoInverse, you can set the "output_paths" property and it will calculate any model quantities specified at those Output paths and include them in a table as part of the MocoInverseSolution.
Best,
Nick
Re: how to calculate muscle force
Thank you for reply, but i am unable to find matlab code for getting muscle force and this output path property is not described that well, if you could give me any reference , it would be great help.
regards
neha sahu
regards
neha sahu
- Nicholas Bianco
- Posts: 1043
- Joined: Thu Oct 04, 2012 8:09 pm
Re: how to calculate muscle force
Hi Neha,
Please refer to my recent post on this thread for more guidance: viewtopicPhpbb.php?f=1815&t=18886&p=51523&start=0&view=.
Best,
Nick
Please refer to my recent post on this thread for more guidance: viewtopicPhpbb.php?f=1815&t=18886&p=51523&start=0&view=.
Best,
Nick
Re: how to calculate muscle force
Thank you for your reply , i will try that. I am facing issue in mocoinverse this error , my matlab crashed everytime. please suggest what to do.
- Attachments
-
- moco.png (42.56 KiB) Viewed 469 times
Re: how to calculate muscle force
Also when i am using analyze tool I am facing issue.
a. when using analysis tool muscle analysis, matlab crash.
b. when using analysis tool , I get active force , fibre force , how to I get muscle force directly , and how I can calculate muscle force with these results.
a. when using analysis tool muscle analysis, matlab crash.
b. when using analysis tool , I get active force , fibre force , how to I get muscle force directly , and how I can calculate muscle force with these results.
- Attachments
-
- when run this error shows.
- other analyze.png (99.77 KiB) Viewed 459 times
-
- when run this matlab crash
- analyzetool.png (80.41 KiB) Viewed 459 times
- Nicholas Bianco
- Posts: 1043
- Joined: Thu Oct 04, 2012 8:09 pm
Re: how to calculate muscle force
Hi Neha,
Your problem appears to be infeasible (i.e., the problem cannot enforce the dynamics constraints in the direct collocation problem). I'm not sure about the MUMPS memory issue, but it might be related to Ipopt entering "restoration mode" in order to address the infeasibility issue.
I would recommend:
Best,
Nick
Your problem appears to be infeasible (i.e., the problem cannot enforce the dynamics constraints in the direct collocation problem). I'm not sure about the MUMPS memory issue, but it might be related to Ipopt entering "restoration mode" in order to address the infeasibility issue.
I would recommend:
- Simplify the model and/or problem (e.g., remove muscles, remove external loads, disable some cost function terms, etc).
- Add strong CoordinateActuators at every degree-of-freedom (see ModOpAddReserves).
- Try accessing the underlying MocoStudy via initialize() (see snippet below), which will enable debugging options.
- Once you get a problem to converge, start adding complexity back to your problem/model until you get back to the problem you want to solve.
Code: Select all
inverse = MocoInverse();
% your inverse problem configuration here
inverseSolution = inverse.solve();
solution = inverse.getMocoSolution();
% If your problem failed, you can still access it for debugging purposes using "unseal".
solutionUnsealed = solution.unseal();
% Using analyze() to get muscle forces.
outputPaths = StdVectorString();
outputPaths.add('/forceset/vaslat_r|tendon_force');
outputs = study.analyze(solutionUnsealed , outputPaths);
Nick
Re: how to calculate muscle force
Thank you for your reply. I will try to solve this , if get any issue , i will post that.
Re: how to calculate muscle force
Hello sir, i have reduce convergence torelance and increase mesh size then i am able to run analyze tool for Muscle analysis, so the result it is giving is active force , passive fibre force and fibre force , how i supposed to calculate total muscle force.
Also now i need to add spring parameter as design parameter , for that i am using .osim model that have pointtopoint spring attached to it, using Moco Bound to optimize the spring stiffness and rest length. Its not working. can you suggest something.
Also i want to use Min joint reaction force as the cost function with min muscle activation , if i am using that Matlab crash, i this thats to heavy.
can you suggest something please.
Also now i need to add spring parameter as design parameter , for that i am using .osim model that have pointtopoint spring attached to it, using Moco Bound to optimize the spring stiffness and rest length. Its not working. can you suggest something.
Also i want to use Min joint reaction force as the cost function with min muscle activation , if i am using that Matlab crash, i this thats to heavy.
can you suggest something please.
Re: how to calculate muscle force
Error using bounded
Java exception occurred:
java.lang.RuntimeException: casVector should be 1-dimensional, but has size 0 x 0.
Thrown at MocoCasOCProblem.h:108 in convertToSimTKVector().
at org.opensim.modeling.opensimMocoJNI.MocoStudy_solve(Native Method)
at org.opensim.modeling.MocoStudy.solve(MocoStudy.java:282)
............. i am getting this error while using mocobound for spring stiffness.
how to resolve this.
Java exception occurred:
java.lang.RuntimeException: casVector should be 1-dimensional, but has size 0 x 0.
Thrown at MocoCasOCProblem.h:108 in convertToSimTKVector().
at org.opensim.modeling.opensimMocoJNI.MocoStudy_solve(Native Method)
at org.opensim.modeling.MocoStudy.solve(MocoStudy.java:282)
............. i am getting this error while using mocobound for spring stiffness.
how to resolve this.