"""Perpetual-call exercise policies in a p=2 model; output PNG to cwd. Tested with Python 3.14.4 and the NumPy/Matplotlib versions in pyproject.toml. """ from pathlib import Path import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt import numpy as np def main(): plt.rcParams.update({'font.size':11,'savefig.facecolor':'white'}) fig,axes=plt.subplots(1,2,figsize=(10.4,4.1),layout='constrained') s=np.linspace(0,3.7,1200) intrinsic=np.maximum(s-1,0) axes[0].plot(s,intrinsic,'--',color='#777777',lw=1.7,label='Immediate exercise') for threshold,color,label in [(2,'#1565a7','Optimal threshold 2'),(1.4,'#218859','Early threshold 1.4'),(3.2,'#c65522','Late threshold 3.2')]: value=np.where(s