08-Jan-2022 09:22:20 schroedinger_nonlinear_pde_test MATLAB/Octave version 9.8.0.1380330 (R2020a) Update 2 Solve the nonlinear 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_nonlinear_ode45 MATLAB/Octave version 9.8.0.1380330 (R2020a) Update 2 Solve the nonlinear Schroedinger PDE using ode45() Solve the nonlinear 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,44] Number of (variable size) time steps = 2457 Graphics saved as "schroedinger_nonlinear_ode45_initial.png" Graphics saved as "schroedinger_nonlinear_ode45_midway.png" Graphics saved as "schroedinger_nonlinear_ode45_final.png" Graphics saved as "schroedinger_nonlinear_ode45_conservation.png" schroedinger_nonlinear_ode45 Normal end of execution. schroedinger_nonlinear_midpoint MATLAB/Octave version 9.8.0.1380330 (R2020a) Update 2 Solve the nonlinear Schroedinger PDE using midpoint() Solve the nonlinear Schroedinger equation in 1D, du/dt = i uxx + i gamma |u|^2 u over the spatial interval: -20 <= x <= 80 using 201 equally spaced spatial nodes and time interval 0 <= t <= 44.0 using 2500 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 2500 steps, with dt=0.0176 in time interval [0,44] Graphics saved as "schroedinger_nonlinear_midpoint_initial.png" Graphics saved as "schroedinger_nonlinear_midpoint_midway.png" Graphics saved as "schroedinger_nonlinear_midpoint_final.png" Graphics saved as "schroedinger_nonlinear_midpoint_conservation.png" schroedinger_nonlinear_midpoint Normal end of execution. schroedinger_nonlinear_pde_test Normal end of execution. 08-Jan-2022 09:27:39