Thelen2003Muscle: printCurveToCSVFile

Provide easy-to-use, extensible software for modeling, simulating, controlling, and analyzing the neuromusculoskeletal system.
POST REPLY
User avatar
Xiao Hu
Posts: 21
Joined: Fri Jun 26, 2009 9:25 am

Thelen2003Muscle: printCurveToCSVFile

Post by Xiao Hu » Mon Sep 07, 2015 6:53 am

Hi,

I am trying to use printCurveToCSVFile method in Thelen2003Muscle to see how the tendon force-length curve looks like after I change tendon parameters. I am scripting in Matlab, and so far cannot get it to work. I think I did not correctly provide the CurveType argument, which requires an Enumerator. Below is the way I did and the the error message I received.

thelenMuscle.printCurveToCSVFile('TendonForceLength', 'D:\SimulateExpOSim\TestMatlabScript\test.csv')
??? No method 'printCurveToCSVFile' with matching signature found for class 'org.opensim.modeling.Thelen2003Muscle'.

How to provide enumerator argument to method "printCurveToCSVFile" in Matlab?

Thanks!

User avatar
jimmy d
Posts: 1375
Joined: Thu Oct 04, 2007 11:51 pm

Re: Thelen2003Muscle: printCurveToCSVFile

Post by jimmy d » Tue Sep 15, 2015 9:53 am

Hi,

printCurveToCSVFile will not work through Matlab scripting. The enumerator value can not be generated through java-Matlab. The function was designed for C++ API users and not matlab/python scripting.

This functionality will be built into future versions.

Below is some code (written in Python but similar to Matlab) to get the curve off a Millard-type muscle, which has methods that can be accessed through scripting.

Code: Select all

# Get a handle to the model
myModel = getCurrentModel()
# Plot the Tendon Force Length Curve
myFunction = myMuscle.getTendonForceLengthCurve()
myPlot = createPlotterPanel("Tendon Force Length Curve")
myPlot.setMaxX(1.05)
addFunctionCurve(myPlot,myFunction)

# Plot the Active Force Length Curve and Fiber Force Length Curve
myFunction = myMuscle.getActiveForceLengthCurve()
myPlot = createPlotterPanel("Active Force Length Curve")
myPlot.setMaxX(2)
addFunctionCurve(myPlot,myFunction)
myFunction = myMuscle.getFiberForceLengthCurve()
addFunctionCurve(myPlot,myFunction)

# Plot the Force Velocity Inverse Curve
myFunction = myMuscle.getForceVelocityCurve()
myPlot = createPlotterPanel("Force Velocity Curve")
myPlot.setMinX(-1)
myPlot.setMaxX(1)
addFunctionCurve(myPlot,myFunction)

Cheers,
-james

POST REPLY