1. A method for optimizing performance of a task to a robot, the method comprising: designing at least one experiment comprising at least two tests, each test differing from at least one other test in the experiment regarding the a location of the task in relation to the robot, calculating/determining boundaries for location of the task, inside which boundries it is possible to perform the task, using a kinematic model of the robot, adjusting a location of experimental points relative to the robot so that the experimental point are inside the boundaries, calculating/determining an effect on optimality for at least one test in the experiment, fitting the experimental data to an algorithm, and calculating/determining the optimal location of the task by using the fitted experimental data.