How to add perturbation forces to FD predictive simulation

Provide easy-to-use, extensible software for modeling, simulating, controlling, and analyzing the neuromusculoskeletal system.
POST REPLY
User avatar
Jakob Welner
Posts: 23
Joined: Mon Dec 15, 2014 3:24 pm

How to add perturbation forces to FD predictive simulation

Post by Jakob Welner » Thu Nov 12, 2015 6:19 am

Hi,

I am trying to add a random force at a random interval in the sagital plane.
I am using the PredictiveSim code by Dorn et al. 2015 and wanting to include perturbations to the simulation in the hopes of achieving a more stable controller. I have never done this before so I'm trying to get the very basics straight.

I have looked around for documentations or examples but there appears to be many approaches which I cannot seem to separate so it would be much appreciated with a few hint to the direction that I should go.

I have stumbled upon something called Perturb which I cannot find in the documentation and it may have been outdated and replaced by Induced Acceleration Analysis? However I am not sure this is the right way when using a predictive controller? I have searched around for 'perturbation' to try and find any explenation of how it is usually done and concluded that it is probably best solved by adding an actuator to my model as an external load, maybe using a CoordinateActuator and updating it in my simulation loop similar to the rest of the actuators. Also using PrescribedForce seems like it could be a solution.

Does this make sense or could another approach/actuator work better? - is there a 'normal way' and do there exist example files for something similar?

Cheers and thanks in advance.
- Jakob Welner

User avatar
Jakob Welner
Posts: 23
Joined: Mon Dec 15, 2014 3:24 pm

Re: How to add perturbation forces to FD predictive simulati

Post by Jakob Welner » Thu Nov 12, 2015 10:31 am

I think I've solved it now.

I ended up using a PrescribedForce as described in the Tug of War example.
I generate the perturbation forces randomly for each run, using a PiecewiseLinearFunction to update the PrescribedForce parameters before simulation.
This seem to work.

Only issue is that I am not able to use the PiecewiseConstantFunction because my compiler cannot find it.
I can use the PiecewiseLinearFunction and I see that it points to the header file located in my OpenSim install directory where the PiecewiseConstantFunction.h is also located, but it insists on not recognizing the PiecewiseConstantFunction . Am I the only one with this issue?
I'm using OpenSim 3.3 on Windows with VS2015

POST REPLY