This repository contains the code for the numerical experiments (Section 6) of
B. Sikora, Approximate controllability of semilinear subdiffusion equations with the Caputo time derivative, submitted to Fractional Calculus and Applied Analysis (2026).
The code computes the approximate controls
and reproduces all tables and figures of Section 6.
-
Space: spectral Galerkin method with the first
$M$ eigenfunctions$e_n(x)=\sqrt2\sin(n\pi x)$ ,$\lambda_n=n^2\pi^2$ ; the nonlinearity is evaluated on a uniform grid of 1000 points and projected back onto the modes by the midpoint rule. -
Time: L1 scheme for the Caputo derivative on a uniform grid with
$N_t$ steps, implicit in the linear part and explicit in the nonlinearity. The discrete solution kernels are computed by the scheme itself, so no Mittag-Leffler functions are evaluated. -
Control: discretise-then-control. The operators
$K$ ,$L_T$ ,$L_T^\ast$ and the Gramian$\Gamma_0^T$ are replaced by their exact discrete counterparts;$R(\varepsilon)$ is applied through the eigendecomposition of the discrete Gramian. -
Fixed point: damped iteration
$u^{(k+1)}=(1-\vartheta)u^{(k)}+\vartheta L_T^\ast R(\varepsilon)p(y^{(k)})$ , stopped when the maximal change of the modal coefficients is below$10^{-10}$ . -
Unbounded nonlinearity
$f(s)=as+\sin s$ : the linear part is moved into the generator ($\lambda_n\mapsto\lambda_n-a$ ), and the fixed point iteration involves only$h(s)=\sin s$ (Lemma 5.4, Theorem 5.6).
| Quantity | Value |
|---|---|
| Domain, control region, final time |
|
| Initial state, target |
|
| Orders | |
| Regularisation | |
| Discretisation (default) |
|
| Damping |
|
| Potentials |
|
Since all orders are larger than
git clone https://github.com/BeSikora/subdiffusion-approx-control.git
cd subdiffusion-approx-control
python -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
pip install -r requirements.txt.
├── subdiffusion_control.py # discretisation, Gramian, fixed point iteration;
│ # running it produces Figures 1–3
├── extra_experiments.py # Tables 1–2, Figure 4, generator check
├── requirements.txt
├── CITATION.cff
└── LICENSE
All output files are written to the current working directory.
python subdiffusion_control.py # Figures 1–3 (about 30 s)
python extra_experiments.py # Tables 1–2, Figure 4 etc. (about 3.5 min)The second script can also be run for individual items (numbering as in the journal version of the paper):
| Item in the paper | Content | Command | Output | Run time* |
|---|---|---|---|---|
| Figures 1–3 | error and cost vs. |
python subdiffusion_control.py |
fig_error_cost.pdf, fig_final_states.pdf, fig_control.pdf
|
30 s |
| Table 1 | dependence on |
python extra_experiments.py --table1 |
table_convergence.tex |
75 s |
| Section 6.2, text | errors for |
python extra_experiments.py --fine |
screen | 50 s |
| Table 2 |
|
python extra_experiments.py --table2 |
table_unbounded.tex |
80 s** |
| Figure 4 | error, cost and terminal states for |
python extra_experiments.py --fig4 |
fig_unbounded.pdf |
80 s** |
| Section 6.3, text | generator |
python extra_experiments.py --generator |
generator_check.txt |
2 s |
* single core of an Intel Xeon processor at 2.1 GHz.
** Table 2 and Figure 4 use the same runs; --table2 --fig4 computes them once.
Each figure is also saved as .png. subdiffusion_control.py additionally
writes table_results.tex with the error and the cost for
The following values from the paper (
| 3.79e-01 | 1.54e+00 | |
| 5.00e-02 | 2.83e+01 | |
| 1.82e-02 | 9.88e+02 |
All tables, figures and numbers quoted in Section 6 were reproduced exactly
with the versions listed in requirements.txt. The fixed point iteration
converges in 27–41 iterations for
For
If you use this code, please cite the article. GitHub shows the citation in
the sidebar ("Cite this repository") based on CITATION.cff.
@article{Sikora2026subdiffusion,
author = {Sikora, Beata},
title = {Approximate controllability of semilinear subdiffusion
equations with the {C}aputo time derivative},
journal = {Fractional Calculus and Applied Analysis},
year = {2026},
note = {Submitted}
}The code is released under the MIT License; see LICENSE.