## 3 Results  
The redesigned leg assembly and the original leg assembly are compared in Figure 8. The knee joint is incorporated into the link between the upper- and lower-leg sections and a close-up of the rollers for the knee joint is displayed to the right of the assembly. The result of the motion analysis conducted in SolidWorks is compared to the mocap data in Figures 9 and 10. SolidWorks motion analysis addressed feasibility of the redesigned leg assembly model; the SolidWorks model showed that it can replicate the movements and motions as gathered in the mocap data. Figure 8: Comparison of configurations: (**a**) original RoboREHAB leg assembly and (**b**) redesigned leg assembly with extra DOFs and side view of roller mechanism. Figure 9: Comparison of knee-joint trajectories for mocap and redesigned model in SolidWorks. Figure 9, below, shows the knee movement of the newly redesigned and three-segmented leg assembly, in blue, overlayed onto the ideal knee-motion trajectory motion-capture data, in orange. This overlay of both plots validates the mechanical capabilities of the new leg assembly design, reiterating that the new knee joint can recreate the movement and ranges needed for ideal knee movement pattern during the gait cycle. To further ensure the functionality of the SolidWorks model, the ankle movement was also evaluated for motion and range. Figure 10 below shows the overlay of the SolidWorks model for the ankle joint movement, in blue, overlayed to the ideal mocap ankle-joint trajectory, in orange. From this data comparison, it is clear that the new redesign is fully capable of the motions and ranges needed to recreate an ideal gait cycle on the ankle joint. While the SolidWorks model of the new redesign was used to validate the hardware aspect of the project, the MATLAB 2022a Simscape model was used to validate the software, programing, and machine-learning aspects of this project. In the Simscape model, the three-segmented leg model was trained in the reinforcement-learning block by the reward function illustrated in Equation (1). The trained leg model was then compared to the mocap data collected to validate the redesigned leg model in Simscape. The angular position histories for the mocap data and leg model are displayed in Figures 11 and 12, respectively. The Simscape simulation recreated the mocap data with less than a 5% deviation from the ideal mocap data. In Figure 11, the angular position of the leg segment connecting the hip and knee joints is shown by the red line. These data are directly compared to the angular position of the respective hip-knee segment of the mocap data. Much like the hip-knee segment, the knee-ankle segment simulation, shown in Figure 12, also shows the slight overshot of motion. This overshoot, like in the previous segment is still less than 5%, yet looks exaggerated when visualized in such a graphic. The initiation of these movements, marked at time 0, shows a larger-than-5% deviation. However, this shows that the machine-learning simulation can also somewhat naturally initiate a gait movement, also known as gait initiation. The joint motions that the robots (leg assemblies in the model) learned are annotated in Figures 13-15. Figure 13 shows the hip-joint path movement throughout the gait cycle, with each axis representing relative movement to a reference frame. Three types of data point of the hip joint are plotted simultaneously to provide an intuitive visual of the results. In orange, the original movement of the hip joint, labeled as 'Mocap Data', extracted though motion-capture analysis, is plotted. This original motion-capture trajectory is considered the ideal movement of the hip joint through one repetition of the gait cycle. Next, the overlaying gray plot, labeled as 'Two Segment Simscape Model', shows the machine-learning algorithm replicating the hip motion with a Simscape model made of only two segments.