I would like to construct a matrix $G$ composed of block matrices $G^{(i)}$ as defined entry-wise below stacked vertically as $$G = \begin{bmatrix} G^{(1)} \\ G^{(2)} \\ \vdots \\ G^{(i)} \\ \vdots \\ G^{(n)} \end{bmatrix}$$ for some natural number $n$.
$G^{(i)}_{j,k}$ stands for the element of the $j$'th row and the $k$'th column of the $i$'th block matrix. \begin{align} G^{(i)}_{j,k} :=& \frac{t_{i+1}-t}{h_i}\delta_{k,i}+\frac{t-t_i}{h_i}\delta_{k,i+1} -\frac16(t-t_i)(t_{i+1}-t)\Big(1+\frac{t_{i+1}-t}{h_i}\Big)\delta_{k,n+i} \\ &-\frac16(t-t_i)(t_{i+1}-t)\Big(1+\frac{t-t_i}{h_i}\Big)\delta_{k,n+i+1} \ \Bigg|_{t=t_{j,i}} \end{align} where $i\in\{1,2,\cdots,n\}$, $j\in\{1,2,\cdots,m(j)\}$, $m(j)$ is a natural numbered function of $j$, and $k\in\{1,2,\cdots,2n-2\}$, $\delta_{i,j}$ is the Kronecker delta function, and the vertical bar at the right end indicates $t$ is to be evaluated at $t_{j,t}$.
What is the most elegant and convenient way to do this?
SparseArray
. OrDiagonalMatrix
. What are the limits onj
andk
? Are the G's square matrices? Cann
be anything or is it related to the bounds oni
andj
? More details would be helpful. $\endgroup$