###MIWsim1D###

Author: D Cyganski

Created: 2015-05-17

####Implementation of Wiseman many interacting worlds simulation for 1D, 1 Particle systems####

- v1 - demo of packet spreading and Fresnel diffraction of 1D packet with spreading
- v2 - single particle with gaussian distribution and nonzero mean velocity, colliding with a potential barrier
- v3 - single particle in two gaussian superposition with velocities, colliding with no interacting fields

The future track of the many worlds position state $Xp(t)=[x_1(t)...x_{N*J*D}(t)]$ is determined in general in MIW by system of $N*J*D$ coupled non-linear second order partial differential equations, where $N$=number of worlds, $J$=number of particles, $D$=number of dimensions. $m_k*\ddot{x}_{kn}(t) = f_k(x_n(t)) + r_{kN}(x_n(t);Xp(t))$ where $k$ indexes the particle and $n$ the world.

Such a system of $N*J*D$ second order non-linear PDEs can always be written as a system of of $2*N*J*D$ first order linear PDEs:

$\dot{x}_{kn}(t) = y_{kn}(t) \\ \dot{y}_{kn}(t) = (1/m_k)*(f_k(x_n(t)) + r_{kN}(x_n(t))$

which in turn can be put into matrix state-system form for state vector X=[x, y]'

$\dot{X}(t) = Ac*X(t)+Fc(t)+Rc(t)$

where I have suppressed the non-linear functional dependencies of $F$ and $R$, and incorporated the mass scaling into the new function $Fc$ $Rc$ and stacked all the particles and worlds into the single vector

We will now discretize this matrix differential equation and introduce the discrete time state vector of positions and velocities ($x$ and $\dot{x}$) to be named $X$.

For our 1 D case, there will be $N$ equations. $X$ has $2N$ state variables (position, velocity) In a discrete state space representation, the system is described as $2N$ first order linear state transition equations, and is representable as a $2N$ dimenstional matrix state space equation.

Now use the appropriate state propagation matrix to step this system forward in time. $X(n+1)=A*X(n)+F(x_n)+R(x_n,X)$ with $A=expm(Ac*T)$; where $Ac$ is the continuous time state propagation matrix, $T$ is the time interval between time steps, and expm is octave's matrix exponentiation function.

Note: The HDW paper does not explicitly use the matrix exponentiation based conversion of the continuous time to discrete time conversion. While a naive conversion produces results that converge to the same solution as $T$ approaches 0, for any finite value of $T$, the exponentiation approach will produce solutions closer to that of the un-discretized system of equations.

I discovered that when I applied the exponentiation to the Ac matrix, thanks to the fact that the differential equations involved did not involve any state variables in its linear part, the outcome of expm(Ac) yields the most simple (naive) summation equation. Since the matrix A that results is extremely sparse, it is computationally advantageous to simply use direct for loop implementation than matrix multiplication.

t = 24000
elapsed_time = 694.00

```
Inline plot failed, consider trying another graphics toolkit
error: print: no axes object in figure to print
error: called from
_make_figures>safe_print at line 122 column 7
_make_figures at line 44 column 13
```

GPL Ghostscript 9.18: **** Could not open the file 'MIW1D.d/000237.png'.
GPL Ghostscript 9.18: Unrecoverable error, exit code 1
error: save: unable to open output file 'MIW1D.d/+frame-number+'
error: called from
movie at line 82 column 7
error: load: unable to find file MIW1D.d/+frame-number+
error: called from
movie at line 102 column 9

Error in lines 1-1
Traceback (most recent call last):
File "/cocalc/lib/python2.7/site-packages/smc_sagews/sage_server.py", line 1009, in execute
exec compile(block+'\n', '', 'single') in namespace, locals
File "", line 1, in <module>
File "/cocalc/lib/python2.7/site-packages/smc_sagews/sage_server.py", line 838, in file
file_uuid = self._conn.send_file(filename)
File "/cocalc/lib/python2.7/site-packages/smc_sagews/sage_server.py", line 167, in send_file
f = open(filename, 'rb')
IOError: [Errno 2] No such file or directory: u'MIW1D.mp4'