Application of Legendre spectral-collocation method to delay differential and stochastic delay differential equation | Synapse