# A Collocation Method for the Numerical Solution of Nonlinear Fractional Dynamical Systems
## 2 Materials and Methods
### The Collocation Method  
We approximate the solution to the dynamical system (1) by a linear combination of the functions belonging to the basis \(\mathcal{N}_{nh}\):  
\[Y_{nh}(t)=\sum_{k\geq 0}\,\Lambda_{k}\,N_{knh}(t)\,,\qquad t\geq 0\,, \tag{10}\]  
where \(\Lambda_{k}\in\mathbb{R}^{m}\), \(k\geq 0\), are unknown vectors that can be determined requiring that \(Y_{nh}(t)\) satisfies the differential problem (1) on a set of collocation points. Let \(I=[0,T]\) be the discretization interval and let \(\mathcal{T}=\{0<t_{1}<\cdots<t_{n_{p}-1}<t_{n_{p}}=T\}\) be a set of \(n_{p}\) collocation points. The restriction of \(Y_{nh}(t)\) to the interval \(I\) is  
\[Y_{nh}(t)=\sum_{k=0}^{n_{k}}\,\Lambda_{k}\,N_{knh}(t)\,,\qquad t\in I\,, \tag{11}\]  
where \(n_{k}=T/h+n-1\). Thus, the discretized version of (1) reads  
\[\left\{ \begin{array}{l}{}_{C}D_{t}^{\beta}\,Y_{nh}(t_{p})=F(t_{p},Y_{nh}(t_{p })),\qquad 1\leq p\leq n_{p},\\ \\ Y_{nh}(0)=Y_{0}.\end{array} \right. \tag{12}\]  
First of all, we observe that due to (6) and the partition of unity property, the initial condition is easily satisfied by setting  
\[Y_{nh}(t)=Y_{0}+\sum_{k=1}^{n_{k}}\,\Lambda_{k}\,N_{knh}(t)\,. \tag{13}\]Now, using (13) in the first Equation of (12), we get  
\[\sum_{k=1}^{n_{k}}\;\Lambda_{k}\,c\,D_{t}^{\beta}\,N_{kwh}(t_{p})=F\left(t_{p},Y_{ 0}+\sum_{k=1}^{n_{k}}\;\Lambda_{k}\,N_{kwh}(t_{p})\right),\qquad 1\leq p\leq n_{p}. \tag{14}\]  
This is a _nonlinear system_ with \(m\times n_{p}\) equations and \(m\times n_{k}\) unknowns. The existence of a unique solution to (14) depends on the existence of a unique solution to (1) [17; 18; 22]. The convergence and the stability of the method can be proved following the same line of reasoning in [8; 11] (cf. also [22]). For sufficiently smooth \(Y(t)\) the method is stable and the convergence is guaranteed with convergence order at least \(\beta\), i.e., \(\|Y(t)-Y_{nh}(t)\|_{\infty}\leq kh^{-\beta}\), where \(\|Y(t)\|_{\infty}=\max_{1\leq i\leq m}(\max_{t\in[0,T]}\,|y_{i}(t)|)\) and \(\kappa\) is a constant independent of \(h\). Moreover, polynomial reproduction implies that the spline approximation \(Y_{nh}(t)\) is exact whenever the solution \(Y(t)\) is a polynomial of degree at most \(n\). The solution to the nonlinear system (14) can be approximated by the Gauss-Newton method. Let  
\[\mathsf{L}=[\Lambda_{1},\Lambda_{2},\ldots,\Lambda_{n_{k}}]^{T}\in\mathbb{R}^ {mn_{k}}\]  
be the unknown vector and let  
\[\mathsf{M}_{0}=\big{[}N_{kwh}(t_{p}),1\leq p\leq n_{p},1\leq k\leq n_{k}\big{]} \in\mathbb{R}^{n_{p}\times n_{k}},\]  
\[\mathsf{M}_{\beta}=\big{[}c\,D_{t}^{\beta}\,N_{kwh}(t_{p}),1\leq p\leq n_{p},1 \leq k\leq n_{k}\big{]}\in\mathbb{R}^{n_{p}\times n_{k}}\]  
be the collocation matrices of the basis functions and of their fractional derivative, respectively. Let \(G:\mathbb{R}^{mn_{k}}\to\mathbb{R}^{nm_{p}}\) be the vector-valued function whose entries are the equations of the nonlinear system (14). Then, the nonlinear system can be written as  
\[G(\mathsf{L})=\big{(}l_{m}\otimes\mathsf{M}_{\beta}\big{)}\,\mathsf{L}- \mathsf{Q}(\mathsf{L})=0\,, \tag{15}\]  
where \(l_{m}\) is the identity matrix of order \(m\) and the vector \(\mathsf{Q}(\mathsf{L})=F(\mathcal{T},Y_{nh}(\mathcal{T}))\in\mathbb{R}^{mm_{p}}\) stands for the know term \(F\) evaluated in all the collocation points. Here, the symbol \(\otimes\) denotes the Kronecker product on two matrices. The Gauss-Newton method starts by an initial guess \(\mathsf{L}^{(0)}\) and approximates the solution to the nonlinear system by the iterative procedure  
\[\mathsf{L}^{(\ell+1)}=\mathsf{L}^{(\ell)}-\mathsf{V}^{(\ell)}\,,\qquad\ell \geq 0\,, \tag{16}\]  
where the vector \(\mathsf{V}^{(\ell)}\) is the solution to the linear system  
\[\mathcal{J}_{G}(\mathsf{L}^{(\ell)})\,\mathsf{V}^{(\ell)}=G\big{(}\mathsf{L} ^{(\ell)}\big{)}\,, \tag{17}\]  
and \(\mathcal{J}_{G}(\mathsf{L})\) is the Jacobian matrix of \(G(\mathsf{L})\).