A micromagnetic model analysis of spin-torque oscillators (STOs) was carried out. First, the conditions for stable oscillation were determined using a uniform, in-gap field applied to the STO in place of the field from a write head. It was found that the rise time (0-90%) of the in-gap field greatly affected the STO oscillation, i.e. a shorter rise time gave more stable STO oscillation. We also investigated STOs in the write head gap and found that the STO oscillation was dependent on the rise time of the in-gap field.