A medical system comprising: a flexible device configured to be positioned at least partially within an anatomical passageway, the device including a plurality of sections (262, 264, and 266) and a shape sensor; and a memory device including computer executable instructions, the computer executable instructions comprising: instructions for determining a shape of the flexible device; instructions for determining a set of candidate passageways based on the shape of the flexible device, wherein the set of candidate passageways includes the anatomical passageway; instructions for determining a set of deformation forces for the plurality of sections (262, 264, and 266) of the flexible device; instructions for determining that the flexible device is within the anatomical passageway based on modeling an effect of the set of deformation forces on the set of candidate passageways; and instructions for generating a composite model indicating a position of the flexible device relative to the anatomical passageway based on the shape of the flexible device, the set of deformation forces, and anatomical data describing the anatomical passageway. a flexible device configured to be positioned at least partially within an anatomical passageway, the device including a plurality of sections (262, 264, and 266) and a shape sensor; and a memory device including computer executable instructions, the computer executable instructions comprising: instructions for determining a shape of the flexible device; instructions for determining a set of candidate passageways based on the shape of the flexible device, wherein the set of candidate passageways includes the anatomical passageway; instructions for determining a set of deformation forces for the plurality of sections (262, 264, and 266) of the flexible device; instructions for determining that the flexible device is within the anatomical passageway based on modeling an effect of the set of deformation forces on the set of candidate passageways; and instructions for generating a composite model indicating a position of the flexible device relative to the anatomical passageway based on the shape of the flexible device, the set of deformation forces, and anatomical data describing the anatomical passageway. instructions for determining a shape of the flexible device; instructions for determining a set of candidate passageways based on the shape of the flexible device, wherein the set of candidate passageways includes the anatomical passageway; instructions for determining a set of deformation forces for the plurality of sections (262, 264, and 266) of the flexible device; instructions for determining that the flexible device is within the anatomical passageway based on modeling an effect of the set of deformation forces on the set of candidate passageways; and instructions for generating a composite model indicating a position of the flexible device relative to the anatomical passageway based on the shape of the flexible device, the set of deformation forces, and anatomical data describing the anatomical passageway. the shape of the flexible device, the set of deformation forces, and anatomical data describing the anatomical passageway.