An idealized model for collapse of a molecular core within a filament