28 September 2012 11:49:29 PM SDE_PRB C++ version Test the SDE library. TEST01: BPATH generates a sample Brownian motion path. BPATH data stored in "bpath_data.txt". BPATH plot commands stored in "bpath_commands.txt". TEST02: BPATH_AVERAGE generates many Brownian paths and averages them. BPATH_AVERAGE data stored in "bpath_average_data.txt". BPATH_AVERAGE plot commands stored in "bpath_average_commands.txt". TEST03: CHAIN solves a stochastic differential equation for a function of a stochastic variable X. We can solve for X(t), and then evaluate V(X(t)). Or, we can apply the stochastic chain rule to derive an an SDE for V, and solve that. Maximum | Sqrt(X) - V | = 0.0142923 CHAIN data stored in "chain_data.txt". CHAIN plot commands stored in "chain_commands.txt". TEST04: EM solves a stochastic differential equation using the Euler-Maruyama method. | Exact X(T) - EM X(T) | = 0.662559 EM data #1 stored in "em1_data.txt". EM data #2 stored in "em2_data.txt". EM plot commands stored in "em_commands.txt". TEST05: EMSTRONG investigates the strong convergence of the Euler-Maruyama method. EMSTRONG: Least squares solution to Error = c * dt ^ q (Expecting Q to be about 1/2.) Computed Q = 0.523444 Residual is 0.132182 EMSTRONG data stored in "emstrong_data.txt". EMSTRONG plot commands stored in "emstrong_commands.txt". TEST06: EMWEAK investigates the weak convergence of the Euler-Maruyama method. EMWEAK: Using standard Euler-Maruyama method. Least squares solution to Error = c * dt ^ q (Expecting Q to be about 1.) Computed Q = 1.01802 Residual is 0.150786 EMWEAK data stored in "emweak0_data.txt". EMWEAK plot commands stored in "emweak0_commands.txt". EMWEAK: Using weak Euler-Maruyama method. Least squares solution to Error = c * dt ^ q (Expecting Q to be about 1.) Computed Q = 1.00968 Residual is 0.184308 EMWEAK data stored in "emweak1_data.txt". EMWEAK plot commands stored in "emweak1_commands.txt". TEST07: MILSTRONG investigates the strong convergence of the Milstein method. MILSTEIN: Least squares solution to Error = c * dt ^ q Expecting Q to be about 1. Computed Q = 1.0172 Residual is 0.00449634 MILSTRONG data stored in "milstrong_data.txt". MILSTRONG plot commands stored in "milstrong_commands.txt". TEST08: STAB_ASYMPTOTIC investigates the asymptotic stability of the Euler-Maruyama method. For technical reasons, the plotting is done in the same routine as the computations. STAB_ASYMPTOTIC: Investigate asymptotic stability of Euler-Maruyama solution with stepsize DT and MU. SDE is asymptotically stable if Real ( lambda - 1/2 mu^2 ) < 0. EM with DT is asymptotically stable if E log ( | 1 + lambda dt - sqrt(dt) mu n(0,1) | ) < 0. where n(0,1) is a normal random value. Lambda = 0.5 Mu = 2.44949 SDE asymptotic stability test = -2.5 dt = 0.5 EM asymptotic test = 0.150451 Data for DT = 0.5 stored in "stab_asymptotic1_data.txt" dt = 0.25 EM asymptotic test = -0.0509627 Data for DT = 0.25 stored in "stab_asymptotic2_data.txt" dt = 0.125 EM asymptotic test = -0.17276 Data for DT = 0.125 stored in "stab_asymptotic3_data.txt" STAB_ASYMPTOTIC plot stored in "stab_asymptotic_commands.txt". TEST09: STAB_MEANSQUARE investigates the mean square stability of the Euler-Maruyama method. For technical reasons, the plotting is done in the same routine as the computations. STAB_MEANSQUARE: Investigate mean square stability of Euler-Maruyama solution with stepsize DT and MU. SDE is mean square stable if Real ( lambda + 1/2 |mu|^2 ) < 0. EM with DT is mean square stable if |1+dt^2| + dt * |mu|^2 - 1.0 < 0. Lambda = -3 Mu = 1.73205 SDE mean square stability test = -1.5 dt = 1 EM mean square stability test = 6 Data for DT = 1 stored in "stab_meansquare1_data.txt". dt = 0.5 EM mean square stability test = 0.75 Data for DT = 0.5 stored in "stab_meansquare2_data.txt". dt = 0.25 EM mean square stability test = -0.1875 Data for DT = 0.25 stored in "stab_meansquare3_data.txt". STAB_MEANSQUARE plot commands stored in "stab_meansquare_commands.txt". TEST10: Estimate the Ito integral of W(t) dW over [0,1]. Abs Rel N Exact Estimate Error Error 100 -0.301149 -0.355666 0.0545169 -0.181029 400 -0.17996 -0.185916 0.00595604 -0.0330965 1600 0.410747 0.419027 0.00828011 0.0201587 6400 -0.497174 -0.501174 0.00400012 -0.00804571 25600 -0.499946 -0.50568 0.00573387 -0.011469 102400 -0.125582 -0.126258 0.0006757 -0.00538054 409600 -0.466873 -0.46555 0.0013224 -0.00283246 TEST11: Estimate the Stratonovich integral of W(t) dW over [0,1]. Abs Rel N Exact Estimate Error Error 100 0.168011 0.251837 0.0838259 0.498931 400 0.0311443 0.0178839 0.0132604 0.425772 1600 2.76489 2.86991 0.105025 0.0379851 6400 0.05452 0.0562851 0.00176504 0.0323742 25600 1.11922 1.10053 0.0186885 0.0166977 102400 0.697412 0.696944 0.000467706 0.000670631 409600 0.326444 0.323894 0.00255028 0.00781229 SDE_PRB Normal end of execution. 28 September 2012 11:49:38 PM