The present disclosure provides a method and system (100) for optimizing charging of battery in real time. The system (100) includes an AC power supply (102). The AC power supply (102) supply single phase or three phase AC power for charging of a power storage unit (108). The system (100) includes a DC power supply ...