Question about Forward Dynamics simulation

Provide easy-to-use, extensible software for modeling, simulating, controlling, and analyzing the neuromusculoskeletal system.
POST REPLY
User avatar
GENG CHEN
Posts: 1
Joined: Wed Dec 06, 2023 10:07 pm

Question about Forward Dynamics simulation

Post by GENG CHEN » Tue Oct 01, 2024 7:49 pm

It is the beginner question. When configuring the XML file used in forward dynamics, can we set the degree of muscle activation related to the joint angle? For example, the muscle is fully activated when the joint angle reaches 90. When the joint angle is 0, the muscle is not activated. Currently, I find we can only set the activation level point-by-point. Thanks in advance.

Code: Select all

			<ControlLinear name="ECRL">
				<is_model_control>true</is_model_control>
				<extrapolate>true</extrapolate>
				<default_min>0.02</default_min>
				<default_max>1</default_max>
				<filter_on>false</filter_on>
				<use_steps>false</use_steps>
				<x_nodes>
					<ControlLinearNode>
						<t>0</t>
						<value>0.40611812899412514</value>
					</ControlLinearNode>
					<ControlLinearNode>
						<t>0.0083333299999999999</t>
						<value>0.63439237487184641</value>
					</ControlLinearNode>
				</x_nodes>
				<min_nodes/>
				<max_nodes/>
				<kp>100</kp>
				<kv>20</kv>
			</ControlLinear>

Tags:

User avatar
Carmichael Ong
Posts: 401
Joined: Fri Feb 24, 2012 11:50 am

Re: Question about Forward Dynamics simulation

Post by Carmichael Ong » Mon Oct 07, 2024 12:11 pm

This isn't available out of the box to my knowledge. The closest example I can think of is the reflex controller from the example Simulation-Based Design to Prevent Ankle Injuries.

With some code, you could create a custom controller in a couple of ways:
- In C++, make a new Controller that uses joint angle from the state as an input to computing the controller value.
- In a scripting (Python or Matlab) API, create a function that reads in the state and calculates the correct controller value. Then, update a controller (such as through a PrescribedController, example of use) and integrate the system for a small time step (such as through the Manager class), and repeat this in a loop.

POST REPLY