14
Computational Photonics Dr. Thomas Kaiser

Computational Photonics - uni-jena.de · Tools for Scientific Computing •MATLAB –commercial (and expensive!) –high level language –focus on linear algebra (MATrix LABoratory)

  • Upload
    others

  • View
    6

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Computational Photonics - uni-jena.de · Tools for Scientific Computing •MATLAB –commercial (and expensive!) –high level language –focus on linear algebra (MATrix LABoratory)

Computational Photonics

Dr. Thomas Kaiser

Page 2: Computational Photonics - uni-jena.de · Tools for Scientific Computing •MATLAB –commercial (and expensive!) –high level language –focus on linear algebra (MATrix LABoratory)

Tools for Scientific Computing

• MATLAB – commercial (and expensive!)

– high level language

– focus on linear algebra (MATrix LABoratory)

– excellent IDE, but buggy graphics

– many specialized toolboxes

• Octave (GNU Clone of MATLAB) – free software

– high level language, quasi-identical to MATLAB

– same core features, less specials

– less comfortable IDE

16.04.2019 Computational Photonics SS2019 - Dr. Thomas Kaiser 2

Page 3: Computational Photonics - uni-jena.de · Tools for Scientific Computing •MATLAB –commercial (and expensive!) –high level language –focus on linear algebra (MATrix LABoratory)

Tools for Scientific Computing

• Python 3 – free software

– high level, general purpose language

– excellent IDEs and developing tools (Spyder, Ipython, Jupyter)

– becomes de facto standard for scientific computing and data science

– many packages with excellent functionalities (SciPy, NumPy, matplotlib, ...)

– Distributions manage packages (updates etc) recommended: Anaconda (has all recommended tools above on board)

16.04.2019 Computational Photonics SS2019 - Dr. Thomas Kaiser 3

Page 4: Computational Photonics - uni-jena.de · Tools for Scientific Computing •MATLAB –commercial (and expensive!) –high level language –focus on linear algebra (MATrix LABoratory)

Tools for Scientific Computing

• MATLAB, Octave and Python are Interpreter

languages!

• Compiler languages for scientific computing:

– C / C++

– Fortran

– [Java, C#, ObjectPascal, Basic, ...]

• Compiled programs are usually faster in runtime,

but slower in development

• Solution: using pre-compiled numerical core

routines (LAPACK/BLAS, Intel MKL, FFTW, ...)

16.04.2019 Computational Photonics SS2019 - Dr. Thomas Kaiser 4

Page 5: Computational Photonics - uni-jena.de · Tools for Scientific Computing •MATLAB –commercial (and expensive!) –high level language –focus on linear algebra (MATrix LABoratory)

Recap / Quick Intro: MATLAB Syntax

16.04.2019 Computational Photonics SS2019 - Dr. Thomas Kaiser 5

see live presentation / syntax recap material

Page 6: Computational Photonics - uni-jena.de · Tools for Scientific Computing •MATLAB –commercial (and expensive!) –high level language –focus on linear algebra (MATrix LABoratory)

Recap: Basic Numerical Operations

16.04.2019 Computational Photonics SS2019 - Dr. Thomas Kaiser 6

see also m-file with live presentation of high-level concepts

and tasks for self-studying recap online

Page 7: Computational Photonics - uni-jena.de · Tools for Scientific Computing •MATLAB –commercial (and expensive!) –high level language –focus on linear algebra (MATrix LABoratory)

Differentiation

• left-, right-sided, central, higher order, ...

16.04.2019 Computational Photonics SS2019 - Dr. Thomas Kaiser 7

Page 8: Computational Photonics - uni-jena.de · Tools for Scientific Computing •MATLAB –commercial (and expensive!) –high level language –focus on linear algebra (MATrix LABoratory)

Integration

• Rectangle, Gaussian, Simpson quadrature, ...

16.04.2019 Computational Photonics SS2019 - Dr. Thomas Kaiser 8

Page 9: Computational Photonics - uni-jena.de · Tools for Scientific Computing •MATLAB –commercial (and expensive!) –high level language –focus on linear algebra (MATrix LABoratory)

Root finding

• Bisection, Secant method, Newton method, ...

16.04.2019 Computational Photonics SS2019 - Dr. Thomas Kaiser 9

secant method regula falsi

Page 10: Computational Photonics - uni-jena.de · Tools for Scientific Computing •MATLAB –commercial (and expensive!) –high level language –focus on linear algebra (MATrix LABoratory)

Finding extremal points

• Steepest descent, Downhill-Simplex, ...

16.04.2019 Computational Photonics SS2019 - Dr. Thomas Kaiser 10

Page 11: Computational Photonics - uni-jena.de · Tools for Scientific Computing •MATLAB –commercial (and expensive!) –high level language –focus on linear algebra (MATrix LABoratory)

Linear system of equations

• Gauss-Jordan elimination, LU-decomposition,...

16.04.2019 Computational Photonics SS2019 - Dr. Thomas Kaiser 11

Page 12: Computational Photonics - uni-jena.de · Tools for Scientific Computing •MATLAB –commercial (and expensive!) –high level language –focus on linear algebra (MATrix LABoratory)

Eigenvalues, -vectors

• Householder, QR method, ...

16.04.2019 Computational Photonics SS2019 - Dr. Thomas Kaiser 12

Page 13: Computational Photonics - uni-jena.de · Tools for Scientific Computing •MATLAB –commercial (and expensive!) –high level language –focus on linear algebra (MATrix LABoratory)

Discrete Fourier Transform

• Fast Fourier Transform, Shannon-theorem, ...

16.04.2019 Computational Photonics SS2019 - Dr. Thomas Kaiser 13

Page 14: Computational Photonics - uni-jena.de · Tools for Scientific Computing •MATLAB –commercial (and expensive!) –high level language –focus on linear algebra (MATrix LABoratory)

Ordinary Differential Eqations

• Euler, Runge-Kutta method, ...

16.04.2019 Computational Photonics SS2019 - Dr. Thomas Kaiser 14