A leg prosthesis test robot with hydraulic knee actuator is modeled and tested with closed loop control simulation. A cascade control architecture is designed for the system, the outer loop is controlled by a robust passivity-based controller (RPBC) and the inner loop is controlled by an optimization method. The control algorithm provides knee angle tracking with an RMS error of 0.07 degrees. The research contributes to the field of prosthetics by showing that it is possible to find effective closed loop control algorithm for a newly proposed hydraulic knee prosthesis. The simulations demonstrate the efficiency of RPBC\u27s ability to control complex, nonlinear and multivariable system with plant variability and parameter uncertainty. Dynamic equations for the hydraulic knee actuator are derived from bond graph, an optimization method is used to solve the inversion problem. Low-pass filters are implemented to eliminate signal chatter. Necessary modifications of knee actuator parameters are discussed and recommended to achieve better tracking performance