Adding probes and actuators in Matlab.

Provide easy-to-use, extensible software for modeling, simulating, controlling, and analyzing the neuromusculoskeletal system.
POST REPLY
User avatar
RAHUL GHARATE
Posts: 84
Joined: Thu Jun 13, 2019 11:43 pm

Adding probes and actuators in Matlab.

Post by RAHUL GHARATE » Thu Jul 18, 2019 11:03 pm

I want to provide exosuit to the model.I have done RRA -process. I need to provide actuators and probes to the model. I have referred developer guide. But which specific program I should select. I have tried to put these programs in a scripting shell window but it shows errors. Please give me a specific program or suggest another method to provide actuator and probes to the model.

Tags:

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

Re: Adding probes and actuators in Matlab.

Post by jimmy d » Fri Jul 19, 2019 6:33 am

You can read the Wiki description for probes here, and the API documentation for Probe is here, if you expand the inheritance diagram at the top of the API documentation page you will be able to see all the different types of probes you can use. If you want to add a probe in Matlab, you can do something like what is written below. You will have to update all the parameters of the probe to your choosing by using the API documentation to find all the methods you can adjust for a class, the below example uses the Umberger2010MuscleMetabolicsProbe()

Code: Select all

import org.opensim.modeling.*

model = Model('gait2354_simbody.osim');

% Instantiate a Metabolics Probe
metabolicsProbe = Umberger2010MuscleMetabolicsProbe();

% Update the probes parameters
metabolicsProbe.upd_activation_maintenance_rate_on(1)

% Add the probe to the model
model.addProbe(metabolicsProbe)
You can refer to the Simulation-Based Design to Reduce Metabolic Cost example to see how to use probes in your research. I would suggest opening the model in that example in a text editor and seeing how the probes are stored in the model. Even if you have difficulty adding components through Matlab or Python, you can always edit the model files directly-- copy, pasting, and editing models in a text editor.

The API documentation for actuators is here. Again, you can expand the inheritance diagram at the top of the page to see the list of actuator types that you could use in your model. In the below example, we instantiate a Coordinate Actuator and add it to the model.

Code: Select all

import org.opensim.modeling.*

model = Model('gait2354_simbody.osim');

coordinateName = model.getCoordinateSet().get('ankle_angle_r').getName();

actuator = CoordinateActuator();

% Update the probes parameters
actuator.set_coordinate(coordinateName);
actuator.setOptimalForce(1);

% Add the probe to the model
model.addForce(actuator)
I also suggest thouroughly going through the scripting section of the wiki documentation and having a look at the example Matlab and Python scripts in your OpenSim distribution.

Goodluck,
-j

User avatar
RAHUL GHARATE
Posts: 84
Joined: Thu Jun 13, 2019 11:43 pm

Re: Adding probes and actuators in Matlab.

Post by RAHUL GHARATE » Sun Jul 21, 2019 3:32 am

If we add actuator to the model.If actuator acts along the femur and foot segment.But actuator perform it's function on which phase of the gait cycle.

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

Re: Adding probes and actuators in Matlab.

Post by jimmy d » Sun Jul 21, 2019 7:49 am

You can either do an inverse analysis where controls are estimated or you can provide controls to the actuator by specifying the control signal. You will have to figure out when the actuator is used and decide what you want to do about that. No one can tell you because it is completely up to your particular model, actuator, motion, controller.

User avatar
RAHUL GHARATE
Posts: 84
Joined: Thu Jun 13, 2019 11:43 pm

Re: Adding probes and actuators in Matlab.

Post by RAHUL GHARATE » Mon Jul 22, 2019 8:56 am

HOW TO DO INVERSE ANALYSIS?
HOW TO SPECIFY CONTROL SIGNAL TO THE ACTUATOR?

THERE ARE THREE MUSCLES ON RIGHT LEGS - soleur-r, Gastroc-r, Tibia posterior -r .

If I provide an actuator to the soleus -r muscle then how I confirm it gives me the good result as compared to the other 2 muscles of legs. it is by calculating and comparing metabolic rate or another method.

Please tell me I need it for hemiparetic gait design.

User avatar
RAHUL GHARATE
Posts: 84
Joined: Thu Jun 13, 2019 11:43 pm

Re: Adding probes and actuators in Matlab.

Post by RAHUL GHARATE » Tue Jul 23, 2019 1:27 am

How to do inverse analysis?
How to provide controllers to the control signals?

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

Re: Adding probes and actuators in Matlab.

Post by jimmy d » Fri Jul 26, 2019 8:33 am

How to do inverse analysis?
See the users guide. Particularly Inverse Dynamics, Static Optimization, and CMC.
How to provide controllers to the control signals?
In this example you create and use an active orthotic.

POST REPLY