A dynamic model of open source vs proprietary R&D