Modeling of electron elastic and inelastic scattering