0 5 10 15 20 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 <v(t)v(t+ )> Numeric Analytic −1 −0.5 0 0.5 1 0 2 4 6 8 x 10 4 v Frequency FIG. 1: (Color online) Autocorrelation function for the Ornstein-Uhlenbeck process, showing 〈 v ( t ) v ( t + τ ) 〉 as a func- tion of the time increment τ . The inset shows the histogram of fluctuations. It is Gaussian with the expected variance. The numerical parameters chosen are Γ = k B T = 0 . 1 , dt = 1 . 0. The average is taken over 10 independent realizations while the integration is performed for 10 6 SRK4 steps. and where C$_{ij}$ ( q ) is the static structure factor. The static and dynamic correlations for Q$_{αβ}$ are then obtained by returning to the original basis. The stationary probabil- ity distribution generated by the Langevin dynamics is Gaussian with zero mean and variance C$_{ij}$ ( q ), consistent with Boltzmann equilibrium. The fluctuating nematodynamics equations contained in Eq. (3) are five non-linear stochastic partial differen- tial equations. In general these have no analytical so- lutions and reliable numerical methods are therefore es- sential for their study. Here we combine the method of lines for solving initial-value partial differential equations with a stochastic Runge-Kutta integrator for systems of stochastic ordinary differential equations. This enables us to construct an accurate and efficient solver for the equations of fluctuating nematodynamics. Our results here build on previous work [11], where a method of lines approach was used to solve the deterministic time- dependent Ginzburg-Landau equations numerically. The methodology here can thus be thought of as a general- ization of the method of lines to stochastic partial differ- ential equations. The method of lines is based on the idea of semidis- cretisation, where an initial-value partial differential We now apply the method of lines together with SRK4 to obtain a stochastic method lines discretisa- tion (SMOL) for the equations of fluctuating nemato- dynamics. We benchmark our numerical results by com- paring autocorrelations within a harmonic theory which Fig.(1) shows the autocorrelation as a function of time and the histogram of equal-time fluctuations of v . The variance 〈 v $^{2}$〉 = k$_{B}$T is correctly reproduced, as is the exponential decay of the autocorrelation function. We conclude that SRK4 is suitable as an integrator for prob- lems where the fluctuation-dissipation relation must be maintained. where dW ( t ) = √$_{2}$$_{k}$$_{B}$$_{T}$$_{Γ}$$_{dt}$ N (0 , 1) is the increment of the stochastic variable in the interval dt , and N (0 , 1) is a zero-mean unit-variance normal deviate. By construc- tion, the increments of this stochastic variable are inde- pendent and normally distributed with mean 〈 dW ( t ) 〉 = 0. The particular choice of the variance ensures that the equilibrium distribution of v is a Gaussian with variance k$_{B}$T . The stationary two-point autocorrelation of the velocity from Eqn.(14) is, To test Wilkie’s algorithm for a stochastic Runge- Kutta integrator, henceforth denoted as SRK4, we first check that the fluctuation-dissipation is obeyed. We performed a simple benchmark test on the Ornstein- Uhlenbeck process, represented as the Ito differential equation, Common stochastic integrators include those due to Maryuama [14] and Milstein [15]. In this work, we use an integrator proposed recently by Wilkie [16], based on a multi-step Runge-Kutta strategy. The integrator is accu- rate and easy to implement by making small changes to a deterministic Runge-Kutta integrator. Further, since it is an explicit integrator, no matrix inversions are in- volved. This makes it attractive when the method of lines discretisation produces a large system of ordinary differential equations, as in our case. equation in space and time is discretised only in the spa- tial variable [12]. This yields a (possibly large) system of ordinary differential equations which is then solved by standard numerical integrators. To apply this method to stochastic partial differential equations, we must account for the fact that integrators for ordinary differential equa- tions do not automatically provide efficient and accurate solutions of stochastic differential equations. Qualita- tively, the noise term in a stochastic differential equation is a rapidly varying function and hence must be inte- grated with some care. At a more technical level, the noise is a Wiener process and the theory of stochastic integration must be used to evaluate it correctly [13]. 3 dv ( t ) = − Γ v ( t ) dt + dW ( t ) , (14) C$_{ij}$ ( q , τ ) = 〈 a$_{i}$ ( q , t ) a$_{j}$ ( − q , t + τ ) 〉 (13) = C$_{ij}$ ( q ) exp[ Γ( A + L 1 q $^{2}$) τ ] , 〈 v ( t ) v ( t + τ ) 〉 = k$_{B}$T exp ( − Γ τ ) . (15) IV. NUMERICAL METHOD III. STOCHASTIC METHOD OF LINES