pdg-control
Problem statement: Maximize profits subject to maxh(t)∫T0e−ρtπ(x,h,t)dt Subject to the state equations (biology):
˙x=xexp(α(1−xK)(x−CK))−xh
Note that we consider the control variable to be effort, h instead of harvest, H, where H=hx.
and the constraints: x(0)=X0x(T)=XT We have fixed boundary conditions (equalities) and equalities in the state equations, so we have a nice straight-forward problem. We assume the instantaneous profit function shows diminishing returns (i.e. satisfies the curvature conditions dπdh<0,d2πdh>0). For instance we could take the saturating function: π(h,x,t)=h1+γ1+γ with γ<0. From this we can write down the associated present-value Hamiltonian: H=π(h)−λf(x,h) and the costate equation: ˙λ=−∂xH=λ(ρ−∂xf(x,h)) and boundary conditions. Given our curvature assumptions on $ $, the maximum principle of Pontryagin gives us the first-order condition: 0=∂hH=∂hπ−λ Assuming functional form above for fishing profits π, we can then rewrite the costate equation. dλdt=dλdhdhdt=γhγdhdt=hγ(ρ−∂xf(x,h)) simplifies to an ODE for $h $, leaving us with the two dimensional ODE BVP: ˙h=γ−1(ρ−∂xf(x,h)) ˙x=f(x,h) x(0)=X0x(T)=XT
Which we can solve by a variety of direct or indirect approaches. Note that we have analytically for f(x) given above ∂xf=−α(CK−2xK−2xC+3x2)K2−h
For instance, solving with shooting or basic collocation:

(code)