Matlab simulation with input torque provided externally

Provide easy-to-use, extensible software for modeling, simulating, controlling, and analyzing the neuromusculoskeletal system.
POST REPLY
User avatar
Elena Bardi
Posts: 11
Joined: Sun May 17, 2020 6:49 am

Matlab simulation with input torque provided externally

Post by Elena Bardi » Wed Feb 10, 2021 8:27 am

Dear all,

I am working on arm26 model, to which I added a coordinate actuator at the elbow joint. I would like to perform forward simulations by controlling the actuator with torque values provided externally. In particular, my goal is to compute torque values with a Simulink model and to provide them to the actuator.

So far I managed to do something similar in a Matlab cycle, by manually setting the model controls at each iteration:

Code: Select all

for time = 0:duration/dt
	mymodel.setControls(state, controls);
	manager = Manager(mymodel);
    	state.setTime(time*dt); 
    	manager.initialize(state);
    	state = manager.integrate(time*dt+dt);
end
Even though it appears to work properly, I am aware of the fact that using this method will invalidate the dynamics of the model, as stated in the API documentation.

Could you please explain to me whether following this approach will invalidate my results? And if yes, why?
Do you have alternative suggestions to do this? I know the traditional way of doing something similar would be by using controllers. However, I am not sure how to provide external torque values to them.

Thank you all!
Elena

Tags:

POST REPLY