A complete analytic model for the base and collector current in lateral p-n-p transistors