computational photonics implementation of the beam ... · of the beam propagation method •...

22
Computational Photonics, Summer Term 2012, Abbe School of Photonics, FSU Jena, Prof. Thomas Pertsch 1 Computational Photonics Implementation of the Beam Propagation Method Seminar 05, 4 June 2012 Learn how to implement fully explicit solution schemes of the beam propagation method understand stability problems of explicit schemes improve the stability of beam propagation the method by implicit solution schemes

Upload: others

Post on 21-Oct-2020

10 views

Category:

Documents


0 download

TRANSCRIPT

  • Computational Photonics, Summer Term 2012, Abbe School of Photonics, FSU Jena, Prof. Thomas Pertsch

    1

    Computational Photonics

    Implementation of the Beam Propagation Method

    Seminar 05, 4 June 2012

    • Learn how to implement fully explicit solution schemes of the beam propagation method

    • understand stability problems of explicit schemes • improve the stability of beam propagation the method

    by implicit solution schemes

  • Computational Photonics, Summer Term 2012, Abbe School of Photonics, FSU Jena, Prof. Thomas Pertsch

    • for inhomogeneous media in 2D (x,z-space, invariant in y)

    ( ) ( , )k x ki v x zz k kx

    ∂ ∂ −+ + = ∂ ∂

    2 2 2

    21 0

    2 2

    with v(x,z) - one vector component of electric field

    • initial value problem

    z

    x

    y

    v0(x,y)

    given: v0(x)=v(x,z=0) wanted: v(x,z)

    Paraxial wave equation in 1+1 dimensions

    ( ) ( ),k x n x k nπ π= =λ λ2 2

  • Computational Photonics, Summer Term 2012, Abbe School of Photonics, FSU Jena, Prof. Thomas Pertsch

    Solution Method: Finite-Difference-Method fully explicit

    ( )( , ) ( , )k x ki v x z v x zz k kx

    ∂ ∂ −= − − ∂ ∂

    2 2 2

    21

    2 2

    ( )

    n n n n nj j j j j j n

    jv v v v v k k

    i vz k kx

    ++ −− − + −= − −

    ∆ ∆

    1 2 21 1

    2

    212 2

    ( )

    n n nj j j jn n n

    j j jv v v k k

    v v i z i v zk kx

    + −+ − + −= + ∆ + ∆∆

    2 21 11

    2

    212 2

    Explicit solution scheme for initial value problem

  • Computational Photonics, Summer Term 2012, Abbe School of Photonics, FSU Jena, Prof. Thomas Pertsch

    x=xj=∆x j

    z=zn=∆z n

    Explicit solution scheme for initial value problem

  • Computational Photonics, Summer Term 2012, Abbe School of Photonics, FSU Jena, Prof. Thomas Pertsch

    • Finite-Difference-Method, fully explicit

    • Transformation operator T gives solution at next time step

    • Finite differencing approximation of continuous operator leads to accumulation of discretization errors

    Stability properties of explicit solution scheme

  • Computational Photonics, Summer Term 2012, Abbe School of Photonics, FSU Jena, Prof. Thomas Pertsch

    • Linearize equation by Taylor expansion

    • Amplification matrix , eigenvectors , eigenvalues

    Stability properties of explicit solution scheme

  • Computational Photonics, Summer Term 2012, Abbe School of Photonics, FSU Jena, Prof. Thomas Pertsch

    • Every error vector can be decomposed in eigenvectors

    • If error amplification in each eigenvector is smaller than 1 stable integration scheme

    • Question: What are those eigenvectors (eigenfunctions)?

    • Von Neumann stability analysis: Fourier ansatz (explain later)

    Stability properties of explicit solution scheme

  • Computational Photonics, Summer Term 2012, Abbe School of Photonics, FSU Jena, Prof. Thomas Pertsch

    • Plug in disturbed vectors:

    Stability properties of explicit solution scheme

  • Computational Photonics, Summer Term 2012, Abbe School of Photonics, FSU Jena, Prof. Thomas Pertsch

    • Assume error vector obeys Fourier ansatz:

    Fourier vectors are eigenvectors of amplification matrix Reason: is linear combination of shift operator

    Stability properties of explicit solution scheme

  • Computational Photonics, Summer Term 2012, Abbe School of Photonics, FSU Jena, Prof. Thomas Pertsch

    • Needed for stability:

    • In case of

    Explicit scheme is always unstable!

    • Leads to exponential growth of errors

    Stability properties of explicit solution scheme

  • Computational Photonics, Summer Term 2012, Abbe School of Photonics, FSU Jena, Prof. Thomas Pertsch

    x=xj=∆x j

    z=zn=∆z n

    Implicit solution scheme for initial value problem

  • Computational Photonics, Summer Term 2012, Abbe School of Photonics, FSU Jena, Prof. Thomas Pertsch

    Solution method: Finite-Difference-Method fully implicit

    lin. algebr. equ. A*vn+1=vn with vn+1=? Matlab simply vn+1=vn/A

    ( )( , ) ( , )k x ki v x z v x zz k kx

    ∂ ∂ −= − − ∂ ∂

    2 2 2

    21

    2 2

    ( )

    n n n n nj j j j j j n

    jv v v v v k k

    i vz k kx

    + + + ++ − +− − + −= − −

    ∆ ∆

    1 1 1 1 2 21 1 1

    2

    212 2

    ( )

    n n nj j j jn n n

    j j jv v v k k

    v i z i v z vk kx

    + + ++ −+ +− + −− ∆ − ∆ =

    1 1 1 2 21 11 1

    2

    212 2

    x=xj=∆x j

    z=zn=∆z n

    j j+1 j-1 n

    n+1

    Explicit solution scheme for initial value problem

  • Computational Photonics, Summer Term 2012, Abbe School of Photonics, FSU Jena, Prof. Thomas Pertsch

    • Finite-Difference-Method, fully implicit

    • Eigen modes of differential equation for Wj=0

    [ ]( ) cos( )( )

    zg i x

    k x

    ∆κ = − − κ∆ ∆

    21 1 1

    insert into differential equation

    ( )

    n n nj j jn n n

    j j j jv v v

    v i z iW v z vk x

    + + ++ −+ +− +− ∆ − ∆ =

    1 1 11 11 1

    2

    212

    exp( )nj ji xε = κ

    ( )

    i x i x

    n ne ei z

    k x

    κ∆ − κ∆

    + − +

    ε − ∆ = ε ∆

    1 21 21

    2

    1/g(κ)

    Stability properties of implicit scheme

  • Computational Photonics, Summer Term 2012, Abbe School of Photonics, FSU Jena, Prof. Thomas Pertsch

    [ ]( )

    cos( )( )

    gz

    xk x

    κ = ≤∆

    + − κ∆∆

    22

    22 4

    1 11 1

    |g(κ)|≤1 implicit scheme is stable

    all modulations are damped away

    Stability properties of implicit scheme

  • Computational Photonics, Summer Term 2012, Abbe School of Photonics, FSU Jena, Prof. Thomas Pertsch

    =

    ∆−∆∆

    +∆∆

    ∆∆

    ∆−∆∆

    +∆∆

    ∆∆

    −∆−∆∆

    +

    +

    +

    +

    nJ

    n

    n

    nJ

    n

    n

    J v

    vv

    v

    vv

    ziWxkzi

    xkzi

    xkzi

    ziWxkzi

    xkzi

    xkziziW

    xkzi

    2

    1

    1

    12

    11

    22

    2

    222

    212

    )(1

    )(200

    )(20

    0)(

    1)(2

    00)(2)(

    1

    Matrix equation A*vn+1=vn

    ( )

    n n nj j jn n n

    j j j jv v v

    v i z iW v z vk x

    + + ++ −+ +− +− ∆ − ∆ =

    1 1 11 11 1

    2

    212

    Implimentation of the fully implicit scheme

  • Computational Photonics, Summer Term 2012, Abbe School of Photonics, FSU Jena, Prof. Thomas Pertsch

    x=xj=∆x j

    z=zn=∆z n

    Explicit-implicit solution scheme

  • Computational Photonics, Summer Term 2012, Abbe School of Photonics, FSU Jena, Prof. Thomas Pertsch

    solution method: explicit-implicit Crank-Nicholson

    ( , ) ( ) ( , )i v x z U x v x zz k x

    ∂ ∂= − − ∂ ∂

    2

    21

    2

    ( ) ( )

    n n n n n n n n n nj j j j j j j j j j j jv v v v v U v v v v U vi

    z k kx x

    + + + + ++ − + −− − + − += − − − −

    ∆ ∆ ∆

    1 1 1 1 11 1 1 1

    2 2

    implicit explicit

    2 21 14 2 4 2

    ( ) ( )

    n n n n n n n nj j j j j j j j j jn n

    j jv v v W v v v v W v

    v i z i z v i z i zk kx x

    + + + ++ − + −+ − + − +− ∆ − ∆ = + ∆ + ∆

    ∆ ∆

    1 1 1 11 1 1 11

    2 2

    2 21 12 24 4

    linear equation system A vn+1=B vn

    x=xj=∆x j

    z=zn=∆z n

    j j+1 j-1 n

    n+1

    Explicit-implicit solution scheme

  • Computational Photonics, Summer Term 2012, Abbe School of Photonics, FSU Jena, Prof. Thomas Pertsch

    • Finite-difference-method (Crank-Nicholson scheme)

    • |g(κ)|=1 Crank-Nicholson scheme is stable, unity, precise to 2nd order (from central difference)

    ( ) ( )

    n n n n n n n nj j j j j j j j j jn n

    j jv v v W v v v v W v

    v i z i z v i z i zk kx x

    + + + ++ − + −+ − + − +− ∆ − ∆ = + ∆ + ∆

    ∆ ∆

    1 1 1 11 1 1 11

    2 2

    2 21 12 24 4

    ( ) ( )( ) ( )cos( ) / ( )

    ( )cos( ) / ( )

    i z x k xg

    i z x k x

    + ∆ κ∆ − ∆κ =

    − ∆ κ∆ − ∆

    2

    2

    1 1

    1 1

    • Eigen modes of difference equation for Wj=0

    insert into difference equation exp( )nj ji xε = κ

    • solution:

    Stability properties of explicit-implicit solution scheme

  • Computational Photonics, Summer Term 2012, Abbe School of Photonics, FSU Jena, Prof. Thomas Pertsch

    propagation function returning the entire propagation field Neumann‘s boundaries: field vanishes at the boundary propag. distance z=100µm, dz=0.005µm, nd=1.455, lambda=1µm function [v_out,X,Z]=beamprop_FTCSg(v_in,x,n,nd,z,dz,lambda,every); % field propagation over a given distance based on the solution of the % paraxial wave equation in an inhomogeneous refractive index distribution % single step Euler scheme % all space coordinates in µm % function call [v_out,X,Z]=beamprop_FTCSg(v_in,x,n,nd,z,dz,lambda,every); % v_in: initial field (vector) % x: space coordinate vector (vector) % n: refractive index distribution (vector) % nd: characteristic refractive index (scalar) % z: propagation distance (scalar) % dz: step size (scalar) % lambda: wavelength of light (scalar) % every: every number steps the field is to be given out % v_out: output field (matrix) % X: x-coordinates (matrix) % Z: z-coordinates (matrix)

    Task I: Explicit BPM method

  • Computational Photonics, Summer Term 2012, Abbe School of Photonics, FSU Jena, Prof. Thomas Pertsch

    propagation function based on fully implicit discretization scheme using sparse matrix routine A = spdiags(B,d,m,n) function [v_out,X,Z]=beamprop_FIsg(v_in,x,n,nd,z,dz,lambda,every); % field propagation over a given distance based on the solution of the % paraxial wave equation in an inhomogeneous refractive index distribution % single step Euler scheme % all space coordinates in µm % function call [v_out,X,Z]=beamprop_FIg(v_in,x,n,nd,z,dz,lambda,every); % v_in: initial field (vector) % x: space coordinate vector (vector) % n: refractive index distribution (vector) % nd: characteristic refractive index (scalar) % z: propagation distance (scalar) % dz: step size (scalar) % lambda: wavelength of light (scalar) % every: every number steps the field is to be given out % v_out: output field (matrix) % X: x-coordinates (matrix) % Z: z-coordinates (matrix)

    Task II: Fully implicit BPM method

  • Computational Photonics, Summer Term 2012, Abbe School of Photonics, FSU Jena, Prof. Thomas Pertsch

    modification of the propagation program to Crank-Nicholson discretization scheme function [v_out,X,Z]=beamprop_CNg(v_in,x,n,nd,z,dz,lambda,every); % field propagation over a given distance based on the solution of the % paraxial wave equation in an inhomogeneous refractive index distribution % Crank-Nicholson scheme % all space coordinates in µm % function call [v_out,X,Z]=beamprop_CNg(v_in,x,n,nd,z,dz,lambda,every); % v_in: initial field (vector) % x: space coordinate vector (vector) % n: refractive index distribution (vector) % nd: characteristic refractive index (scalar) % z: propagation distance (scalar) % dz: step size (scalar) % lambda: wavelength of light (scalar) % every: every number steps the field is to be given out % v_out: output field (matrix) % X: x-coordinates (matrix) % Z: z-coordinates (matrix)

    Task III*: Crank-Nicholson BPM method voluntary task

  • Computational Photonics, Summer Term 2012, Abbe School of Photonics, FSU Jena, Prof. Thomas Pertsch

    Homework 3 (4 June 2012)

    • Solve tasks I & II. • Prepare a one page report about your solution with a figure of some

    calculated example. • Submit your matlab m-files of your program together with your one page

    report electronically to [email protected] by 14 June 2012. • Please put everything together in one single email which contains your

    name (FAMILY NAME, Given Name) and matriculation number. • Late submissions will not be accepted! • 15 June the solutions of the tasks will be available online at the lectures

    homepage www.iap.uni-jena.de/teaching >>> Computational Photonics. • You are expected to solve the task yourself and a declaration of

    independent work must be signed by every student at the end of the semester.

    Computational PhotonicsParaxial wave equation in 1+1 dimensionsExplicit solution scheme for initial value problemExplicit solution scheme for initial value problemStability properties of explicit solution schemeStability properties of explicit solution schemeStability properties of explicit solution schemeStability properties of explicit solution schemeStability properties of explicit solution schemeStability properties of explicit solution schemeImplicit solution scheme for initial value problemExplicit solution scheme for initial value problemStability properties of implicit schemeStability properties of implicit schemeImplimentation of the fully implicit schemeExplicit-implicit solution schemeExplicit-implicit solution schemeStability properties of explicit-implicit solution schemeTask I: Explicit BPM method Task II: Fully implicit BPM method Task III*: Crank-Nicholson BPM methodHomework 3 (4 June 2012)