# Entropy Optimization in MHD Nanofluid Flow over an Exponential Stretching Sheet
## 4 Method of Solution
### Collocation  
The interval \(\xi\in\Lambda_{m}\equiv[\xi_{m-1},\xi_{m}]\) is transformed to \(s\in[-1,1]\) using the linear transformation  
\[\xi=\frac{1}{2}(\xi_{m}-\xi_{m-1})s+\frac{1}{2}(\xi_{m}+\xi_{m-1}),\]  
and \(\eta\in[0,\infty]\) is transformed to \(x\in[-1,1]\) using  
\[\eta=\frac{1}{2}L(x+1)\]where \(L\) is a number large enough to represent the condition at infinity. For collocation, we use the Gauss-Lobatto collocation points defined as  
\[x_{i}=\cos\left(\frac{\pi i}{N_{x}}\right),\qquad s_{j}=\cos\left(\frac{\pi j}{N _{s}}\right),\qquad i=0,1,\ldots,N_{x},\qquad j=0,1,\ldots,N_{s}.\]  
The Chebyshev differentiation matrix is as defined in [30], with respect to \(\zeta\). The general form can be expressed as  
\[\left.\frac{\partial^{n}f^{(m)}}{\partial x^{n}}\right|_{(s_{j}, x_{i})} = \mathbf{D}^{n}F_{i}^{(m)},\quad\left.\frac{\partial f^{(m)}}{ \partial s}\right|_{(s_{j},x_{i})}=\sum_{q=0}^{Ns}\mathbf{d}_{iq}^{(m)}F_{q}^{ (m)},\] \[\left.\frac{\partial^{n}\theta^{(m)}}{\partial x^{n}}\right|_{(s_ {j},x_{i})}= \mathbf{D}^{n}T_{i}^{(m)},\quad\left.\frac{\partial\theta^{(m)}}{ \partial s}\right|_{(s_{j},x_{i})}=\sum_{q=0}^{Ns}\mathbf{d}_{iq}^{(m)}T_{q}^ {(m)},\] \[\left.\frac{\partial^{n}h^{(m)}}{\partial x^{n}}\right|_{(s_{j}, x_{i})}= \mathbf{D}^{n}H_{i}^{(m)},\quad\left.\frac{\partial h^{(m)}}{\partial s}\right|_{(s _{j},x_{i})}=\sum_{q=0}^{Ns}\mathbf{d}_{iq}^{(m)}H_{q}^{(m)},\qquad i=0,1, \ldots,Nx, \tag{23}\]  
where  
\[F_{i}=[f(s_{j},x_{0}),f(s_{j},x_{1}),\ldots,f(s_{j},x_{Nx})]^{T},\quad T_{i}=[\theta(s_{j},x_{0}),\theta(s_{j},x_{1}),\ldots,\theta(s_{j},x_{ Nx})]^{T},\] \[H_{i}=[h(s_{j},x_{0}),h(s_{j},x_{1}),\ldots,h(s_{j},x_{Nx})]^{T},\quad\mathbf{d}=\frac{2d}{\zeta_{m}-\zeta_{m-1}},\quad\mathbf{D}=\frac{2D}{ C}.\]  
By applying Equations (21)-(23), we obtain  
\[\left(\mathbf{D}^{3}+\mathbf{a_{1,e}}\mathbf{D}^{2}+\mathbf{a_{ 2,e}}\mathbf{D}+\mathbf{a_{3,e}}I+\mathbf{a_{4,e}}\mathbf{d}_{ii}^{(m)}( \mathbf{D})+\mathbf{a_{5,e}}\mathbf{d}_{ii}^{(m)}I\right)F_{i,\epsilon+1}^{(m)}\] \[+\left(\mathbf{a_{4,e}}\sum_{ \begin{subarray}{c}q=0\\ q\
eq i\end{subarray} }^{Ns-1}\mathbf{d}_{iq}^{(m)}(\mathbf{D})+\mathbf{a_{5,e }}\sum_{ \begin{subarray}{c}q=0\\ q\
eq i\end{subarray} }^{Ns-1}\mathbf{d}_{iq}^{(m)}I\right)F_{q,\epsilon+1}^{(m) }+\left(\mathbf{a_{6,e}}\mathbf{D}+\mathbf{a_{7,e}}I\right)T_{i,\epsilon+1}^{(m)}\] \[+\mathbf{a_{8,e}}H_{i,\epsilon+1}^{(m)}=RR_{1,\epsilon},\] \[\left(b_{0,e}\mathbf{D}^{2}+\mathbf{b_{1,e}}\mathbf{D}+b_{2,e}I+ \mathbf{b_{3,e}}\mathbf{d}_{ii}^{(m)}\right)T_{i,\epsilon+1}^{(m)}+\left( \mathbf{b_{3,e}}\sum_{ \begin{subarray}{c}q=0\\ q\
eq i\end{subarray} }^{Ns-1}\mathbf{d}_{iq}^{(m)}I\right)T_{q,\epsilon+1}^{(m)}\] \[+\left(\mathbf{b_{4,e}}\mathbf{D}^{2}+\mathbf{b_{5,e}}\mathbf{D}+ \mathbf{b_{6,e}}I+\mathbf{b_{7,e}}\mathbf{d}_{ii}^{(m)}I\right)F_{i,\epsilon+ 1}^{(m)}+\left(\mathbf{b_{7,e}}\sum_{ \begin{subarray}{c}q=0\\ q\
eq i\end{subarray} }^{Ns-1}\mathbf{d}_{iq}^{(m)}I\right)F_{q,\epsilon+1}^{(m)}\] \[+\mathbf{b_{8,e}}\mathbf{D}P_{i,\epsilon+1}^{(m)}=RR_{2,e},\] \[\left(\mathbf{D}^{2}+\mathbf{c_{1,e}}\mathbf{D}+c_{2,e}I+\mathbf{ c_{3,e}}\mathbf{d}_{ii}^{(m)}\right)H_{i,\epsilon+1}^{(m)}+\left(\mathbf{c_{3,e}} \sum_{ \begin{subarray}{c}q=0\\ q\
eq i\end{subarray} }^{Ns-1}\mathbf{d}_{iq}^{(m)}I\right)H_{q,\epsilon+1}^{(m)}\] \[+\left(\mathbf{c_{4,e}}\mathbf{D}+\mathbf{c_{5,e}}I+\mathbf{c_{6,e}}\mathbf{d}_{ii}^{(m)}I\right)F_{i,\epsilon+1}^{(m)}+\left(\mathbf{c_{6,e}} \sum_{ \begin{subarray}{c}q=0\\ q\
eq i\end{subarray}