进一步,得到迭代公式 E+2(k)=En-2 △ 4rh”(k+1/2)-H(k-1/2) H(k+12)=H"(k+12)[E2(k+1)-E2(k)] △x 编程实践中,一般取 E E 则 E n+1/2 1△ (k)=En2(k) unE a [f"(k+12)-f”(k-12) ;“(+12)=B(+12)-0([E:“(+)+E(
进一步,得到迭代公式 ( ) ( ) ( ) ( ) 1/2 1/2 0 1/ 2 1/ 2 n n n n x x y y t k k k k x + − = − + − − E E H H ( ) ( ) ( ) ( ) 1 1/2 1/2 0 1/ 2 1/ 2 1 n n n n y y x x t k k k k x + + + + = + − + − H H E E 编程实践中,一般取 0 0 E E = 则: ( ) ( ) ( ) ( ) 1/2 1/2 0 0 1 1/ 2 1/ 2 n n n n x x y y t k k k k x + − = − + − − E E H H ( ) ( ) ( ) ( ) 1 1/2 1/2 0 0 1 1/ 2 1/ 2 1 n n n n y y x x t k k k k x + + + + = + − + − H H E E
若网格尺寸确定,则时间间隔就确定了 那么 C △x 77 E。△x 0 2 2021/12/10
7 若网格尺寸确定,则时间间隔就确定了 0 2 x t c = 那么 0 0 0 0 1 1 / 2 2 t x c x x c = = = 2021/12/10
for n =2: max time-1 iNner Loop E -Increments electric wave in space for k = 2: max_space E(k) E(k)+eta*(H(k-1)-H(k)); end %Hard Source- imposes a value on the grid pulse exp(-5*((to-n)/spread)"2); E(center__problem_space)= pulse; %Inner Loop H Increments magnetic wave in space for J =1: max_space-1 H(j)=H(j)+eta*(E(j)-E(j+1)); end end E2(k)=En2(k)-0.[”(k+1/2)-(k-12) 分(k+1/2)=B(+12)-05E(+1)-E2(k)
( ) ( ) ( ) ( ) 1/2 1/2 0.5 1/ 2 1/ 2 n n n n x x y y k k k k + − = − + − − E E H H ( ) ( ) ( ) ( ) 1 1/2 1/2 1/ 2 1/ 2 0.5 1 n n n n y y x x k k k k + + + + = + − + − H H E E
We define two important arrays E zeros(max_space, 1) %Initialize Electric array H = E iNitialize Magnetic array Two things are important in understanding the algorithm compared to the equations. The first is that the values of array e are updated at time n+ 1/2 whereas the values of array H are updated at time n+ 1 The other factor in the time equation is the placement of the pulse. It happens between the updates of array E and array H. So the pulse is factored into the arrays H and e at time step n and n+1/2 respectively. A visualization of this process is given in the figure below E(k+1)at n Array h outer Pulse added to array e loop n Trav E E(k′+1) from n-1 kk+ k+1 k E(k)H(j)E(k+1)H(j+1)
9 Two things are important in understanding the algorithm compared to the equations. The first is that the values of array E are updated at time n+1/2 whereas the values of array H are updated at time n + 1: The other factor in the time equation is the placement of the pulse. It happens between the updates of array E and array H. So the pulse is factored into the arrays H and E at time step n and n+1/2 respectively. A visualization of this process is given in the figure below
Simulation of electric and magnetic pulse at time n=100 Simulation of electric Pulse 0.5 0.5 100 120 140 160 180 imulation of magnetic Pulse 0.5 0.5 100 120 140160180200
10