Upload
others
View
6
Download
0
Embed Size (px)
Citation preview
Computational Photonics
Dr. Thomas Kaiser
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
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
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
Recap / Quick Intro: MATLAB Syntax
16.04.2019 Computational Photonics SS2019 - Dr. Thomas Kaiser 5
see live presentation / syntax recap material
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
Differentiation
• left-, right-sided, central, higher order, ...
16.04.2019 Computational Photonics SS2019 - Dr. Thomas Kaiser 7
Integration
• Rectangle, Gaussian, Simpson quadrature, ...
16.04.2019 Computational Photonics SS2019 - Dr. Thomas Kaiser 8
Root finding
• Bisection, Secant method, Newton method, ...
16.04.2019 Computational Photonics SS2019 - Dr. Thomas Kaiser 9
secant method regula falsi
Finding extremal points
• Steepest descent, Downhill-Simplex, ...
16.04.2019 Computational Photonics SS2019 - Dr. Thomas Kaiser 10
Linear system of equations
• Gauss-Jordan elimination, LU-decomposition,...
16.04.2019 Computational Photonics SS2019 - Dr. Thomas Kaiser 11
Eigenvalues, -vectors
• Householder, QR method, ...
16.04.2019 Computational Photonics SS2019 - Dr. Thomas Kaiser 12
Discrete Fourier Transform
• Fast Fourier Transform, Shannon-theorem, ...
16.04.2019 Computational Photonics SS2019 - Dr. Thomas Kaiser 13
Ordinary Differential Eqations
• Euler, Runge-Kutta method, ...
16.04.2019 Computational Photonics SS2019 - Dr. Thomas Kaiser 14