Junkai Tan / Research software

A reference for learning-based control

ADP-MATLAB

From equations to
closed-loop experiments.

Study, reproduce and extend adaptive dynamic programming in MATLAB. Each method connects its mathematical assumptions to explicit code, recorded experiments and numerical checks.

ADP-MATLAB 0.5.3 · MIT · Release & license status

Maintained by Junkai TanThe Hong Kong Polytechnic University

8 runnable entries

Begin with an experiment.

An analytic baseline, a learned dynamics model, and a neural value function.

Linear quadraticIntegral PI
Recorded double-integrator states converge toward zero under the learned policy.

Learn a feedback law.

A two-state problem with an analytic LQR solution makes each policy-evaluation round and closed-loop check inspectable.

Recorded result5 policy-evaluation rounds

Run the baseline
Nonlinear dynamicsKoopman PI
Fifty recorded pendulum trajectories approach the equilibrium under a policy learned with a Koopman generator.

Control through a learned model.

Identify a Koopman generator, improve the policy, then compare it with policy iteration using the true dynamics.

Recorded experimentLearned policy · all 50 initial states
Normalized pendulum

Explore Koopman PI
Neural value functionsHJB PINN
Contours of the recorded trained pendulum value function, evaluated on the common grid at continuation horizon four.

Approximate the value function.

Train a physics-informed network with horizon continuation, then inspect its HJB residual and closed-loop behavior.

Recorded experimentNeural V(x, 0) · final stage T = 4 s
Reduced training

Explore neural HJB

Figures use saved MATLAB experiments. Each example has its own assumptions and numerical settings. Provenance · Editable figures & data

A traceable experiment

Keep the mathematics
close to the code.

Start with a method’s problem and equation map. Run its native implementation, then inspect the saved configuration, trajectory and diagnostics.

The shared entry point selects a method. Each implementation retains the assumptions, dimensions and numerical choices its mathematics requires.

Read the implementation guide

The integral-PI baseline

J(π) = ∫0 (xᵀQx + uᵀRu) dtu = π(x)
Problem
adp.models.doubleIntegrator
Learning
adp.learn.integralPI
Evaluation
adp.sim.rollout
Record
result.config · result.metrics
result.evaluation · runDir

The analytic LQR solution is an independent comparison; it is not supplied to the learner.

Find the method for your problem.

8 runnable entries, including 7 paper implementations. Expand a row for the command, dependencies and recorded scope.

Implemented methods and runnable examples
Method / sourceProblem & learningExampleRun instructions
Integral policy iterationReference baselineCT linear quadratic · known BDouble integrator
Koopman generator + PIL4DC 2025CT nonlinear · identified generatorNormalized pendulum
Mean-field LQGAutomatica 2025Stochastic CT · two-gain PIFinite population LQG
Off-policy Q-learningIEEE TAC 2023DT LQR · matrix Bellman equationData-based LQR
Infinite-horizon HJB PINNIJRNC 2025Neural HJB · horizon continuationScalar LQR & pendulum
Safe epigraph PINNICML 2025Epigraph HJB · neural valueConstrained boat navigation
Robust Koopman PIPreprint 2026Lifted bilinear · robust PILifted bilinear control
Bias-policy iterationAutomatica 2026Unknown CT nonlinear · fixed dataPendulum & two-link arm

CT: continuous time. DT: discrete time. Algorithmic assumptions and numerical variants are documented with each implementation.

Getting started

Your first run
in MATLAB.

Download the v0.5.3 source or clone the GitHub repository. Open its root folder in MATLAB and run the commands alongside.

The baseline uses base MATLAB with the standard JVM. Expect a learned gain close to [1, √3].

MATLAB · repository root
check_environment();
% List available methods
demo_reproductions();

[result, runDir] = ...
    demo_reproductions( ...
        'baseline');
result.learning.K

Expected gain1.0000   1.7321

Inspect result.evaluation for the trajectory and result.metrics for the numerical checks. runDir points to the saved experiment.

Results you can inspect.

Local tests, recorded experiments and paper comparisons answer different questions. Keep the settings with the result.

107 local checks passedMATLAB R2025b Update 6 · macOS Apple silicon

Tests include two single Adam updates. Full training and paper-figure reproduction are recorded separately. Validation record

Integral PI: learning, feedback and valueView the complete baseline figure
Integral policy iteration gain error, recorded phase trajectory and normalized cost–value decomposition.

Double integrator, Q = I, R = 1, x₀ = [1, −1]ᵀ. Contours use the analytic LQR value. Final gain error: 8.37 × 10−14; eight-second cost: 1.4641008. PDF · Editable figure & data

Recorded differences

These results describe specific numerical variants; the settings differ across methods.

ExperimentObserved result
Safe epigraph PINNOf the same 64 candidates, reduced training executes 64: 19 collisions, 47 budget violations. The author checkpoint executes 63: 1 collision, 9 budget violations. Events may overlap.
Robust Koopman PIThe fitted error bound fails on 25.55% of held-out points.
Bias-PI arm variantThe recorded closed loop stabilizes; cost is 8.84% above the local LQR comparison.

Download test results · Recorded experiment index

Build on the reference

Add the next
reproducible example.

Contribute a mathematical problem, an equation map, an explicit MATLAB implementation and an experiment with an independent comparison. Preserve the configuration and historical results.

The repository includes templates and six optional research skills. Current priorities include FxT-CL-ACI, constrained control and an offline MATLAB/Simulink robot example.

Citation & release

Credit the method.
Record the version.

Cite the original paper when using an implementation, and include the ADP-MATLAB version or commit.

Software citation metadata
Software version
0.5.3
Public release
Published
Software license
MIT

Initial references: Frank Lewis’s software, FxT-CL-ACI, and ADP algorithms. Attribution details