Application of Optimal Switching Using Adaptive Dynamic Programming in Power Electronics