2. Functions#
Mathematical expressions often involves predefined functions, from elementary functions such as \(\sin(x)\) to special functions such as \(H_n(x)\) (Hermite polynomials). Such functions are not a part of python core. Many mathematical packages provides them and you have to pick one suitable for your application. In this chapter, the packages used in this lecuture, math
, numpy
, scipy
, sympy
, and mpmath
are introduced.
Visualizing mathematical expressions is very important not only for showing the results but also for understanding the problems. Visualization package matplotlib
is very powerful and we will be using it throughout the lecture. A very basic use of matplotlib
is introduced here. Advanced usage will be covered as needed.