Electric fields across lipid membranes play important roles in physiology, medicine, and biotechnology, rationalizing the wide interest in modeling transmembrane potentials in molecular dynamics simulations. Transmembrane potentials have been implemented with external electric fields or by imposing charge imbalance between the two water compartments of a stacked double-membrane system. We compare the two methods in the context of membrane electroporation, which involves a large change of membrane structure and capacitance. We show that, given that Ewald electrostatics are defined with tinfoil boundary conditions, the two methods lead to (i) identical potentials of mean force (PMFs) of pore formation and expansion at various potentials, demonstrating that the two methods impose equivalent driving forces for large-scale transitions at membranes, and (ii) to identical polarization of water within thin water wires or open pores, suggesting that the two methods furthermore impose equivalent local electric fields. Without tinfoil boundary conditions, effects from external fields on pore formation are spuriously suppressed or even removed. Together, our study shows that both methods, external fields and charge imbalance, are well suitable for studying large-scale transitions of lipid membranes that involve changes of membrane capacitance. However, using charge imbalance is technically more challenging for maintaining a constant transmembrane potential since it requires updating of the charge imbalance as the membrane capacitance changes.