"""Generate paper-41-concavification.png in the current directory. Uses the repository's existing numpy and matplotlib dependencies. """ import numpy as np import matplotlib matplotlib.use("Agg") import matplotlib.pyplot as plt from pathlib import Path a,b,w0=0.4,1.0,3.0 lo=w0-(b/a-1-np.log(b/a))/(b-a) hi=w0+(np.log(b/a)-1+a/b)/(b-a) s=a*np.exp(-a*lo) x=np.linspace(0,6,900) F=np.where(x<=w0,-np.exp(-a*x),-np.exp((b-a)*w0-b*x)) envelope=np.where((x>lo)&(x