Fitness calculation

SCONE is a software tool for predictive simulations of biomechanical movement. It uses OpenSim for modeling and simulation, and performs optimization using various control strategies, including feed-forward control, proprioceptic feedback control, and bal
POST REPLY
User avatar
Anne Koelewijn
Posts: 14
Joined: Tue Aug 26, 2014 6:42 am

Fitness calculation

Post by Anne Koelewijn » Thu Jun 24, 2021 3:06 am

Hi,

I have solved some optimizations, and afterwards want to calculate the fitness of the optimal solution again in MATLAB, based on the activation and excitation in the .sto file. However, I get a slightly different result compared to the objective in the history.txt file.

- Is the muscle activation or excitation the same as the input (muscle1:input())? The activation is most similar.
- What other reasons could there be for the result to be slightly different?

Thanks!
Anne

User avatar
Thomas Geijtenbeek
Posts: 461
Joined: Wed Mar 12, 2014 8:08 am

Re: Fitness calculation

Post by Thomas Geijtenbeek » Thu Jun 24, 2021 3:44 am

Hi Anne,

An important difference between muscle excitation and muscle input is that excitation is always clamped between a minimum value (0.01 by default) and 1, while the muscle input can be any value (also negative).

Another factor could be that the recording frequency of the .sto is different from the frequency at which the measure is called. The sto frequency is set via Preferences -> Advanced -> Data output frequency, while the measure frequency is set through fixed_measure_step_size. The recording frequency is typically lower (to save disk space), which means it doesn't contain all the samples used to calculate the fitness measure.

Let me know if this helps!

User avatar
Anne Koelewijn
Posts: 14
Joined: Tue Aug 26, 2014 6:42 am

Re: Fitness calculation

Post by Anne Koelewijn » Thu Jun 24, 2021 6:34 am

Thanks! It did. I also figured out now that one of the columns in the .sto file is input, and by using the input and the same frequency, I get the exact same result.

POST REPLY