The solution to this PDE is the value function $`V`$, and the free boundary
The solution to this PDE is the value function $`V`$. In stationarity, the free boundary
$`\partial \Omega`$ is the threshold on the state $`x_{\text{\tiny H}}`$ which
$`\partial \Omega`$ is the threshold on the vector state $`x_{\text{\tiny H}}`$ which
defines the optimal sampling scheme. For more details, we refer to the [article](cdc2017_paper.pdf).
defines the optimal sampling scheme. The current implementation handles second-order systems.
\ No newline at end of file
For more details, we refer to our [article](cdc2017_paper.pdf).
# Running the Code
For getting started, we recommend running and modifying the script `script_optimal_bound_2D.m`. The stationary solution of $`V`$ is computed by running the function `optimal_bound_2D`, found in `functions/optimal_bound_2D.m`. A typical run is:
Without loss of generality, `optimal_bound_2D` assumes that the system is of a form where $`R = I`$ and $`Q = \text{diag}(q_{11}, q_{22})`$ (the system state can always be transformed to achieve this).
The input arguments of `optimal_bound_2D` are:
*`A` : The $`2\times2`$ system matrix of the linear reset system.
*`q11`,`q22` : The diagonal elements of the (diagonal) cost matrix Q.
*`J` : The total cost of state deviation and sampling.
*`x1vec`,`x2vec` : The grid vectors of the two state dimensions. Each vector is assumed to have equidistantly spaced elements.
*`h` : The time step of the simulation.
*`plot_progress` : Specifies if $`V`$ and $`\partial \Omega`$ should be plotted during the simulation (`plot_progress = 1`) or not (`plot_progress = 0`).
*`print_progress` : Specifies if iteration info should be printed to the command window during the simulation (`print_progress = 1`) or not (`print_progress = 0`).
# About the Numerical Method
The numerical solution method is based on simulating the non-stationary version of the PDE using finite-difference approximations of the differential operators and gridding in time and space.
In this implementation, we use the backward-time central-space (BTCS) finite-difference approximation (see e.g. this [article](http://depa.fquim.unam.mx/amyd/archivero/DiferenciasFinitas4_25730.pdf) for more details).
We simulate the PDE by iterating the BTCS scheme, while at each iteration enforcing the inequality $`V \leq 0`$ by the assignment `V = min(V,0)`. This has the effect of moving the
free boundary $`\partial \Omega`$ over time. The simulation is then progressed until a stopping criterion based on stationarity of $`V`$ is met, or if the maximum number of iterations
is reached. The stopping criterion is an upper threshold on the maximum absolute difference of $`V`$ between to successive iterations.
The current implementation is for second-order systems only, i.e. $`x_{\text{\tiny H}} \in \mathbb{R}^2`$. However, this method of applying BTCS can be directly generalized to higher order systems
as well, although at a higher computational cost (the time complexity scales exponentially with the state dimension).