Using metabolics probe with DeGrooteFregly2016Muscle
- Nicholas Bianco
- Posts: 1041
- Joined: Thu Oct 04, 2012 8:09 pm
Re: Using metabolics probe with DeGrooteFregly2016Muscle
The Muscle class has an Output for the active force-length multiplier (called 'active_force_length_multiplier'). So you can compute it with analyze() just like any other Output.
- Karthick Ganesan
- Posts: 119
- Joined: Thu Oct 10, 2013 12:11 am
Re: Using metabolics probe with DeGrooteFregly2016Muscle
I mean, for example, is it possible to square the fiber power and then minimize it using MocoOutputGoal?I'm not sure what you mean. The output in MocoOutputGoal is included in the integrated cost function.
Thanks.
- Nicholas Bianco
- Posts: 1041
- Joined: Thu Oct 04, 2012 8:09 pm
Re: Using metabolics probe with DeGrooteFregly2016Muscle
Ah yes, the output value is included in the integrand without any modifications. You cannot change the power on the output value currently.
- Ross Miller
- Posts: 375
- Joined: Tue Sep 22, 2009 2:02 pm
Re: Using metabolics probe with DeGrooteFregly2016Muscle
Hi all,
Bumping this thread to ask a question about study.analyze:
Is there a way to use study.analyze to compute and report the joint reaction force(s) in a specified reference frame? Essentially I would like to calculate the output for MocoJointReactionGoal, e.g. knee compressive force (https://opensim-org.github.io/opensim-moco-site/docs/), but want to do it from a specified MocoTrajectory so that I can look at the time series of the knee compressive force.
Something like:
Ross
Bumping this thread to ask a question about study.analyze:
Is there a way to use study.analyze to compute and report the joint reaction force(s) in a specified reference frame? Essentially I would like to calculate the output for MocoJointReactionGoal, e.g. knee compressive force (https://opensim-org.github.io/opensim-moco-site/docs/), but want to do it from a specified MocoTrajectory so that I can look at the time series of the knee compressive force.
Something like:
Code: Select all
outputPaths = StdVectorString();
outputPaths.add('path_to_this_output');
outputTable = study.analyze(soln, outputPaths);
- Pasha van Bijlert
- Posts: 226
- Joined: Sun May 10, 2020 3:15 am
Re: Using metabolics probe with DeGrooteFregly2016Muscle
Hi Ross,
I think we're after the same goal (getting a time series of any given joint reaction force/moment from a MocoTrajectory). I tried the following:
This doesn't work, because the output of a joint reaction force/moment is of the type "SpacialVec", and the analyze tool ignores those outputs. Did you happen to find a way around this?
I think we're after the same goal (getting a time series of any given joint reaction force/moment from a MocoTrajectory). I tried the following:
Code: Select all
JR_paths=StdVectorString();
JR_paths.add('.*reaction_on_parent');
JR_paths.add('.*reaction_on_child');
JR_outputs_table=study.analyze(mocoTrajectory, JR_paths);
JR_outputs=osimTableToStruct(JR_outputs_table);
- Ross Miller
- Posts: 375
- Joined: Tue Sep 22, 2009 2:02 pm
Re: Using metabolics probe with DeGrooteFregly2016Muscle
I have not. In reading over some posts on the main OpenSim forum it looks like the Analyze tool does not support SpatialVec so I think this would have to be addressed in a future version of OpenSim (outside the scope of Moco).
Ross
Ross
- Nicholas Bianco
- Posts: 1041
- Joined: Thu Oct 04, 2012 8:09 pm
Re: Using metabolics probe with DeGrooteFregly2016Muscle
Hey guys,
In Matlab, you should be able to use analyzeSpatialVec() for calculating joint reaction forces like you would use analyze() to calculate scalar quantities.
In Matlab, you should be able to use analyzeSpatialVec() for calculating joint reaction forces like you would use analyze() to calculate scalar quantities.
- Kayla Pariser
- Posts: 17
- Joined: Mon Jul 30, 2018 10:35 am
Re: Using metabolics probe with DeGrooteFregly2016Muscle
Hi,
I was wondering if either of you had figured out this problem? I am now trying to output joint moments from a Moco Trajectory and analyzeSpatialVec() doesn't appear to be an existing function. Is there another function I can use? Thank you for your help.
Kayla
I was wondering if either of you had figured out this problem? I am now trying to output joint moments from a Moco Trajectory and analyzeSpatialVec() doesn't appear to be an existing function. Is there another function I can use? Thank you for your help.
Kayla
- Nicholas Bianco
- Posts: 1041
- Joined: Thu Oct 04, 2012 8:09 pm
Re: Using metabolics probe with DeGrooteFregly2016Muscle
Hi Kayla,
How are you calling analyzeSpatialVec()? To clarify, it is not a function on MocoStudy, but rather a utility function under SimulationUtilities. That means you should call using the 'opensimSimulation' prefix in Matlab:
Hope that helps!
-Nick
How are you calling analyzeSpatialVec()? To clarify, it is not a function on MocoStudy, but rather a utility function under SimulationUtilities. That means you should call using the 'opensimSimulation' prefix in Matlab:
Code: Select all
outputPaths = StdVectorString();
outputPaths.add('/path/to/output');
table = opensimSimulation.analyzeSpatialVec(model, ...
solution.exportToStatesTable(), ...
solution.exportToControlsTable(), ...
outputPaths);
-Nick
- Pasha van Bijlert
- Posts: 226
- Joined: Sun May 10, 2020 3:15 am
Re: Using metabolics probe with DeGrooteFregly2016Muscle
Hi Kayla,
In addition to Nick's code suggestion, I've also posted a code implementation in this thread based on Nick working through this problem with me.
Maybe that helps?
Cheers,
Pasha
In addition to Nick's code suggestion, I've also posted a code implementation in this thread based on Nick working through this problem with me.
Maybe that helps?
Cheers,
Pasha