{VERSION 5 0 "IBM INTEL NT" "5.0" } {USTYLETAB {CSTYLE "Maple Input" -1 0 "Courier" 0 1 255 0 0 1 0 1 0 0 1 0 0 0 0 1 }{CSTYLE "" -1 256 "" 0 1 0 0 0 0 0 1 2 0 0 0 0 0 0 0 } {CSTYLE "" -1 257 "" 0 1 0 0 0 0 0 0 2 0 0 0 0 0 0 0 }{CSTYLE "" -1 258 "" 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 0 }{PSTYLE "Normal" -1 0 1 {CSTYLE "" -1 -1 "Times" 1 12 0 0 0 1 2 2 2 2 2 2 1 1 1 1 }1 1 0 0 0 0 1 0 1 0 2 2 0 1 }{PSTYLE "Normal" -1 256 1 {CSTYLE "" -1 -1 "Times" 1 14 0 0 0 1 2 2 2 2 2 2 1 1 1 1 }1 1 0 0 0 0 1 0 1 0 2 2 0 1 } {PSTYLE "" 0 257 1 {CSTYLE "" -1 -1 "" 1 14 0 0 0 0 0 0 0 0 0 0 0 0 0 0 }0 0 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }{PSTYLE "" 256 258 1 {CSTYLE "" -1 -1 "" 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 0 }0 0 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }{PSTYLE "" 0 259 1 {CSTYLE "" -1 -1 "" 1 14 0 0 0 0 0 0 0 0 0 0 0 0 0 0 }0 0 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }{PSTYLE "" 0 260 1 {CSTYLE " " -1 -1 "" 1 14 0 0 0 0 0 0 0 0 0 0 0 0 0 0 }0 0 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }{PSTYLE "" 0 261 1 {CSTYLE "" -1 -1 "" 1 14 0 0 0 0 0 0 0 0 0 0 0 0 0 0 }0 0 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }} {SECT 0 {EXCHG {PARA 258 "" 0 "" {TEXT 256 58 "Simulation of reflectio n/transmission of wave pulse in 1-d" }{TEXT 257 2 "\n\n" }{TEXT -1 21 "Instructions for use:" }}{PARA 257 "" 0 "" {TEXT -1 431 "Start with c ursor at the first line of red text in the file. Keep pressing the en ter key, waiting for the computer to finish the computation each time. In order to run the animation, select the graph, then click on the \+ \"play button\" on the tool bar (looks like a triangle pointing to the right). If you change some function or parameter, you only need to r e-run the \"execution groups\" below that point where you made the cha nge." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 259 "" 0 "" {TEXT 258 6 "Notes:" }}{PARA 260 "" 0 "" {TEXT -1 217 "The function \"f(z)\" is th e static profile of the incident wave pulse. \"F(k)\" is the Fourier \+ transform of the profile, i.e. the \"k-spectrum\" of f(z). An equival ent formulation is to explicitly spell out the integral:" }}{PARA 261 "" 0 "" {TEXT -1 723 " F := (k) -> int(f(z)*exp(-I*k*z),z=-Infinity. .Infinity), \nbut the built-in function \"fourier\" sometimes can do a better job on difficult functions. The idea of building the travelin g wave pulse is to let each \"Fourier component\" evolve with time lik e a plane wave by multiplying by exp(I*(k*z - k*v*t)). We then integr ate over k, including amplitudes and phase shifts obtained from solvin g the reflection problem for plane waves. The only subtlety is that f or the transmitted wave, we need to shift the wave vector in the time \+ evolution factor to \"k2\" which corresponds to the wave speed in medi um 2 (v2). We use the Heaviside step function to do the piecewise def inition of the function in the two different media.\n" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 54 "restart: with(plots): with(plottools): with(intt rans);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 45 "f := (z) -> exp(- 2*z^2);\nplot(f(z), z=-5..5);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 52 "F := (k) -> fourier(f(z),z,k):\nplot(F(k),k=-20..20);" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 345 "v1:=1.0: v2:=0.4: k2 := k*v 1/v2: y := (z,t) -> Re(int((F(k)*exp(I*k*z)+((v2-v1)/(v2+v1))*F(k)*exp (-I*k*z))*exp(-I*k*v1*t), k=-infinity..infinity))*Heaviside(-z) \n+Re( int(((2*v2)/(v2+v1))*F(k)*exp(I*(k2*z-k2*v2*t)), k=-infinity..infinity ))*Heaviside(z):\nanimate(y(z,t),z=-8..8,t=-6..10,frames=150,numpoints =150,title=\"Light to dense reflection\");" }}}{EXCHG {PARA 0 "> " 0 " " {MPLTEXT 1 0 346 "v1:=0.4: v2:=1.0: k2 := k*v1/v2: y := (z,t) -> Re( int((F(k)*exp(I*k*z)+((v2-v1)/(v2+v1))*F(k)*exp(-I*k*z))*exp(-I*k*v1*t ), k=-infinity..infinity))*Heaviside(-z) \n+Re(int(((2*v2)/(v2+v1))*F( k)*exp(I*(k2*z-k2*v2*t)), k=-infinity..infinity))*Heaviside(z):\nanima te(y(z,t),z=-8..8,t=-15..12,frames=170,numpoints=150,title=\"Dense to \+ light reflection\");" }}}}{MARK "0 0 0" 0 }{VIEWOPTS 1 1 0 1 1 1803 1 1 1 1 }{PAGENUMBERS 0 1 2 33 1 1 }