Page 1 of 1

Fitness calculation

Posted: Thu Jun 24, 2021 3:06 am
by adkoele
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

Re: Fitness calculation

Posted: Thu Jun 24, 2021 3:44 am
by tgeijten
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!

Re: Fitness calculation

Posted: Thu Jun 24, 2021 6:34 am
by adkoele
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.