Modeling and inversion of self-potential data