Nucleation, pinning, and coercivity in magnetic nanosystems : An analytical micromagnetic approach