The problem is this: there is model of robot, created in Simscape. And knee of this robot is made of "pin-slot-joint", which allows one transnational and one rotational degree of freedom. In transnational motion, it is imposed the stiffness and damping factor, which gives influence also to rotational torque. My aim is to write optimization or control algorithm in such a way that this algorithm should provide such stiffness(in linear direction), which will reduce the rotational torque. By the way, rotational reference motion of knee is provided in advance(as input), and appropriate torque is computed inside of the joint by inverse dynamics. But to create such algorithm, I have no deep information about block dynamics, because block is provided by simscape, and the source code and other information is hidden. By having signals of input stiffness, input motion, and output torque, I need to optimize the torque. I will be truly grateful if you suggest me something. (I tried to obtain equation, by using my knowledge in mechanics, but there are lots of details are needed such as the mass of the joint actuator, it's radius, the length of the spring and etc. AND I HAVE NO THIS INFORMATION.) If you suggest me something, I will be truly grateful.