This script simulates the propagation of an electromagnetic pulse in time and 2 spatial dimensions. The resulting movie is a map of the beam profile in the transverse direction (i.e. perpendicular to propagation) as a function of time at a given longitudinal position (i.e. along propagation axis).
The result uses plane wave solutions to the wave equation, integrating over all possible directions and frequencies, computed using fast fourier transforms.
The simulations can be used to help visualize how space-time-coupling (STC) affects pulse propagation.
The idea can easily be expanded into 3 spatial dimensions (although the computational cost can become excessive).
I made a slight typo on the function, which I have now fixed. Program runs without any problems.
The program does not run as is on 184.108.40.206 (R14)
There are several problems with the vector dimensions and operations among them.
I have the feeling that these errors are note related to matlab version (after R14)...
Error from Zhijun Wang has been fixed now.
The following information will be produced with the program
??? Undefined function or method 'chng_rng' for input arguments of type 'double'.
Error in ==> pulse_prop at 39
wmin = chng_rng(1, c); Min w value
Slight typo - the gauss function should be 2.^(.....) which I have now changed.
Sorry - I forgot to add a couple of my home-made functions. These have now been added to the start of the file - all should work now!