# adaptive / smart grid choice for dynamic programming

I've a read a paper about investing where they used a dynamic programming approach to solve a finite horizon problem, i.e.

$$\max_{x_t} E[u(W_T)]$$

where $u$ is a utility function and $W_T$ denotes the terminal wealth. The Bellman equation can then be written as

$$V_t(W_t) = \max_{x_t}E[V_{t+1}(W_{t+1})|W_t]$$ with $V_T=u$. I have a continuous and concave utilitiy function which penalizes not hitting a certain target amount

$$u(w) = \begin{cases} K_1 & \text{if } w \geq K_1 \\ w - c\max{(0,(K_2-w))}^2 & \text{if } w < K_1 \end{cases}$$ where $K_1>K_2$ are constant and $c>0$ a scaling factor. Above $K_1$, $u$ is constant, below $K_2$ you add a penalty. $c$ is a control parameter how much we should penalize $u$. For $K_1 = 12$, $K_2=10$ and $c= 100$ we get the following picture.

and to see the linearity of $u$ between $K_2$ and $K_1$ another picture:

Since I'm using a backward induction algorithm and discretize the space I've naively tried a uniform space grid $\{x_i\}$ in a fairly large interval $[w_1,w_2]$. Afterwards, I've solved for all the grid points $\{x_i\}$ the problem leading to solutions $y_i$. The pair $(x_i, y_i)$ was then used to approximate $V_t$. For this I've used a shape preserving method. What I've seen from experimenting with the problem that the approximation is very good far out on the left and right side, away from high curvature region. Moreover, the solution becomes quite stationary in these "wing regions", too. What I then thought is to generate a non uniform grid which is denser where curvature is high. The problem is I don't know a priori the shape of $V_t$ (expect for $t=T$) so that it's hard to come up with a rule. Is there a generic way how to construct such non uniform grids? If someone has a concrete example or could point me into the right direction to do my own research, that would be really appreciated. I will potentially add another dimension to the state space so that the same question would arise in a higher dimension. That's why I put the mesh-generation tag as well