Electrostatic force microscopy and potentiometry of realistic nanostructured systems