Two things here:
First thing - As a seasoned sailer (viking ships) I'd like to point out that there is much more to sails than "the wind fills it like a bag and pushes the ship forward". What accellerates the ship is really the sucktion created *in front of* the sail, not the wind caught behind it. Sailships move considerably faster when the wind hits the sail edge-on, at a less-than 90 degree angle to the direction the ship is sailing in, than when the ship moves directly down wind, and the sail is expanded by the wind like a balloon. In other words, a sailship will move much faster at - say - 40 degrees up against the wind than with the wind coming directly from behind! Programming this is going to be non-trivial.
Second thing - Ropes and sail (cloth) can easily be programmed with point masses and springs. If you implement an iterative method you'll get incredibly stable and rigid materials. I can give you some small, fuctional code samples to work with, but you may have to translate them to your own preferred programming language.