Dynamic model of R&D investment