Development of a Dynamic Model Based On the PID Control and Optimization Theories to Evaluate the Integrated Performance of the Energy Generation and Storage System