Simulating the formation of a sigmoidal flux rope in AR10977 from SOHO/MDI magnetograms