Gain functions allow you to map values from a source node variable into values for a different variable in a target node. This allows generic communciation between any two nodes in AnimatLab. This is the method use to allow the physics engine and the neural engines to communicate, and it also allows neural models in different plug-in modules to communicate. This means that biomechanical variables like muscle length can be converted into neural variables like injected current, or vice versa. There are currently three types of gains that you can use in AnimatLab. Gains are not limited to being used in adapters, but that is primarily where you will find them. As with everything in AnimatLab, you can add new gain types if you need them, and share them with other people. The three gains are shown below. They are polynomial, sigmoidal, and normal curves. Each one has different parameters specific to that item.
All gains also have a limit properties. These specify the x and y range over which the functions are defined, and they define the area that will be graphed in the dialog. If you know that your input or output value should never exceed a give range then you can use this to ensure that if for some reason a value gets passed in that is outside this range that it will be limited to the maximum or minimum output values. The upper and lower limits are the minimum and maximum input values for which this function is defined. The upper and lower outputs are the minimum and maximum output values that can be returned. If limits are turned on and an input value is received that is lower than the lower limit then the output value will be set to the lower output value regardless of what the value would be if it was computed using the gain equation. These limits can be turned on or off. They are off by default. If they are off then the output values are always determined by the value returned by the equation.
Gain limits also allow you to control the graph area in the gain dialog. Even if the limits are disabled you can still change the upper and lower limits to change the range of the x axis, and the upper and lower outputs to change the range of the y axis. If the function is not centered so you can easily view it this gives you the ability to make it clearer.
This project was supported by: