In this paper, we propose a new formula for achieving optimal throughput in energy-aware cooperative networks with generic time and power energy harvesting protocol, namely time power switching based relaying (TPSR). Especially, this investigation analyzes the impact of imperfect hardware at the relay node and the destination node in the two-way relaying networks (TWRN). This analysis enables us to derive the closed-form expressions of outage probabilities of signal-to-noise and distortion ratio (SNDR) at the destination nodes under the effect of hardware impairments. Interestingly, the optimal policy of joint wireless information and energy transfer is designed to maximize the system throughput by finding the optimal time switching and power splitting fractions in the proposed TPSR protocol. An important achievement is that the proposed optimal design offers the maximum throughput of system when we consider the trade-off between throughput and time-power factors in energy harvesting protocol by both numerical method and simulation. Numerical results provide practical insights into the performance of energy-aware TWRN under hardware impairments. Monte-Carlo method is also deployed to corroborate the accuracy of analytical derived expressions.