When to Invest in Carbon Capture and Storage Technology: A Mathematical Model