brocksam / pycollo

General-purpose optimal control, trajectory optimisation and parameter optimisation using direct collocation
https://brocksam.github.io/pycollo/
MIT License
8 stars 3 forks source link

ph-Adaptive Mesh Refinement #6

Closed brocksam closed 5 years ago

brocksam commented 5 years ago

Development of ph-adaptive mesh refinement algorithm. This is based off Patterson, Hager and Rao (2014), "A ph mesh refinement method for optimal control". The algorithm has been adapted beyond what is presented in their paper to allow for mesh merging as well as mesh subdividing. First, an estimate of the mesh error is calculated by recomputing the problem on a mesh that includes one extra collocation node per mesh section. The maximum error is each mesh section is then compared to the overall mesh tolerance specified in the problem settings which gives an estimate of the required increase/decrease in mesh density to meet the mesh tolerance. Mesh subdivision occurs in the same way as the above paper, with p being increased preferentially. If p is to exceed the maximum p-value per mesh section however then subdivision occurs by splitting the mesh into a series of smaller mesh sections each with p equal to the minimum allowable value such that the total number of collocation nodes is as close as possible to that predicted by the mesh error calculation. For mesh subdivision the opposite process occurs. However, a logarithmic tolerance is set for mesh density reduction which results in fewer mesh reductions happening the closer the mesh is to meeting the mesh tolerance.