08-Jan-2022 09:20:50 schroedinger_linear_pde_test MATLAB/Octave version 9.8.0.1380330 (R2020a) Update 2 Solve the linear Schroedinger PDE using the method of lines and various ODE solvers. Parameter values: alpha = 0.5 c1 = 1 c2 = 0.1 delta = 25 gamma = 1 t0 = 0 xmin = -20 xmax = 80 schroedinger_linear_ode45 MATLAB/Octave version 9.8.0.1380330 (R2020a) Update 2 Solve the linear Schroedinger PDE using ode45() Solve the linear Schroedinger equation in 1D, du/dt = i uxx + i gamma |u|^2 u over the spatial interval: -20 <= x <= 80 and time interval 0 <= t <= 44.0 with Neumann boundary conditions: u'(-20) = 0.0 u'(80) = 0.0 and parameter: gamma = 1 and initial condition u(0,x) = sqrt(2 alpha/gamma) * ( exp(0.5 i c1 x ) sech( sqrt(alpha) x ) + exp(0.5 i c2 (x-delta) sech( sqrt(alpha)(x-delta) ). and NX equally spaced nodes in X, using ode45(). Use 201 nodes, with dx=0.5 in space interval [-20,80] Time interval is [0,10] Number of (variable size) time steps = 273 Graphics saved as "schroedinger_linear_ode45_initial.png" Graphics saved as "schroedinger_linear_ode45_midway.png" Graphics saved as "schroedinger_linear_ode45_final.png" Graphics saved as "schroedinger_linear_ode45_conservation.png" schroedinger_linear_ode45 Normal end of execution. schroedinger_linear_midpoint MATLAB/Octave version 9.8.0.1380330 (R2020a) Update 2 Solve the linear Schroedinger PDE using midpoint() Solve the linear Schroedinger equation in 1D, du/dt = i uxx over the spatial interval: -20 <= x <= 80 using 201 equally spaced spatial nodes and time interval 0 <= t <= 44.0 using 250 equally spaced time steps with Neumann boundary conditions: u'(-20) = 0.0 u'(80) = 0.0 and parameter: gamma = 1 and initial condition u(0,x) = sqrt(2 alpha/gamma) * ( exp(0.5 i c1 x ) sech( sqrt(alpha) x ) + exp(0.5 i c2 (x-delta) sech( sqrt(alpha)(x-delta) ). using midpoint(). Use 201 nodes, with dx=0.5 in space interval [-20,80] Use 250 steps, with dt=0.04 in time interval [0,10] Graphics saved as "schroedinger_linear_midpoint_initial.png" Graphics saved as "schroedinger_linear_midpoint_midway.png" Graphics saved as "schroedinger_linear_midpoint_final.png" Graphics saved as "schroedinger_linear_midpoint_conservation.png" schroedinger_linear_midpoint Normal end of execution. schroedinger_linear_pde_test Normal end of execution. 08-Jan-2022 09:22:16