The present invention relates to a prosthetic device including a prosthetic joint which accurately transitions between a loose mode and a stiff mode to more accurately mimic a human gait. The prosthetic joint includes a state controller which utilizes a sensor to detect prosthetic joint movement data, and compares it with prosthetic joint movement decision values to determine when a solenoid should be energized to place the prosthetic joint in the loose mode. An optimization unit connects to the prosthetic joint in a prosthetic joint system. The optimization unit generates a plurality of data files containing prosthetic joint movement data corresponding to an amputee walking without stumbling. By iteratively analyzing the prosthetic joint movement data, the optimization unit adjusts the prosthetic joint movement decision values to ensure that the prosthetic joint does not prematurely enter a stumble recovery state.