Tensor Train (TT) implementation of the Newton policy iteration for Hamilton-Jacobi-Bellman (HJB) equations. See [Dolgov, Kalise, Kunisch, arXiv:1908.01533] for the mathematical description.
The code is based on TT-Toolbox and tAMEn Matlab packages. Download or clone both repositories and add all subdirectories to the Matlab path.
Detailed description of each file is provided in the beginning, and is also accessible through the Matlab help function. For example, see help('hjb_leg') for the syntax of the TT-HJB solver.
These are the top-level scripts that should be run to reproduce the numerical experiments from the paper.
test_hjb_allencahn1.m1-dimensional Allen-Cahn equation (Section 4.1). Control constraints can be turned on by setting a finite umax parameter.test_hjb_allencahn2.m2-dimensional Allen-Cahn equation. Note that the 2D test can take a lot of CPU time.test_hjb_fokker.mFokker-Planck equation (Section 4.2).parse_parameter.mAuxiliary file to input parameters
All tests ask the user to enter model and approximation parameters from the keyboard. Default parameters are provided in the hint and can be used as a starting experiment that should complete in a few minutes. The scripts populate the main Matlab workspace with all variables such as the TT format of the value function. See the description in the beginning of each file for a list of those.
hjb_leg.mThe main computational routine to introduce the Legendre discretization, expand the system functions in this basis and run the policy iteration with TT approximations.controlfun_leg.mComputes the control signal at a particular state given the TT format of the value function.
legendre_rec.mComputes Legendre polynomials and their derivativeslgwt.mLegendre-Gauss Quadrature Weights and Nodesspectral_chebdiff.mComputes the Chebyshev differentiation matrix
amen_cross_s.mEnhanced TT-Cross algorithm for the TT approximation.fp1d.mGenerates system matrices and vectors for the discretized Fokker-Planck equationfpmr.mBalanced Truncation of the Fokker-Planck modelquadratic_fun.mComputes a multivariate quadratic polynomial for the LQR initial guess for the value function