optimise magnetic structure using the steepest descendend method OPTMAGSTEEP(obj, 'option1', value1 ...) The function cannot deal with single ion anisotropy and incommensurate structures at the present state. These features will come soon. Input: obj Input object contains structural data, sw type. Options: nRun Number of iterations, default is 100 (it is usually enough). boundary Boundary conditions of the extended unit cell. 'free' Free, interactions between extedned unit cells are omitted. 'per' Periodic, interactions between extended unit cells are retained. Default is {'per' 'per' 'per'}. nExt The size of the magnetic cell in number of unit cells, to provide input information to 'fStat'. Default is from obj.mag_str.N_ext. fSub Function to define sublattices for Monte-Carlo speedup. cGraph = fSub(conn,nExt), where cGraph is a (1,nMagExt) sized vector, conn is a (2,nConn) size matrix and nExt is equal to 'nExt'. Default is <a href="matlab: doc sw_fsub">@sw_fsub</a> subLat Vector that assigns all magnetic moments into non-interacting sublattices, contains a single index (1,2,3...) for every magnetic moment, size is (1,nMagExt). If undefined, the function defined in 'fSub' will be used to partition the lattice. random Random initial conditions, if initial spin configuration is undefined (obj.mag_str.S is empty) the initial configuration is automaticly random independently of the value of random. Default is false. Output: E If requested, calculates the energy after every iteration, the calculation makes the script very slow. See also SW, SW.ANNEAL, SW_FSUB, SW_FSTAT.