Micromagnetic simulations and analytical description of magnetic configurations in nanosized magnets