├── .gitignore ├── LICENSE ├── README.md ├── environment.yml ├── examples ├── gen_vid.sh ├── heat.gif ├── heat_cylinder.gif ├── heat_daniel.gif ├── heat_hexa.gif ├── heat_iterations.py ├── heat_smiley.gif ├── wave.gif ├── wave_cylinder.gif ├── wave_daniel.gif ├── wave_hexa.gif ├── wave_iterations.py └── wave_smiley.gif ├── notebooks ├── complex numbers.ipynb ├── fourier_analysis.ipynb ├── nst_arpeggios_c_audio.wav ├── pde.ipynb ├── styles │ ├── custom_barba.css │ └── custom_ketch.css ├── sympy │ ├── laplace_transform.ipynb │ ├── linear_algebra.ipynb │ ├── ode.ipynb │ └── sympy_in_10_minutes.ipynb ├── vector_calculus-mayavi.ipynb └── vector_calculus-pyvista.ipynb ├── program.md ├── references.md └── slides ├── course_presentation.html ├── course_presentation.md ├── fourier_analysis.html ├── fourier_analysis.md ├── img ├── Chebyshev_Polynomials_of_the_First_Kind.svg ├── Components_stress_tensor.svg ├── Continuous_Fourier_transform_of_rect_and_sinc_functions.gif ├── Epsilontensor.svg ├── Fourier_series_integral_identities.gif ├── Fourier_transform_time_and_frequency_domains.gif ├── Fourier_vis.html ├── Hermite_poly_phys.svg ├── Mona_Lisa_eigenvector_grid.png ├── PenduloTmg.gif ├── airy_functions.py ├── airy_functions.svg ├── bessel_functions.py ├── bessel_functions.svg ├── drag_fall.mp4 ├── drag_fall.py ├── free_fall.mp4 ├── free_fall.py ├── gamma_function.py ├── gamma_function.svg ├── gradient_vis.svg ├── polar_coords.html ├── polar_coords.pvsm └── polar_coords.webgl ├── linear_transformations.html ├── linear_transformations.md ├── ode.html ├── ode.md ├── style.css ├── vector_calculus.html └── vector_calculus.md /.gitignore: -------------------------------------------------------------------------------- 1 | # Byte-compiled / optimized / DLL files 2 | __pycache__/ 3 | *.py[cod] 4 | *$py.class 5 | 6 | # C extensions 7 | *.so 8 | 9 | # Distribution / packaging 10 | .Python 11 | env/ 12 | build/ 13 | develop-eggs/ 14 | dist/ 15 | downloads/ 16 | eggs/ 17 | .eggs/ 18 | lib/ 19 | lib64/ 20 | parts/ 21 | sdist/ 22 | var/ 23 | *.egg-info/ 24 | .installed.cfg 25 | *.egg 26 | 27 | # PyInstaller 28 | # Usually these files are written by a python script from a template 29 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 30 | *.manifest 31 | *.spec 32 | 33 | # Installer logs 34 | pip-log.txt 35 | pip-delete-this-directory.txt 36 | 37 | # Unit test / coverage reports 38 | htmlcov/ 39 | .tox/ 40 | .coverage 41 | .coverage.* 42 | .cache 43 | nosetests.xml 44 | coverage.xml 45 | *,cover 46 | .hypothesis/ 47 | 48 | # Translations 49 | *.mo 50 | *.pot 51 | 52 | # Django stuff: 53 | *.log 54 | local_settings.py 55 | 56 | # Flask stuff: 57 | instance/ 58 | .webassets-cache 59 | 60 | # Scrapy stuff: 61 | .scrapy 62 | 63 | # Sphinx documentation 64 | docs/_build/ 65 | 66 | # PyBuilder 67 | target/ 68 | 69 | # IPython Notebook 70 | .ipynb_checkpoints 71 | 72 | # pyenv 73 | .python-version 74 | 75 | # celery beat schedule file 76 | celerybeat-schedule 77 | 78 | # dotenv 79 | .env 80 | 81 | # virtualenv 82 | venv/ 83 | ENV/ 84 | 85 | # Spyder project settings 86 | .spyderproject 87 | 88 | # Rope project settings 89 | .ropeproject 90 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 Nicolás Guarín-Zapata 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Advanced Mathematics for Engineers 2 | 3 | [![Binder](http://mybinder.org/badge.svg)](http://mybinder.org:/repo/nicoguaro/AdvancedMath) 4 | 5 | This is a repository with material for the course Advanced Mathematics for Engineers. The program of the course is located [here](./program.md). A _commented_ list of 6 | references can be found [here](./references.md). 7 | 8 | ## Contents 9 | 10 | - Notebooks: This folder contains several Jupyter Notebooks. 11 | 12 | - Sympy Tutorials: 13 | 14 | - [SymPy in 10 minutes](https://nbviewer.jupyter.org/github/nicoguaro/AdvancedMath/blob/master/notebooks/sympy/sympy_in_10_minutes.ipynb) 15 | 16 | - [Linear Algebra in SymPy](https://nbviewer.jupyter.org/github/nicoguaro/AdvancedMath/blob/master/notebooks/sympy/linear_algebra.ipynb) 17 | 18 | - [Ordinary differential equations in SymPy](https://nbviewer.jupyter.org/github/nicoguaro/AdvancedMath/blob/master/notebooks/sympy/ode.ipynb) 19 | 20 | - [Laplace Transform](https://nbviewer.jupyter.org/github/nicoguaro/AdvancedMath/blob/master/notebooks/sympy/laplace_transform.ipynb) 21 | 22 | - Lessons: 23 | 24 | - [Vector calculus and coordinate systems](https://nbviewer.jupyter.org/github/nicoguaro/AdvancedMath/blob/master/notebooks/vector_calculus-pyvista.ipynb) 25 | 26 | - [Orthonormal basis and Fourier Analysis](https://nbviewer.jupyter.org/github/nicoguaro/AdvancedMath/blob/master/notebooks/fourier_analysis.ipynb) 27 | 28 | 29 | - Slides 30 | - [Course presentation](https://cdn.rawgit.com/nicoguaro/AdvancedMath/cddc9b94/Slides/Course_presentation.html) 31 | 32 | - [Linear transformations](https://cdn.rawgit.com/nicoguaro/AdvancedMath/5fa8ad68/Slides/Linear_transformations.html) 33 | 34 | - [Vector calculus and coordinate systems](https://cdn.rawgit.com/nicoguaro/AdvancedMath/597051f1/Slides/Vector_calculus.html) 35 | 36 | - [Orthonormal basis and Fourier Analysis](https://cdn.rawgit.com/nicoguaro/AdvancedMath/37e5cf49/Slides/Fourier_analysis.html) 37 | 38 | ## Downloading the Tutorial Materials 39 | 40 | You can clone the repo using: 41 | 42 | git clone https://github.com/nicoguaro/AdvancedMath 43 | 44 | or directly use the download option from GitHub. 45 | 46 | 47 | ## Installation Instructions 48 | 49 | To display the slides a browser is needed. They have been tested in Mozilla Firefox and Google Chrome, but any _modern_ browser should work. 50 | 51 | You can create an Anaconda environment using 52 | 53 | 54 | conda env create -f environment.yml 55 | 56 | 57 | This repository includes [Jupyter Notebooks](https://jupyter.org/). To run these you will need [Python](https://www.python.org/) and some packages: 58 | 59 | - [IPython](http://ipython.org/), a command shell for interactive computing in multiple programming languages that offers introspection, rich media, shell syntax, tab completion, and history. 60 | 61 | - [NumPy](http://www.numpy.org/), an extension to the Python programming language, adding support for large, multi-dimensional arrays and matrices, along with a large library of high-level mathematical functions to operate on these arrays. 62 | 63 | - [SciPy](http://www.scipy.org/), an open source Python library used for scientific computing and technical computing. 64 | 65 | - [matplotlib](http://matplotlib.org/), a plotting library for the Python programming language and its numerical mathematics extension NumPy. 66 | 67 | and the [Computer Algebra System (CAS)](https://en.wikipedia.org/wiki/Computer_algebra_system) [Sympy](http://www.sympy.org/). 68 | The suggested method is to download a Python Distribution, preferably [Anaconda](https://www.continuum.io/downloads). This will include all the packages mentioned above. 69 | 70 | For instruction on how to compile the source codes into the html files see the following section. 71 | 72 | ## Slides 73 | The slides for some lectures are in the folder [``Slides``](./Slides) as ``.html`` files. They were written as Markdown (``.md``) files, and compiled with [``pandoc``](http://pandoc.org/) using 74 | 75 | pandoc -t slidy --css style.css -s slides.md -o slides.html 76 | 77 | or 78 | 79 | pandoc -t slidy --css style.css --mathjax -s slides.md -o slides.html 80 | 81 | to use [MathJax](https://www.mathjax.org/) to render the equations. 82 | 83 | ## License 84 | All code is under MIT license and media under Creative Commons Attribute. 85 | 86 | The content of this reposirtory is licensed under the [Creative Commons Attribution 4.0 license](http://choosealicense.com/licenses/cc-by-4.0/), and the source code that accompany the content is licensed under the [MIT license](https://opensource.org/licenses/mit-license.php). 87 | -------------------------------------------------------------------------------- /environment.yml: -------------------------------------------------------------------------------- 1 | name: advanced-math 2 | channels: 3 | - conda-forge 4 | dependencies: 5 | - python>3.6 6 | - numpy 7 | - scipy 8 | - matplotlib 9 | - pyqt>=5.9 10 | - vtk>=8 11 | - jupyter 12 | - ipywidgets 13 | - ipyevents 14 | - pyvista 15 | - itkwidgets 16 | - sympy 17 | - mayavi 18 | - pip 19 | - pip: 20 | - continuum_mechanics 21 | -------------------------------------------------------------------------------- /examples/gen_vid.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | FNAME=$1 3 | convert -delay 10 -loop 0 $FNAME*.png $FNAME.gif 4 | rm -r $FNAME*.png 5 | -------------------------------------------------------------------------------- /examples/heat.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicoguaro/AdvancedMath/2749068de442f67b89d3f57827367193ce61a09c/examples/heat.gif -------------------------------------------------------------------------------- /examples/heat_cylinder.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicoguaro/AdvancedMath/2749068de442f67b89d3f57827367193ce61a09c/examples/heat_cylinder.gif -------------------------------------------------------------------------------- /examples/heat_daniel.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicoguaro/AdvancedMath/2749068de442f67b89d3f57827367193ce61a09c/examples/heat_daniel.gif -------------------------------------------------------------------------------- /examples/heat_hexa.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicoguaro/AdvancedMath/2749068de442f67b89d3f57827367193ce61a09c/examples/heat_hexa.gif -------------------------------------------------------------------------------- /examples/heat_iterations.py: -------------------------------------------------------------------------------- 1 | """ 2 | Illustration of the heat equation 3 | 4 | Solve the heat equation using finite differences and Forward Euler. 5 | 6 | Based on: https://commons.wikimedia.org/wiki/File:Heat_eqn.gif 7 | """ 8 | 9 | from __future__ import division, print_function 10 | import numpy as np 11 | from mayavi import mlab 12 | 13 | 14 | def step_function(N, scale, X, Y, shape="crescent"): 15 | """Function that is 1 on a set and 0 outside of it""" 16 | shapes = ["crescent", "cylinder", "hexagon", "superquadric", "smiley"] 17 | 18 | if shape not in shapes: 19 | shape = "crescent" 20 | 21 | if shape == "cylinder": 22 | Z = np.ones_like(X) 23 | Z[X**2 + Y**2 < 0.5] = 0 24 | Z[X**2 + Y**2 > 2] = 0 25 | 26 | if shape == "superquadric": 27 | Z = np.ones_like(X) 28 | Z[np.abs(X)**0.5 + np.abs(Y)**0.5 > 1.5] = 0 29 | 30 | if shape == "hexagon": 31 | Z = np.ones_like(X) 32 | hexa = 2*np.abs(X) + np.abs(X - Y*np.sqrt(3)) +\ 33 | np.abs(X + Y*np.sqrt(3)) 34 | Z[hexa > 6] = 0 35 | 36 | if shape == "crescent": 37 | c = 2 38 | d = -1 39 | e = 1 40 | f = 0.5 41 | k = 1.2 42 | shift = 10 43 | Z = (c**2 - (X/e - d)**2 - (Y/f)**2)**2 + k*(c + d - X/e)**3 - shift 44 | Z = 1 - np.maximum(np.sign(Z), 0) 45 | 46 | if shape == "smiley": 47 | Z = np.ones_like(X) 48 | fac = 1.2 49 | x_eye = 0.5 50 | y_eye = 0.4 51 | bicorn = fac**2*(Y + 0.3)**2*(1 - fac**2*X**2) -\ 52 | (fac**2*X**2 - 2*fac*(Y + 0.3) - 1)**2 53 | left_eye = (X + x_eye)**2/0.1 + (Y - y_eye)**2/0.4 - 1 54 | right_eye = (X - x_eye)**2/0.1 + (Y - y_eye)**2/0.4 - 1 55 | Z[X**2 + Y**2 > 2] = 0 56 | Z[bicorn > 0] = 0 57 | Z[left_eye < 0] = 0 58 | Z[right_eye < 0] = 0 59 | 60 | 61 | Z = scale * Z 62 | return Z 63 | 64 | 65 | def data_gen(num): 66 | # Solve the heat equation with zero boundary conditions 67 | for cont in range(ntime_anim): 68 | Z[1:N-1, 1:N-1] = Z[1:N-1, 1:N-1] + dt*(Z[2:N, 1:N-1] + 69 | Z[0:N-2, 1:N-1] + Z[1:N-1, 0:N-2] + 70 | Z[1:N-1, 2:N] - 4*Z[1:N-1, 1:N-1])/dx**2 71 | 72 | surf = mlab.surf(X, Y, Z, colormap='autumn', warp_scale=1) 73 | # Change the visualization parameters. 74 | surf.actor.property.interpolation = 'phong' 75 | surf.actor.property.specular = 0.3 76 | surf.actor.property.specular_power = 20 77 | surf.module_manager.scalar_lut_manager.reverse_lut = True 78 | surf.module_manager.scalar_lut_manager.data_range = np.array([ 0., scale]) 79 | 80 | return surf 81 | 82 | 83 | N = 500 # Grid points 84 | L = 2.5 # Box size 85 | X, Y = np.mgrid[-L:L:N*1j, -L:L:N*1j] 86 | scale = 2 87 | Z = step_function(N, scale, X, Y, shape="smiley") 88 | CFL = 0.125 89 | dx = X[1, 0] - X[0, 0] 90 | dy = dx 91 | dt = CFL*dx**2 92 | end_time = 0.05 93 | time = np.arange(0, end_time, dt) 94 | nframes = 50 95 | ntime = time.shape[0] 96 | ntime_anim = int(ntime/nframes) 97 | 98 | #%% Plot frames 99 | fname = "heat_smiley" 100 | bgcolor = (1, 1, 1) 101 | fig = mlab.figure(size=(1200, 1000), bgcolor=bgcolor) 102 | fig.scene.camera.azimuth(180) 103 | mlab.get_engine() 104 | engine = mlab.get_engine() 105 | scene = engine.scenes[0] 106 | for cont in range(nframes): 107 | mlab.clf() 108 | surf = data_gen(cont) 109 | scene.scene.camera.position = [-8, -8, 7] 110 | scene.scene.camera.clipping_range = [7, 22] 111 | scene.scene.camera.focal_point = [0, 0, 1] 112 | print(cont) 113 | mlab.savefig("{}_{n:02d}.png".format(fname, n=cont)) 114 | 115 | 116 | -------------------------------------------------------------------------------- /examples/heat_smiley.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicoguaro/AdvancedMath/2749068de442f67b89d3f57827367193ce61a09c/examples/heat_smiley.gif -------------------------------------------------------------------------------- /examples/wave.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicoguaro/AdvancedMath/2749068de442f67b89d3f57827367193ce61a09c/examples/wave.gif -------------------------------------------------------------------------------- /examples/wave_cylinder.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicoguaro/AdvancedMath/2749068de442f67b89d3f57827367193ce61a09c/examples/wave_cylinder.gif -------------------------------------------------------------------------------- /examples/wave_daniel.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicoguaro/AdvancedMath/2749068de442f67b89d3f57827367193ce61a09c/examples/wave_daniel.gif -------------------------------------------------------------------------------- /examples/wave_hexa.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicoguaro/AdvancedMath/2749068de442f67b89d3f57827367193ce61a09c/examples/wave_hexa.gif -------------------------------------------------------------------------------- /examples/wave_iterations.py: -------------------------------------------------------------------------------- 1 | """ 2 | Illustration of the wave 3 | 4 | Solve the wave equation using finite differences and Forward Euler. 5 | 6 | Based on: https://commons.wikimedia.org/wiki/File:Heat_eqn.gif 7 | 8 | """ 9 | from __future__ import division, print_function 10 | import numpy as np 11 | from scipy.ndimage import gaussian_filter 12 | from mayavi import mlab 13 | 14 | 15 | def step_function(N, scale, X, Y, shape="crescent"): 16 | """Function that is 1 on a set and 0 outside of it""" 17 | shapes = ["crescent", "cylinder", "hexagon", "superquadric", "smiley"] 18 | 19 | if shape not in shapes: 20 | shape = "crescent" 21 | 22 | if shape == "cylinder": 23 | Z = np.ones_like(X) 24 | Z[X**2 + Y**2 < 0.5] = 0 25 | Z[X**2 + Y**2 > 2] = 0 26 | 27 | if shape == "superquadric": 28 | Z = np.ones_like(X) 29 | Z[np.abs(X)**0.5 + np.abs(Y)**0.5 > 1.5] = 0 30 | 31 | if shape == "hexagon": 32 | Z = np.ones_like(X) 33 | hexa = 2*np.abs(X) + np.abs(X - Y*np.sqrt(3)) +\ 34 | np.abs(X + Y*np.sqrt(3)) 35 | Z[hexa > 6] = 0 36 | 37 | if shape == "crescent": 38 | c = 2 39 | d = -1 40 | e = 1 41 | f = 0.5 42 | k = 1.2 43 | shift = 10 44 | Z = (c**2 - (X/e - d)**2 - (Y/f)**2)**2 + k*(c + d - X/e)**3 - shift 45 | Z = 1 - np.maximum(np.sign(Z), 0) 46 | 47 | if shape == "smiley": 48 | Z = np.ones_like(X) 49 | fac = 1.2 50 | x_eye = 0.5 51 | y_eye = 0.4 52 | bicorn = fac**2*(Y + 0.3)**2*(1 - fac**2*X**2) -\ 53 | (fac**2*X**2 - 2*fac*(Y + 0.3) - 1)**2 54 | left_eye = (X + x_eye)**2/0.1 + (Y - y_eye)**2/0.4 - 1 55 | right_eye = (X - x_eye)**2/0.1 + (Y - y_eye)**2/0.4 - 1 56 | Z[X**2 + Y**2 > 2] = 0 57 | Z[bicorn > 0] = 0 58 | Z[left_eye < 0] = 0 59 | Z[right_eye < 0] = 0 60 | 61 | 62 | Z = scale * Z 63 | return Z 64 | 65 | 66 | def data_gen(num): 67 | # Solve the wave equation with zero boundary conditions 68 | for cont in range(ntime_anim): 69 | Z_aux = Z.copy() 70 | Z[1:N-1, 1:N-1] = 2*Z[1:N-1, 1:N-1] - Z0[1:N-1, 1:N-1] +\ 71 | (dt/dx)**2*(Z[2:N, 1:N-1] + 72 | Z[0:N-2, 1:N-1] + Z[1:N-1, 0:N-2] + 73 | Z[1:N-1, 2:N] - 4*Z[1:N-1, 1:N-1]) 74 | Z0[:] = Z_aux[:] 75 | 76 | surf = mlab.surf(X, Y, Z, colormap='summer', warp_scale=1) 77 | # Change the visualization parameters. 78 | surf.actor.property.interpolation = 'phong' 79 | surf.actor.property.specular = 0.3 80 | surf.actor.property.specular_power = 20 81 | surf.module_manager.scalar_lut_manager.reverse_lut = True 82 | surf.module_manager.scalar_lut_manager.data_range = np.array([ 0., scale]) 83 | 84 | return surf 85 | 86 | 87 | N = 500 # Grid points 88 | L = 2.5 # Box size 89 | end_time = 2.0 90 | nframes = 50 91 | scale = 2 92 | CFL = 0.1 93 | X, Y = np.mgrid[-L:L:N*1j, -L:L:N*1j] 94 | dx = X[1, 0] - X[0, 0] 95 | dt = CFL*dx 96 | time = np.arange(0, end_time, dt) 97 | ntime = time.shape[0] 98 | ntime_anim = int(ntime/nframes) 99 | Z0 = step_function(N, scale, X, Y, shape="crescent") 100 | Z0 = gaussian_filter(Z0, sigma=4) 101 | Z = np.zeros_like(Z0) 102 | # First iteration 103 | Z[1:N-1, 1:N-1] = Z0[1:N-1, 1:N-1] + 0.5*(dt/dx)**2*(Z0[2:N, 1:N-1] + 104 | Z0[0:N-2, 1:N-1] + Z0[1:N-1, 0:N-2] + 105 | Z0[1:N-1, 2:N] - 4*Z0[1:N-1, 1:N-1]) 106 | 107 | 108 | #%% Plot frames 109 | fname = "wave" 110 | bgcolor = (1, 1, 1) 111 | fig = mlab.figure(size=(1200, 1000), bgcolor=bgcolor) 112 | fig.scene.camera.azimuth(180) 113 | mlab.get_engine() 114 | engine = mlab.get_engine() 115 | scene = engine.scenes[0] 116 | for cont in range(nframes): 117 | mlab.clf() 118 | surf = data_gen(cont) 119 | scene.scene.camera.position = [-8, -8, 7] 120 | scene.scene.camera.clipping_range = [7, 22] 121 | scene.scene.camera.focal_point = [0, 0, 1] 122 | print(cont) 123 | mlab.savefig("{}_{n:02d}.png".format(fname, n=cont)) 124 | 125 | print("Done!") 126 | -------------------------------------------------------------------------------- /examples/wave_smiley.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicoguaro/AdvancedMath/2749068de442f67b89d3f57827367193ce61a09c/examples/wave_smiley.gif -------------------------------------------------------------------------------- /notebooks/nst_arpeggios_c_audio.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicoguaro/AdvancedMath/2749068de442f67b89d3f57827367193ce61a09c/notebooks/nst_arpeggios_c_audio.wav -------------------------------------------------------------------------------- /notebooks/styles/custom_barba.css: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 70 | 85 | 86 | 87 | -------------------------------------------------------------------------------- /notebooks/styles/custom_ketch.css: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 112 | 113 | 114 | -------------------------------------------------------------------------------- /notebooks/vector_calculus-mayavi.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "metadata": {}, 6 | "source": [ 7 | "# Coordinate systems" 8 | ] 9 | }, 10 | { 11 | "cell_type": "markdown", 12 | "metadata": {}, 13 | "source": [ 14 | "## Introduction\n", 15 | "\n", 16 | "This notebooks provides a tutorial about (curvilinear) coordinate systems. We use Mayavi to do the visualization of some of the surface for constant coordinate values.\n", 17 | "\n", 18 | "\n", 19 | "\n", 20 | "### Use of Mayavi in this notebook\n", 21 | "Mayavi can display either images or X3D elements on the notebook. The images are static and one cannot interact with them. The X3D output produces a fully interactive 3D scene. For information on how to interact with the scene, see here: http://www.x3dom.org/documentation/interaction/\n", 22 | "\n", 23 | "Mayavi ships with some javascript files that can be installed as:\n", 24 | "\n", 25 | " $ jupyter nbextension install --py mayavi --user\n", 26 | "\n", 27 | "This will install the x3dom Javascript and CSS files locally. Note that you do not need to “enable” the extension or anything after you run the above. For more instructions and options see the Installation of Jupyter Extensions. Doing this allows one to view X3D files without a network connection.\n", 28 | "\n", 29 | "To view Mayavi visualizations on the notebook one should first do:\n", 30 | "\n", 31 | " from mayavi import mlab\n", 32 | " mlab.init_notebook()\n", 33 | "\n", 34 | " Subequently, one may simply do:\n", 35 | "\n", 36 | " s = mlab.test_plot3d()\n", 37 | " s\n", 38 | "\n", 39 | "When the init_notebook method is called it configures the Mayavi objects so they can be rendered on the Jupyter notebook.\n", 40 | "\n", 41 | "**More information:** http://docs.enthought.com/mayavi/mayavi/tips.html" 42 | ] 43 | }, 44 | { 45 | "cell_type": "code", 46 | "execution_count": 1, 47 | "metadata": {}, 48 | "outputs": [], 49 | "source": [ 50 | "from mayavi import mlab\n", 51 | "import numpy as np" 52 | ] 53 | }, 54 | { 55 | "cell_type": "code", 56 | "execution_count": 2, 57 | "metadata": {}, 58 | "outputs": [ 59 | { 60 | "name": "stdout", 61 | "output_type": "stream", 62 | "text": [ 63 | "Notebook initialized with ipy backend.\n" 64 | ] 65 | } 66 | ], 67 | "source": [ 68 | "mlab.init_notebook()" 69 | ] 70 | }, 71 | { 72 | "cell_type": "code", 73 | "execution_count": 3, 74 | "metadata": {}, 75 | "outputs": [], 76 | "source": [ 77 | "red = (0.9, 0.1, 0.1)\n", 78 | "blue = (0.2, 0.5, 0.7)\n", 79 | "green = (0.3, 0.7, 0.3)" 80 | ] 81 | }, 82 | { 83 | "cell_type": "markdown", 84 | "metadata": {}, 85 | "source": [ 86 | "## Cylindrical coordinates\n", 87 | "\n", 88 | "The [ISO standard 80000-2](https://en.wikipedia.org/wiki/ISO_80000-2) recommends the use of $(ρ, φ, z)$, where $ρ$ is the radial coordinate, $\\varphi$ the azimuth, and $z$ the height.\n", 89 | "\n", 90 | "For the conversion between cylindrical and Cartesian coordinates, it is convenient to assume that the reference plane of the former is the Cartesian $xy$-plane (with equation $z=0$, and the cylindrical axis is the Cartesian $z$-axis. Then the $z$-coordinate is the same in both systems, and the correspondence between cylindrical $(\\rho, \\varphi)$ and Cartesian $(x, y)$ are the same as for polar coordinates, namely\n", 91 | "\n", 92 | "\\begin{align}\n", 93 | "x &= \\rho \\cos \\varphi \\\\\n", 94 | "y &= \\rho \\sin \\varphi\n", 95 | "\\end{align}\n", 96 | "\n", 97 | "in one direction, and\n", 98 | "\n", 99 | "\\begin{align}\n", 100 | " \\rho &= \\sqrt{x^2+y^2} \\\\\n", 101 | " \\varphi &= \\begin{cases}\n", 102 | " 0 & \\mbox{if } x = 0 \\mbox{ and } y = 0\\\\\n", 103 | " \\arcsin\\left(\\frac{y}{\\rho}\\right) & \\mbox{if } x \\geq 0 \\\\\t\n", 104 | " \\arctan\\left(\\frac{y}{x}\\right) & \\mbox{if } x > 0 \\\\\t\n", 105 | " -\\arcsin\\left(\\frac{y}{\\rho}\\right) + \\pi & \\mbox{if } x < 0\n", 106 | " \\end{cases}\n", 107 | "\\end{align}\n", 108 | "\n", 109 | "in the other. It is also common to use [$\\varphi = atan2(y, x)$](https://en.wikipedia.org/wiki/Atan2).\n" 110 | ] 111 | }, 112 | { 113 | "cell_type": "code", 114 | "execution_count": 4, 115 | "metadata": {}, 116 | "outputs": [], 117 | "source": [ 118 | "cyl = mlab.figure(bgcolor=(1.0, 1.0, 1.0))\n", 119 | "mlab.clf()" 120 | ] 121 | }, 122 | { 123 | "cell_type": "code", 124 | "execution_count": 5, 125 | "metadata": {}, 126 | "outputs": [], 127 | "source": [ 128 | "# Cylinder\n", 129 | "phi, z = np.mgrid[0:2*np.pi:31j, -2:2*np.pi:31j]\n", 130 | "x = 2*np.cos(phi)\n", 131 | "y = 2*np.sin(phi)\n", 132 | "z = z\n", 133 | "cylinder = mlab.mesh(x, y, z, color=red)" 134 | ] 135 | }, 136 | { 137 | "cell_type": "code", 138 | "execution_count": 6, 139 | "metadata": {}, 140 | "outputs": [], 141 | "source": [ 142 | "# Vertical plane\n", 143 | "rho, z = np.mgrid[0:3:31j, -2:2*np.pi:31j]\n", 144 | "x = rho*np.cos(np.pi/4)\n", 145 | "y = rho*np.sin(np.pi/4)\n", 146 | "z = z\n", 147 | "plane = mlab.mesh(x, y, z, color=blue, opacity=0.6)" 148 | ] 149 | }, 150 | { 151 | "cell_type": "code", 152 | "execution_count": 7, 153 | "metadata": {}, 154 | "outputs": [], 155 | "source": [ 156 | "# Horizontal plane\n", 157 | "rho, phi = np.mgrid[0:3:31j, 0:2*np.pi:31j]\n", 158 | "x = rho*np.cos(phi)\n", 159 | "y = rho*np.sin(phi)\n", 160 | "z = np.ones_like(x)\n", 161 | "plane = mlab.mesh(x, y, z, color=green, opacity=0.6)" 162 | ] 163 | }, 164 | { 165 | "cell_type": "code", 166 | "execution_count": 8, 167 | "metadata": {}, 168 | "outputs": [ 169 | { 170 | "data": { 171 | "application/vnd.jupyter.widget-view+json": { 172 | "model_id": "7f72429634e64c6b871611c66069b72f", 173 | "version_major": 2, 174 | "version_minor": 0 175 | }, 176 | "text/plain": [ 177 | "Image(value=b'\\x89PNG\\r\\n\\x1a\\n\\x00\\x00\\x00\\rIHDR\\x00\\x00\\x01\\x90\\x00\\x00\\x01^\\x08\\x02\\x00\\x00\\x00$?\\xde_\\x00\\…" 178 | ] 179 | }, 180 | "metadata": {}, 181 | "output_type": "display_data" 182 | } 183 | ], 184 | "source": [ 185 | "cyl" 186 | ] 187 | }, 188 | { 189 | "cell_type": "markdown", 190 | "metadata": {}, 191 | "source": [ 192 | "## Spherical coordinates\n", 193 | "\n", 194 | "\n", 195 | "The use of $(r, θ, φ)$ to denote radial distance, inclination (or elevation), and azimuth, respectively, is common practice in physics, and is specified by [ISO standard 80000-2](https://en.wikipedia.org/wiki/ISO_80000-2).\n", 196 | "\n", 197 | "\n", 198 | "The spherical coordinates of a point can be obtained from its [Cartesian coordinate system](https://en.wikipedia.org/wiki/ISO_80000-2) $(x, y, z)$\n", 199 | "\n", 200 | "\\begin{align}\n", 201 | "r&=\\sqrt{x^2 + y^2 + z^2} \\\\\n", 202 | "\\theta &= \\arccos\\frac{z}{\\sqrt{x^2 + y^2 + z^2}} = \\arccos\\frac{z}{r} \\\\\n", 203 | "\\varphi &= \\arctan \\frac{y}{x}\n", 204 | "\\end{align}\n", 205 | "\n", 206 | "The inverse tangent denoted in $\\varphi = \\arctan\\left(\\frac{y}{x}\\right)$ must be suitably defined , taking into account the correct quadrant of $(x, y)$ (using the function ``atan2``).\n", 207 | "\n", 208 | "Conversely, the Cartesian coordinates may be retrieved from the spherical coordinates (_radius_ $r$, _inclination_ $\\theta$, _azimuth_ $\\varphi$), where $r \\in [0, \\infty)$, $\\theta \\in [0, \\pi]$ and $\\varphi \\in [0, 2\\pi)$, by:\n", 209 | "\n", 210 | "\\begin{align}\n", 211 | "x&=r \\, \\sin\\theta \\, \\cos\\varphi \\\\\n", 212 | "y&=r \\, \\sin\\theta \\, \\sin\\varphi \\\\\n", 213 | "z&=r \\, \\cos\\theta\n", 214 | "\\end{align}" 215 | ] 216 | }, 217 | { 218 | "cell_type": "code", 219 | "execution_count": 9, 220 | "metadata": {}, 221 | "outputs": [], 222 | "source": [ 223 | "sph = mlab.figure(bgcolor=(1.0, 1.0, 1.0))\n", 224 | "mlab.clf()\n", 225 | "theta, phi = np.mgrid[0:np.pi:21j, 0:np.pi:21j]" 226 | ] 227 | }, 228 | { 229 | "cell_type": "code", 230 | "execution_count": 10, 231 | "metadata": {}, 232 | "outputs": [], 233 | "source": [ 234 | "# Sphere\n", 235 | "x = np.sin(phi) * np.cos(theta)\n", 236 | "y = np.sin(phi) * np.sin(theta)\n", 237 | "z = np.cos(phi)\n", 238 | "sphere = mlab.mesh(x, y, z, color=red)\n", 239 | "spher2e = mlab.mesh(-x, -y, z,representation='wireframe', color=red)" 240 | ] 241 | }, 242 | { 243 | "cell_type": "code", 244 | "execution_count": 11, 245 | "metadata": {}, 246 | "outputs": [], 247 | "source": [ 248 | "# Cone\n", 249 | "x = theta/3 * np.cos(phi)\n", 250 | "y = theta/3 * np.sin(phi)\n", 251 | "z = theta/3\n", 252 | "cone = mlab.mesh(x, y, z, color=blue, opacity=0.6)\n", 253 | "cone2 = mlab.mesh(-x, -y, z, representation='wireframe', color=blue)" 254 | ] 255 | }, 256 | { 257 | "cell_type": "code", 258 | "execution_count": 12, 259 | "metadata": {}, 260 | "outputs": [], 261 | "source": [ 262 | "# Plane\n", 263 | "x = theta/np.pi\n", 264 | "y = theta/np.pi\n", 265 | "z = phi - np.pi/2\n", 266 | "plane = mlab.mesh(x, y, z, color=green)" 267 | ] 268 | }, 269 | { 270 | "cell_type": "code", 271 | "execution_count": 13, 272 | "metadata": { 273 | "scrolled": true 274 | }, 275 | "outputs": [ 276 | { 277 | "data": { 278 | "application/vnd.jupyter.widget-view+json": { 279 | "model_id": "e0b80c4e18134493be7612b38d0e00e0", 280 | "version_major": 2, 281 | "version_minor": 0 282 | }, 283 | "text/plain": [ 284 | "Image(value=b'\\x89PNG\\r\\n\\x1a\\n\\x00\\x00\\x00\\rIHDR\\x00\\x00\\x01\\x90\\x00\\x00\\x01^\\x08\\x02\\x00\\x00\\x00$?\\xde_\\x00\\…" 285 | ] 286 | }, 287 | "metadata": {}, 288 | "output_type": "display_data" 289 | } 290 | ], 291 | "source": [ 292 | "sph" 293 | ] 294 | }, 295 | { 296 | "cell_type": "markdown", 297 | "metadata": {}, 298 | "source": [ 299 | "## Ellipsoidal coordinates" 300 | ] 301 | }, 302 | { 303 | "cell_type": "code", 304 | "execution_count": null, 305 | "metadata": {}, 306 | "outputs": [], 307 | "source": [ 308 | "ellip = mlab.figure(bgcolor=(1.0, 1.0, 1.0))\n", 309 | "mlab.clf()\n", 310 | "v, theta = np.mgrid[0:np.pi/2:21j, 0:np.pi:21j]\n", 311 | "a = 3\n", 312 | "b = 2\n", 313 | "c = 1" 314 | ] 315 | }, 316 | { 317 | "cell_type": "code", 318 | "execution_count": null, 319 | "metadata": {}, 320 | "outputs": [], 321 | "source": [ 322 | "# Ellipsoid\n", 323 | "lam = 3\n", 324 | "x = np.sqrt(a**2 + lam) * np.cos(v) * np.cos(theta)\n", 325 | "y = np.sqrt(b**2 + lam)* np.cos(v) * np.sin(theta)\n", 326 | "z = np.sqrt(c**2 + lam) * np.sin(v)\n", 327 | "ellipsoid = mlab.mesh(x, y, z, color=red)\n", 328 | "ellipsoid2 = mlab.mesh(x, y, -z, color=red)\n", 329 | "ellipsoid3 = mlab.mesh(x, -y, z, representation='wireframe', color=red)\n", 330 | "ellipsoid4 = mlab.mesh(x, -y, -z, representation='wireframe', color=red)" 331 | ] 332 | }, 333 | { 334 | "cell_type": "code", 335 | "execution_count": null, 336 | "metadata": {}, 337 | "outputs": [], 338 | "source": [ 339 | "# Hyperboloid of one sheet\n", 340 | "mu = 2\n", 341 | "x = np.sqrt(a**2 + mu) * np.cosh(v) * np.cos(theta)\n", 342 | "y = np.sqrt(b**2 + mu) * np.cosh(v) * np.sin(theta)\n", 343 | "z = np.sqrt(c**2 + mu) * np.sinh(v)\n", 344 | "z = np.sqrt(c**2 + mu) * np.sinh(v)\n", 345 | "hyper = mlab.mesh(x, y, z, color=blue)\n", 346 | "hyper2 = mlab.mesh(x, y, -z, color=blue)\n", 347 | "hyper3 = mlab.mesh(x, -y, z, representation='wireframe', color=blue)\n", 348 | "hyper4 = mlab.mesh(x, -y, -z, representation='wireframe', color=blue)" 349 | ] 350 | }, 351 | { 352 | "cell_type": "code", 353 | "execution_count": null, 354 | "metadata": {}, 355 | "outputs": [], 356 | "source": [ 357 | "# Hyperboloid of two sheets\n", 358 | "nu = 1\n", 359 | "x = np.sqrt(a**2 + nu) * np.cosh(v)\n", 360 | "y = np.sqrt(c**2 + nu) * np.sinh(v) * np.sin(theta)\n", 361 | "z = np.sqrt(b**2 + nu) * np.sinh(v) * np.cos(theta)\n", 362 | "hyper_up = mlab.mesh(x, y, z, color=green)\n", 363 | "hyper_down = mlab.mesh(-x, y, z, color=green)\n", 364 | "hyper_up2 = mlab.mesh(x, -y, z, representation='wireframe', color=green)\n", 365 | "hyper_down2 = mlab.mesh(-x, -y, z, representation='wireframe', color=green)" 366 | ] 367 | }, 368 | { 369 | "cell_type": "code", 370 | "execution_count": null, 371 | "metadata": {}, 372 | "outputs": [], 373 | "source": [ 374 | "ellip" 375 | ] 376 | }, 377 | { 378 | "cell_type": "markdown", 379 | "metadata": {}, 380 | "source": [ 381 | "## References\n", 382 | "\n", 383 | "\n", 384 | "1. Wikipedia contributors. [\"Cylindrical coordinate system.\"](https://en.wikipedia.org/wiki/Cylindrical_coordinate_system) Wikipedia, The Free Encyclopedia. Wikipedia, The Free Encyclopedia, 12 Dec. 2016. Web. 9 Feb. 2017.\n", 385 | "\n", 386 | "2. Wikipedia contributors. [\"Spherical coordinate system.\"](https://en.wikipedia.org/wiki/Spherical_coordinate_system) Wikipedia, The Free Encyclopedia. Wikipedia, The Free Encyclopedia, 29 Jan. 2017. Web. 9 Feb. 2017.\n", 387 | "\n", 388 | "3. Enthought Inc. [Mayavi: Tips and Trick](http://docs.enthought.com/mayavi/mayavi/tips.html). Web. 9 Feb. 2017." 389 | ] 390 | }, 391 | { 392 | "cell_type": "code", 393 | "execution_count": null, 394 | "metadata": {}, 395 | "outputs": [], 396 | "source": [] 397 | }, 398 | { 399 | "cell_type": "code", 400 | "execution_count": null, 401 | "metadata": {}, 402 | "outputs": [], 403 | "source": [ 404 | "from IPython.core.display import HTML\n", 405 | "def css_styling():\n", 406 | " styles = open('./styles/custom_barba.css', 'r').read()\n", 407 | " return HTML(styles)\n", 408 | "css_styling()" 409 | ] 410 | }, 411 | { 412 | "cell_type": "code", 413 | "execution_count": null, 414 | "metadata": {}, 415 | "outputs": [], 416 | "source": [] 417 | } 418 | ], 419 | "metadata": { 420 | "anaconda-cloud": {}, 421 | "kernelspec": { 422 | "display_name": "Python 3", 423 | "language": "python", 424 | "name": "python3" 425 | }, 426 | "varInspector": { 427 | "cols": { 428 | "lenName": 16, 429 | "lenType": 16, 430 | "lenVar": 40 431 | }, 432 | "kernels_config": { 433 | "python": { 434 | "delete_cmd_postfix": "", 435 | "delete_cmd_prefix": "del ", 436 | "library": "var_list.py", 437 | "varRefreshCmd": "print(var_dic_list())" 438 | }, 439 | "r": { 440 | "delete_cmd_postfix": ") ", 441 | "delete_cmd_prefix": "rm(", 442 | "library": "var_list.r", 443 | "varRefreshCmd": "cat(var_dic_list()) " 444 | } 445 | }, 446 | "types_to_exclude": [ 447 | "module", 448 | "function", 449 | "builtin_function_or_method", 450 | "instance", 451 | "_Feature" 452 | ], 453 | "window_display": false 454 | } 455 | }, 456 | "nbformat": 4, 457 | "nbformat_minor": 1 458 | } 459 | -------------------------------------------------------------------------------- /notebooks/vector_calculus-pyvista.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "metadata": {}, 6 | "source": [ 7 | "# Coordinate systems" 8 | ] 9 | }, 10 | { 11 | "cell_type": "markdown", 12 | "metadata": {}, 13 | "source": [ 14 | "## Introduction" 15 | ] 16 | }, 17 | { 18 | "cell_type": "markdown", 19 | "metadata": {}, 20 | "source": [ 21 | "This notebooks provides examples of curvilinear coordinates. Particularly,\n", 22 | "it presents the coordinate surfaces for three common coordinate systems." 23 | ] 24 | }, 25 | { 26 | "cell_type": "markdown", 27 | "metadata": {}, 28 | "source": [ 29 | "### Use of PyVista in this notebook" 30 | ] 31 | }, 32 | { 33 | "cell_type": "markdown", 34 | "metadata": {}, 35 | "source": [ 36 | "We use `PyVista` to represent the coordinate surfaces and `ìtkwidgets`\n", 37 | "to render them interactively in the notebook.\n", 38 | "\n", 39 | "If installing things manually, the following would be required\n", 40 | "\n", 41 | "\n", 42 | " conda install -c conda-forge pyvista\n", 43 | " conda install -c conda-forge itkwidgets\n", 44 | "\n", 45 | "\n", 46 | "**More information:** https://docs.pyvista.org/examples/index.html" 47 | ] 48 | }, 49 | { 50 | "cell_type": "code", 51 | "execution_count": 1, 52 | "metadata": {}, 53 | "outputs": [], 54 | "source": [ 55 | "import numpy as np\n", 56 | "import pyvista as pv\n", 57 | "from itkwidgets import view" 58 | ] 59 | }, 60 | { 61 | "cell_type": "code", 62 | "execution_count": 2, 63 | "metadata": {}, 64 | "outputs": [], 65 | "source": [ 66 | "red = (0.9, 0.1, 0.1)\n", 67 | "blue = (0.2, 0.5, 0.7)\n", 68 | "green = (0.3, 0.7, 0.3)" 69 | ] 70 | }, 71 | { 72 | "cell_type": "markdown", 73 | "metadata": {}, 74 | "source": [ 75 | "## Cylindrical coordinates\n" 76 | ] 77 | }, 78 | { 79 | "cell_type": "markdown", 80 | "metadata": {}, 81 | "source": [ 82 | "The [ISO standard 80000-2](https://en.wikipedia.org/wiki/ISO_80000-2) recommends the use of $(ρ, φ, z)$, where $ρ$ is the radial coordinate, $\\varphi$ the azimuth, and $z$ the height.\n", 83 | "\n", 84 | "For the conversion between cylindrical and Cartesian coordinates, it is convenient to assume that the reference plane of the former is the Cartesian $xy$-plane (with equation $z=0$, and the cylindrical axis is the Cartesian $z$-axis. Then the $z$-coordinate is the same in both systems, and the correspondence between cylindrical $(\\rho, \\varphi)$ and Cartesian $(x, y)$ are the same as for polar coordinates, namely\n", 85 | "\n", 86 | "\\begin{align}\n", 87 | "x &= \\rho \\cos \\varphi \\\\\n", 88 | "y &= \\rho \\sin \\varphi\n", 89 | "\\end{align}\n", 90 | "\n", 91 | "in one direction, and\n", 92 | "\n", 93 | "\\begin{align}\n", 94 | " \\rho &= \\sqrt{x^2+y^2} \\\\\n", 95 | " \\varphi &= \\begin{cases}\n", 96 | " 0 & \\mbox{if } x = 0 \\mbox{ and } y = 0\\\\\n", 97 | " \\arcsin\\left(\\frac{y}{\\rho}\\right) & \\mbox{if } x \\geq 0 \\\\\t\n", 98 | " \\arctan\\left(\\frac{y}{x}\\right) & \\mbox{if } x > 0 \\\\\t\n", 99 | " -\\arcsin\\left(\\frac{y}{\\rho}\\right) + \\pi & \\mbox{if } x < 0\n", 100 | " \\end{cases}\n", 101 | "\\end{align}\n", 102 | "\n", 103 | "in the other. It is also common to use [$\\varphi = \\mathrm{atan2}(y, x)$](https://en.wikipedia.org/wiki/Atan2)." 104 | ] 105 | }, 106 | { 107 | "cell_type": "code", 108 | "execution_count": 3, 109 | "metadata": {}, 110 | "outputs": [], 111 | "source": [ 112 | "# Cylinder\n", 113 | "phi, z = np.mgrid[0:2*np.pi:31j, -2:2*np.pi:31j]\n", 114 | "x = 2*np.cos(phi)\n", 115 | "y = 2*np.sin(phi)\n", 116 | "cylinder = pv.StructuredGrid(x, y, z)" 117 | ] 118 | }, 119 | { 120 | "cell_type": "code", 121 | "execution_count": 4, 122 | "metadata": {}, 123 | "outputs": [], 124 | "source": [ 125 | "# Vertical plane\n", 126 | "rho, z = np.mgrid[0:3:31j, -2:2*np.pi:31j]\n", 127 | "x = rho*np.cos(np.pi/4)\n", 128 | "y = rho*np.sin(np.pi/4)\n", 129 | "vert_plane = pv.StructuredGrid(x, y, z)" 130 | ] 131 | }, 132 | { 133 | "cell_type": "code", 134 | "execution_count": 5, 135 | "metadata": {}, 136 | "outputs": [], 137 | "source": [ 138 | "# Horizontal plane\n", 139 | "rho, phi = np.mgrid[0:3:31j, 0:2*np.pi:31j]\n", 140 | "x = rho*np.cos(phi)\n", 141 | "y = rho*np.sin(phi)\n", 142 | "z = np.ones_like(x)\n", 143 | "hor_plane = pv.StructuredGrid(x, y, z)" 144 | ] 145 | }, 146 | { 147 | "cell_type": "code", 148 | "execution_count": 6, 149 | "metadata": {}, 150 | "outputs": [ 151 | { 152 | "data": { 153 | "application/vnd.jupyter.widget-view+json": { 154 | "model_id": "29a27643a8434035b33c11db8da76bec", 155 | "version_major": 2, 156 | "version_minor": 0 157 | }, 158 | "text/plain": [ 159 | "Viewer(geometries=[{'vtkClass': 'vtkPolyData', 'points': {'vtkClass': 'vtkPoints', 'name': '_points', 'numberO…" 160 | ] 161 | }, 162 | "metadata": {}, 163 | "output_type": "display_data" 164 | } 165 | ], 166 | "source": [ 167 | "view(geometries=[cylinder, vert_plane, hor_plane],\n", 168 | " geometry_colors=[blue, red, green])" 169 | ] 170 | }, 171 | { 172 | "cell_type": "markdown", 173 | "metadata": {}, 174 | "source": [ 175 | "## Spherical coordinates" 176 | ] 177 | }, 178 | { 179 | "cell_type": "markdown", 180 | "metadata": {}, 181 | "source": [ 182 | "The use of $(r, θ, φ)$ to denote radial distance, inclination (or elevation), and azimuth, respectively, is common practice in physics, and is specified by [ISO standard 80000-2](https://en.wikipedia.org/wiki/ISO_80000-2).\n", 183 | "\n", 184 | "\n", 185 | "The spherical coordinates of a point can be obtained from its [Cartesian coordinate system](https://en.wikipedia.org/wiki/ISO_80000-2) $(x, y, z)$\n", 186 | "\n", 187 | "\\begin{align}\n", 188 | "r&=\\sqrt{x^2 + y^2 + z^2} \\\\\n", 189 | "\\theta &= \\arccos\\frac{z}{\\sqrt{x^2 + y^2 + z^2}} = \\arccos\\frac{z}{r} \\\\\n", 190 | "\\varphi &= \\arctan \\frac{y}{x}\n", 191 | "\\end{align}\n", 192 | "\n", 193 | "The inverse tangent denoted in $\\varphi = \\arctan\\left(\\frac{y}{x}\\right)$ must be suitably defined , taking into account the correct quadrant of $(x, y)$ (using the function ``atan2``).\n", 194 | "\n", 195 | "Conversely, the Cartesian coordinates may be retrieved from the spherical coordinates (_radius_ $r$, _inclination_ $\\theta$, _azimuth_ $\\varphi$), where $r \\in [0, \\infty)$, $\\theta \\in [0, \\pi]$ and $\\varphi \\in [0, 2\\pi)$, by:\n", 196 | "\n", 197 | "\\begin{align}\n", 198 | "x&=r \\, \\sin\\theta \\, \\cos\\varphi \\\\\n", 199 | "y&=r \\, \\sin\\theta \\, \\sin\\varphi \\\\\n", 200 | "z&=r \\, \\cos\\theta\n", 201 | "\\end{align}" 202 | ] 203 | }, 204 | { 205 | "cell_type": "code", 206 | "execution_count": 7, 207 | "metadata": {}, 208 | "outputs": [], 209 | "source": [ 210 | "theta, phi = np.mgrid[0:np.pi:21j, 0:np.pi:21j]" 211 | ] 212 | }, 213 | { 214 | "cell_type": "code", 215 | "execution_count": 8, 216 | "metadata": {}, 217 | "outputs": [], 218 | "source": [ 219 | "# Sphere\n", 220 | "x = np.sin(phi) * np.cos(theta)\n", 221 | "y = np.sin(phi) * np.sin(theta)\n", 222 | "z = np.cos(phi)\n", 223 | "sphere = pv.StructuredGrid(x, y, z)\n", 224 | "sphere2 = pv.StructuredGrid(-x, -y, z)" 225 | ] 226 | }, 227 | { 228 | "cell_type": "code", 229 | "execution_count": 9, 230 | "metadata": {}, 231 | "outputs": [], 232 | "source": [ 233 | "# Cone\n", 234 | "x = theta/3 * np.cos(phi)\n", 235 | "y = theta/3 * np.sin(phi)\n", 236 | "z = theta/3\n", 237 | "cone = pv.StructuredGrid(x, y, z)\n", 238 | "cone2 = pv.StructuredGrid(-x, -y, z)" 239 | ] 240 | }, 241 | { 242 | "cell_type": "code", 243 | "execution_count": 10, 244 | "metadata": {}, 245 | "outputs": [], 246 | "source": [ 247 | "# Plane\n", 248 | "x = theta/np.pi\n", 249 | "y = theta/np.pi\n", 250 | "z = phi - np.pi/2\n", 251 | "plane = pv.StructuredGrid(x, y, z)" 252 | ] 253 | }, 254 | { 255 | "cell_type": "code", 256 | "execution_count": 11, 257 | "metadata": {}, 258 | "outputs": [ 259 | { 260 | "data": { 261 | "application/vnd.jupyter.widget-view+json": { 262 | "model_id": "99f523032243438d93c4431e154dc150", 263 | "version_major": 2, 264 | "version_minor": 0 265 | }, 266 | "text/plain": [ 267 | "Viewer(geometries=[{'vtkClass': 'vtkPolyData', 'points': {'vtkClass': 'vtkPoints', 'name': '_points', 'numberO…" 268 | ] 269 | }, 270 | "metadata": {}, 271 | "output_type": "display_data" 272 | } 273 | ], 274 | "source": [ 275 | "view(geometries=[sphere, sphere2, cone, cone2, plane],\n", 276 | " geometry_colors=[blue, blue, red, red, green],\n", 277 | " geometry_opacities=[1.0, 0.5, 1.0, 0.5, 1.0])" 278 | ] 279 | }, 280 | { 281 | "cell_type": "markdown", 282 | "metadata": {}, 283 | "source": [ 284 | "## Ellipsoidal coordinates" 285 | ] 286 | }, 287 | { 288 | "cell_type": "code", 289 | "execution_count": 34, 290 | "metadata": {}, 291 | "outputs": [], 292 | "source": [ 293 | "v, theta = np.mgrid[0:np.pi/2:21j, 0:np.pi:21j]\n", 294 | "a = 3\n", 295 | "b = 2\n", 296 | "c = 1" 297 | ] 298 | }, 299 | { 300 | "cell_type": "code", 301 | "execution_count": 30, 302 | "metadata": {}, 303 | "outputs": [], 304 | "source": [ 305 | "# Ellipsoid\n", 306 | "lam = 3\n", 307 | "x = np.sqrt(a**2 + lam) * np.cos(v) * np.cos(theta)\n", 308 | "y = np.sqrt(b**2 + lam)* np.cos(v) * np.sin(theta)\n", 309 | "z = np.sqrt(c**2 + lam) * np.sin(v)\n", 310 | "ellipsoid = pv.StructuredGrid(x, y, z)\n", 311 | "ellipsoid2 = pv.StructuredGrid(x, y, -z)\n", 312 | "ellipsoid3 = pv.StructuredGrid(x, -y, z)\n", 313 | "ellipsoid4 = pv.StructuredGrid(x, -y, -z)" 314 | ] 315 | }, 316 | { 317 | "cell_type": "code", 318 | "execution_count": 31, 319 | "metadata": {}, 320 | "outputs": [], 321 | "source": [ 322 | "# Hyperboloid of one sheet\n", 323 | "mu = 2\n", 324 | "x = np.sqrt(a**2 + mu) * np.cosh(v) * np.cos(theta)\n", 325 | "y = np.sqrt(b**2 + mu) * np.cosh(v) * np.sin(theta)\n", 326 | "z = np.sqrt(c**2 + mu) * np.sinh(v)\n", 327 | "z = np.sqrt(c**2 + mu) * np.sinh(v)\n", 328 | "hyper = pv.StructuredGrid(x, y, z)\n", 329 | "hyper2 = pv.StructuredGrid(x, y, -z)\n", 330 | "hyper3 = pv.StructuredGrid(x, -y, z)\n", 331 | "hyper4 = pv.StructuredGrid(x, -y, -z)" 332 | ] 333 | }, 334 | { 335 | "cell_type": "code", 336 | "execution_count": 32, 337 | "metadata": {}, 338 | "outputs": [], 339 | "source": [ 340 | "# Hyperboloid of two sheets\n", 341 | "nu = 1\n", 342 | "x = np.sqrt(a**2 + nu) * np.cosh(v)\n", 343 | "y = np.sqrt(c**2 + nu) * np.sinh(v) * np.sin(theta)\n", 344 | "z = np.sqrt(b**2 + nu) * np.sinh(v) * np.cos(theta)\n", 345 | "hyper_up = pv.StructuredGrid(x, y, z)\n", 346 | "hyper_down = pv.StructuredGrid(-x, y, z)\n", 347 | "hyper_up2 = pv.StructuredGrid(x, -y, z)\n", 348 | "hyper_down2 = pv.StructuredGrid(-x, -y, z)" 349 | ] 350 | }, 351 | { 352 | "cell_type": "code", 353 | "execution_count": 33, 354 | "metadata": {}, 355 | "outputs": [ 356 | { 357 | "data": { 358 | "application/vnd.jupyter.widget-view+json": { 359 | "model_id": "c7d007e315d6443eae22c9b9655b22e1", 360 | "version_major": 2, 361 | "version_minor": 0 362 | }, 363 | "text/plain": [ 364 | "Viewer(geometries=[{'vtkClass': 'vtkPolyData', 'points': {'vtkClass': 'vtkPoints', 'name': '_points', 'numberO…" 365 | ] 366 | }, 367 | "metadata": {}, 368 | "output_type": "display_data" 369 | } 370 | ], 371 | "source": [ 372 | "view(geometries=[ellipsoid, ellipsoid2, ellipsoid3, ellipsoid4,\n", 373 | " hyper, hyper2, hyper3, hyper4,\n", 374 | " hyper_up, hyper_down, hyper_up2, hyper_down2],\n", 375 | " geometry_colors=[blue]*4 + [red]*4 + [green]*4)" 376 | ] 377 | }, 378 | { 379 | "cell_type": "markdown", 380 | "metadata": {}, 381 | "source": [ 382 | "## References" 383 | ] 384 | }, 385 | { 386 | "cell_type": "markdown", 387 | "metadata": {}, 388 | "source": [ 389 | "1. Wikipedia contributors. [\"Cylindrical coordinate system.\"](https://en.wikipedia.org/wiki/Cylindrical_coordinate_system) Wikipedia, The Free Encyclopedia. Wikipedia, The Free Encyclopedia, 12 Dec. 2016. Web. 9 Feb. 2017.\n", 390 | "\n", 391 | "2. Wikipedia contributors. [\"Spherical coordinate system.\"](https://en.wikipedia.org/wiki/Spherical_coordinate_system) Wikipedia, The Free Encyclopedia. Wikipedia, The Free Encyclopedia, 29 Jan. 2017. Web. 9 Feb. 2017.\n", 392 | "\n", 393 | "3. Sullivan et al., (2019). [PyVista: 3D plotting and mesh analysis through a streamlined interface for the Visualization Toolkit (VTK)](https://joss.theoj.org/papers/10.21105/joss.01450). Journal of Open Source Software, 4(37), 1450, https://doi.org/10.21105/joss.01450" 394 | ] 395 | }, 396 | { 397 | "cell_type": "code", 398 | "execution_count": 17, 399 | "metadata": {}, 400 | "outputs": [ 401 | { 402 | "data": { 403 | "text/html": [ 404 | "\n", 405 | "\n", 406 | "\n", 407 | "\n", 408 | "\n", 473 | "\n", 488 | "\n", 489 | "\n" 490 | ], 491 | "text/plain": [ 492 | "" 493 | ] 494 | }, 495 | "execution_count": 17, 496 | "metadata": {}, 497 | "output_type": "execute_result" 498 | } 499 | ], 500 | "source": [ 501 | "from IPython.core.display import HTML\n", 502 | "def css_styling():\n", 503 | " styles = open('./styles/custom_barba.css', 'r').read()\n", 504 | " return HTML(styles)\n", 505 | "css_styling()" 506 | ] 507 | }, 508 | { 509 | "cell_type": "code", 510 | "execution_count": null, 511 | "metadata": {}, 512 | "outputs": [], 513 | "source": [] 514 | } 515 | ], 516 | "metadata": { 517 | "kernelspec": { 518 | "display_name": "Python 3", 519 | "language": "python", 520 | "name": "python3" 521 | }, 522 | "language_info": { 523 | "codemirror_mode": { 524 | "name": "ipython", 525 | "version": 3 526 | }, 527 | "file_extension": ".py", 528 | "mimetype": "text/x-python", 529 | "name": "python", 530 | "nbconvert_exporter": "python", 531 | "pygments_lexer": "ipython3", 532 | "version": "3.6.7" 533 | }, 534 | "varInspector": { 535 | "cols": { 536 | "lenName": 16, 537 | "lenType": 16, 538 | "lenVar": 40 539 | }, 540 | "kernels_config": { 541 | "python": { 542 | "delete_cmd_postfix": "", 543 | "delete_cmd_prefix": "del ", 544 | "library": "var_list.py", 545 | "varRefreshCmd": "print(var_dic_list())" 546 | }, 547 | "r": { 548 | "delete_cmd_postfix": ") ", 549 | "delete_cmd_prefix": "rm(", 550 | "library": "var_list.r", 551 | "varRefreshCmd": "cat(var_dic_list()) " 552 | } 553 | }, 554 | "types_to_exclude": [ 555 | "module", 556 | "function", 557 | "builtin_function_or_method", 558 | "instance", 559 | "_Feature" 560 | ], 561 | "window_display": false 562 | } 563 | }, 564 | "nbformat": 4, 565 | "nbformat_minor": 4 566 | } 567 | -------------------------------------------------------------------------------- /program.md: -------------------------------------------------------------------------------- 1 | # Advanced mathematics for engineers 2 | 3 | ## Description 4 | 5 | This is a course of mathematical methods for beginning graduate and senior 6 | engineering students. The topics presented in this course pretend to be 7 | and appetizer for the student, allowing her to self-study engineering 8 | systems that involve mathematical models not covered in basic engineering 9 | subjects. 10 | 11 | 12 | ## Objectives 13 | 14 | At the end of the course the student should be able to use mathematical 15 | models to solve engineering problems. In particular, the students 16 | should 17 | 18 | - Understand different vector operators in several coordinate 19 | systems. 20 | 21 | - Solve second order ordinary differential equations. 22 | 23 | - Apply mathematical methods to solve important boundary value problems: 24 | Laplace, Poisson, Wave and Heat equations. 25 | 26 | - Identify types of equations and decide the method to solve it. 27 | 28 | - Identify the origin of some special functions and understand some of 29 | their property. 30 | 31 | 32 | ## Methodology 33 | 34 | Lectures, Examples, recommended reading. The course is divided in 5 units, 35 | emphasizing the concepts. For this reason is suggested the use of a [Computer 36 | Algebra System (CAS)](https://en.wikipedia.org/wiki/Computer_algebra_system) 37 | such as Maple, [Maxima](http://maxima.sourceforge.net/) or 38 | [SymPy](http://www.sympy.org/en/index.html). The instructor will show examples 39 | using SymPy. There will be assignments for each unit that will help to 40 | reinforce the understanding of the topics. 41 | 42 | ## Contents 43 | 44 | ### Linear Algebra Review (1 week) 45 | 46 | It is suggested to watch the series of videos 47 | ["Essence of Linear Algebra"](http://www.3blue1brown.com/essence-of-linear-algebra/). 48 | 49 | 1. Linear transformations 50 | 51 | 2. Vector spaces and bases 52 | 53 | 3. Eigenvalue and Eigenvector problems 54 | 55 | ### Vector calculus and coordinates (2 weeks) 56 | 57 | 1. Vectors and tensors 58 | 59 | 2. Coordinate Systems 60 | 61 | 3. Line, surface and volume differentials 62 | 63 | 4. Differential operators 64 | 65 | 5. Vector identities 66 | 67 | 6. Integral theorems 68 | 69 | ### Ordinary differential equations (5 weeks) 70 | 71 | 1. First order differential equations 72 | 73 | 2. Systems of differential equations 74 | 75 | 3. Power series solutions 76 | 77 | 4. Frobenius method 78 | 79 | 5. Laplace transform method 80 | 81 | 6. Qualitative methods for non-linear systems 82 | 83 | ### Orthogonal bases and Fourier analysis (3 weeks) 84 | 85 | 1. Discrete bases 86 | 87 | 2. Continuous bases 88 | 89 | 3. Fourier Series 90 | 91 | 4. Fourier Integrals 92 | 93 | ### Partial differential equations (5 weeks) 94 | 95 | 1. Classification of partial differential equations 96 | 97 | 2. Common equations 98 | 99 | 1. Poisson equation 100 | 101 | 2. Diffusion equation 102 | 103 | 3. Wave equation 104 | 105 | 4. Navier-Cauchy equation 106 | 107 | 3. Separation of variables 108 | 109 | 1. Sturm-Liouville problems 110 | 2. Bessel functions 111 | 112 | 4. Ritz method 113 | 114 | 5. Weighted residual methods 115 | 116 | ## Textbook 117 | 118 | The textbookd for the course are “Física Matemática” by Alonso Sepúlveda, and 119 | “Advanced Engineering Mathematics” by Erwin Kreyszig. 120 | 121 | 122 | ## Evaluation 123 | 124 | - Assignments 30% 125 | 126 | - 2 Midterms 40% 127 | 128 | - Final project 30% 129 | 130 | ## Pre-requisites 131 | 132 | - Linear Algebra. 133 | 134 | - Differential equations. 135 | 136 | - Vector calculus. 137 | 138 | ## References 139 | 140 | 1. SymPy Development Team. [Sympy’s documentation.](http://docs.sympy.org/latest/index.html), 2016. 141 | 142 | 2. Grant Sanderson. [Essence of linear algebra.](http://www.3blue1brown.com/essence-of-linear-algebra/), 2016. 143 | 144 | 3. Erwin Kreyszig. Advanced engineering mathematics. John Wiley & Sons, 2010. 145 | 146 | 4. Antonio Velasco and Ruben Sánchez. Curso Básico de Álgebra Lineal (Spanish). 147 | Comex, 1980. 148 | 149 | 5. Alonso Sepulveda Soto. Fı́sica matemática (Spanish). Ciencia y Tecnologı́a. 150 | Universidad de Antioquia, 2009. 151 | 152 | 6. FWJ Olver, DW Lozier, RF Boisvert, and CW Clark. [NIST digital library of mathematical functions.](http://dlmf.nist.gov). NIST, 2010. 153 | 154 | 7. Louis Leithold. The calculus. New York, USA: Harper and Row Publishers, 155 | 7 edition, 1995. 156 | 157 | 8. H. Hochstadt. Differential equations: a modern approach. Courier Dover 158 | Publications, 1975. 159 | 160 | 9. Stanley J Farlow. Partial differential equations for scientists and 161 | engineers. Courier Corporation, 2012. 162 | -------------------------------------------------------------------------------- /references.md: -------------------------------------------------------------------------------- 1 | # References 2 | 3 | This is a list of references related to Advanced Mathematics, 4 | [Mathematical Physics](https://en.wikipedia.org/wiki/Mathematical_physics), 5 | and other topics of interest. 6 | 7 | 8 | - Alonso Sepulveda Soto. Fı́sica matemática (Spanish). Ciencia y Tecnologı́a. 9 | Universidad de Antioquia, 2009. 10 | 11 | This is a nice little book about Mathematical Physics. I think that it covers 12 | most of the relevant topics and it is short enough. The only caveat is the 13 | jargon, that it might be a little bit too specific for physicists. 14 | 15 | - Erwin Kreyszig. Advanced engineering mathematics. John Wiley & Sons, 2011. 16 | 17 | A good book in Advanced Mathematics (for engineers). The only but is its 18 | extension, that would not make it suitable for a one-semester course. But, 19 | definitely a good book to have in one's bookshelf. 20 | 21 | - Stanley J Farlow. Partial differential equations for scientists and 22 | engineers. Courier Corporation, 2012. 23 | 24 | This is a [PDE](https://en.wikipedia.org/wiki/Partial_differential_equation) 25 | book intended for students in areas other than mathematics who are studying 26 | partial differential equations. It presents the content in 47 _independent_ 27 | lessons instead of presenting it by chapters. 28 | 29 | - H. Hochstadt. Differential equations: a modern approach. Courier Dover 30 | Publications, 1975. 31 | 32 | My favorite book on [ODE](https://en.wikipedia.org/wiki/Ordinary_differential_equation), 33 | it does not describe all the common methods for second order equations as is 34 | common in most ODE books. The emphasis is on concepts and in matrix methods 35 | that are more algorithmic, in my opinion. 36 | 37 | - Antonio Velasco and Ruben Sánchez. Curso Básico de Álgebra Lineal (Spanish). 38 | Comex, 1980. 39 | 40 | Yet another little book that I like. It does not give any special treatment 41 | to the topics of linear algebra, but it is short (208 page), so you can read 42 | it pretty fast. If I had to choose a book with a different approach it would 43 | be [_Coding the Matrix_](http://codingthematrix.com/) by Philip N. Klein, 44 | that gives an intertwined presentation between theory, concepts and 45 | (Python) programming. 46 | 47 | - Louis Leithold. The calculus. New York, USA: Harper and Row Publishers, 48 | 7 edition, 1995. 49 | 50 | I like this calculus book, but it is probably because I studied in my 51 | undergrad with it. Regarding vector calculus, I find more useful the book 52 | by Stewart. 53 | 54 | 55 | ## Freely-available references 56 | 57 | - Grant Sanderson. [Essence of linear algebra.](http://www.3blue1brown.com/essence-of-linear-algebra/), 2016. 58 | 59 | A series of videos that clearly explain the concepts behind the most Common 60 | topics in linear algebra. 61 | 62 | - Lloyd Trefethen and Kristine Embree (Editors). [The (Unfinished) PDE Coffee Table Book.](https://people.maths.ox.ac.uk/trefethen/pdectb.html), 2011. 63 | 64 | This is a collection of 2-pages spreads talking about relevant information 65 | for different partial differential equations. 66 | 67 | - FWJ Olver, DW Lozier, RF Boisvert, and CW Clark. [NIST digital library of mathematical functions.](http://dlmf.nist.gov). NIST, 2010. 68 | 69 | The updated version of the classical _Handbook of Mathematical Functions_. 70 | It is an online version, so you can access it wherever you are (with an 71 | internet connection, of course). 72 | 73 | - Ondřej Čertík. [Theoretical Physics Reference](http://www.theoretical-physics.net/dev/index.html), 2011. 74 | 75 | This is an e-book generated using [Sphinx](http://www.sphinx-doc.org/en/stable/) 76 | with source code stored in [GitHub](https://github.com/certik/theoretical-physics). 77 | The book contains notes related to theoretical and mathematical physics and 78 | snippets of code in SymPy. 79 | 80 | - Hans Petter Langtangen, Svein Linge ["Finite Difference Computing with PDEs."](https://link.springer.com/book/10.1007/978-3-319-55456-3), 81 | Springer, 2017. 82 | 83 | This is a book on Finite Difference methods for PDEs. It has a stronger 84 | emphasis on computer implementation and verification, key aspects of 85 | scientific computing. 86 | 87 | - Hans Petter Langtangen, Geir K. Pedersen ["Scaling of Differential Equations."](https://link.springer.com/book/10.1007/978-3-319-32726-6), 88 | Springer, 2017. 89 | 90 | This book is centered on scaling of differential equations. Rewriting 91 | differential equations in dimensionless form has several advantages. 92 | These advantages are also present in numerical solutions. 93 | -------------------------------------------------------------------------------- /slides/course_presentation.html: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | Advanced Mathematics for Engineers 13 | 19 | 21 | 23 | 25 | 26 | 27 |
28 |

Advanced Mathematics for Engineers

29 |

30 | Nicolás Guarín-Zapata
email: nguarinz@eafit.edu.co
github: nicoguaro 31 |

32 |

July 2019

33 |
34 |
35 |

Objectives

36 |

At the end of the course the student should be able to use mathematical methods to solve engineering problems. Particularly, the student should

37 | 44 |
45 |
46 |

Evaluation

47 | 52 |
53 |
54 |

Evaluation: Description

55 | 73 |
74 |
75 |

Textbook

76 |

The main books for the course are “Física Matemática” by Alonso Sepúlveda and “Advanced Engineering Mathematics” by Kreyszig (there are several copies in the library).

77 |
78 |
79 |

GitHub repository

80 |

I will create contents such as Jupyter Notebooks and Slides (and maybe some other types) regularly into the following repository

81 |
https://github.com/nicoguaro/AdvancedMath
82 |
83 |
84 |

Python Distribution

85 |

I recommend to use Anaconda as Python distribution, it includes SymPy and Jupyter already.

86 |

A good Python tutorial for scientific purpose is

87 | 90 |

And I wrote a short tutorial for SymPy. You can find it in the course GitHub’s repository, or follow this link.

91 |
92 |
93 |

References

94 |

Main books:

95 | 99 |

For further reference

100 | 109 |
110 | 111 | 112 | -------------------------------------------------------------------------------- /slides/course_presentation.md: -------------------------------------------------------------------------------- 1 | % Advanced Mathematics for Engineers 2 | % Nicolás Guarín-Zapata 3 | email: nguarinz@eafit.edu.co 4 | github: nicoguaro 5 | % July 2019 6 | 7 | 8 | ------------------ 9 | 10 | # Objectives 11 | 12 | At the end of the course the student should be able to use mathematical methods 13 | to solve engineering problems. Particularly, the student should 14 | 15 | - Understand different vector operators in several coordinate systems. 16 | - Solve ordinary differential equation of second order. 17 | - Apply mathematical methods to solve common boundary value problems: Laplace, 18 | Poisson, Wave and Heat equations. 19 | - Identify types of equations and decide the method to solve it. 20 | - Identify the origin of some special functions and understand some of their 21 | properties. 22 | 23 | ------------------ 24 | 25 | # Evaluation 26 | 27 | - Homework 30% 28 | - 2 Midterms 40% 29 | - Project 30% 30 | 31 | ------------------ 32 | 33 | # Evaluation: Description 34 | 35 | - First midterm: Written examination (Week 8) 36 | - Second midterm: Written examination (Week 16) 37 | - Final exam: "Small" project. Final report in paper format. 38 | - Topic selection: Week 4 39 | - Partial report: Week 10 40 | - Deadline: Week 17 41 | - Homework is due on the following weeks 42 | - Week 2 43 | - Week 5 44 | - Week 9 45 | - Week 12 46 | - Week 16 47 | 48 | ------------------ 49 | 50 | # Textbook 51 | 52 | The main books for the course are "Física Matemática" by Alonso Sepúlveda and 53 | "Advanced Engineering Mathematics" by Kreyszig (there 54 | are several copies in the library). 55 | 56 | ------------------ 57 | 58 | # GitHub repository 59 | 60 | I will create contents such as Jupyter Notebooks and Slides (and maybe some 61 | other types) regularly into the following repository 62 | 63 | https://github.com/nicoguaro/AdvancedMath 64 | 65 | ------------------ 66 | 67 | # Python Distribution 68 | 69 | I recommend to use [Anaconda](https://www.continuum.io/downloads) as Python 70 | distribution, it includes SymPy and Jupyter already. 71 | 72 | A good Python tutorial for scientific purpose is 73 | 74 | - Gaël Varoquaux, Emmanuelle Gouillart and Olav Vahtras. 75 | [Scipy Lecture Notes](http://www.scipy-lectures.org/index.html) 76 | 77 | And I wrote a short tutorial for SymPy. You can find it in the course GitHub's 78 | repository, or follow this 79 | [link](http://nbviewer.jupyter.org/github/nicoguaro/AdvancedMath/blob/master/Notebooks/SymPy/SymPy_in_10_minutes.ipynb). 80 | 81 | ------------------ 82 | 83 | # References 84 | 85 | Main books: 86 | 87 | - Alonso Sepúlveda Soto. Física matemática. Ciencia y Tecnología. Universidad 88 | de Antioquia, 2009. 89 | - Erwin Kreyszig. Advanced engineering mathematics. John Wiley & Sons, 2010. 90 | 91 | For further reference 92 | 93 | - SymPy Development Team. [Sympy's documentation.](http://docs.sympy.org/latest/index.html), 2016. 94 | - Grant Sanderson. [Essence of linear algebra.](http://www.3blue1brown.com/essence-of-linear-algebra/), 2016. 95 | - Antonio Velasco and Ruben Sánchez. Curso Básico de Álgebra Lineal. Comex, 1980. 96 | - FWJ Olver, DW Lozier, RF Boisvert, and CW Clark. [NIST digital library of mathematical functions.](http://dlmf.nist.gov) NIST, 2010. 97 | - Louis Leithold. The calculus. New York, USA: Harper and Row Publishers, 7 edition, 1995. 98 | - H. Hochstadt. Differential equations: a modern approach. Courier Dover Publications, 1975. 99 | - Stanley J Farlow. Partial differential equations for scientists and engineers. Courier Corporation, 2012. 100 | -------------------------------------------------------------------------------- /slides/fourier_analysis.html: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | Orthogonal bases and Fourier analysis 13 | 19 | 21 | 23 | 24 | 26 | 27 | 28 |
29 |

Orthogonal bases and Fourier analysis

30 |

31 | Nicolás Guarín-Zapata
email: nguarinz@eafit.edu.co
github: nicoguaro 32 |

33 |

March, 2019

34 |
35 |
36 |

Inner products

37 |

Inner products let us extend geometrical notions such as length of a vector or angle between vectors for vector spaces that are more abstract than \(\mathbb{R}^2\) or \(\mathbb{R}^3\). It also let us define the orthogonality between vectors. Inner product spaces generalize the notion of Euclidean spaces to any dimension.

38 |
39 |
40 |

Orthogonal basis

41 |

An orthogonal basis for an inner product spaces \(V\), is a basis for \(V\) whose vectors are mutually orthogonal. The angle between vectors (\(\theta\)) is defined using the inner product as

42 |

\[\theta = \arccos\left(\frac{\langle x, y\rangle}{\Vert x\Vert\, \Vert y\Vert}\right) \, .\]

43 |

If they have magnitude 1, then the base is called orthonormal.

44 |
45 |
46 |

Examples of (discrete) orthogonal basis: Fourier basis

47 |

\[\left\lbrace \frac{1}{\sqrt{\pi}} \sin(nx), 48 | \frac{1}{\sqrt{\pi}} \cos(nx), 49 | \frac{1}{\sqrt{2\pi}}\middle| 50 | \forall n \in \mathbb{N}, \forall x\in [-\pi, \pi]\right\rbrace\]

51 |

54 |
55 |
56 |

Examples of (discrete) orthogonal basis: Hermite polynomials

57 |

\[\left\lbrace (-1)^n e^{x^2}\frac{d^n}{dx^n} e^{-x^2},\middle| 58 | \forall n \in \mathbb{N}, \forall x\in [-\infty, \infty]\right\rbrace\]

59 |

with orthogonality as

60 |

\[\int\limits_{-\infty}^{\infty} H_m(x) H_n(x) e^{-x^2} dx = \sqrt{\pi}s^n n! \delta_{mn}\]

61 |

64 |
65 |
66 |

Examples of (discrete) orthogonal basis: Chebyshev polynomials

67 |

They are defined by the recursion relation

68 |

\[T_0(x) = 1,\, T_1(x) = x,\, T_{n+1} = 2x T_n(x) - T_{n-1}(x),\quad \forall x\in [-1,1]\]

69 |

with orthogonality as

70 |

\[\int\limits_{-1}^{1} T_m(x) T_n(x) \frac{dx}{\sqrt{1 - x^2}} = 71 | \begin{cases} 72 | 0 &n\neq m \\ 73 | \pi &n=m=0\\ 74 | \pi/2 &n=m\neq 0\end{cases}\]

75 |

78 |
79 |
80 |

Fourier analysis: definition

81 |

From Wikipedia

82 |
83 |

In mathematics, Fourier analysis is the study of the way general functions may be represented or approximated by sums of simpler trigonometric functions. Fourier analysis grew from the study of Fourier series, and is named after Joseph Fourier, who showed that representing a function as a sum of trigonometric functions greatly simplifies the study of heat transfer.

84 |
85 |
86 |
87 |

Fourier analysis: scientific applications

88 |

Fourier analysis has many scientific applications:

89 | 95 |
96 |
97 |

Fourier analysis: applications

98 |

Some examples include:

99 | 105 |
106 |
107 |

Fourier series

108 |

A Fourier series allow us to represent a (periodic) function as the sum of sine and cosine functions.

109 |

For a function \(f(x)\) defined over \([x_0, x_0 + P]\), that is continuous or piecewise continuous, we write

110 |

\[ f(x) = \frac{a_0}{2} + \sum_{n=1}^{\infty}\left[ 111 | a_n \cos\left(\frac{2\pi nx}{P}\right) + 112 | b_n \sin\left(\frac{2\pi nx}{P}\right) \right]\]

113 |

where the coefficients are obtained computing the inner product with the elements of the base, i.e.

114 |

\[a_0 = \frac{2}{P}\int_{x_0}^{x_0+P} f(x)\, dx\\ 115 | a_n = \frac{2}{P}\int_{x_0}^{x_0+P} \cos\left(\frac{2\pi nx}{P}\right) f(x)\, dx\\ 116 | b_n = \frac{2}{P}\int_{x_0}^{x_0+P} \sin\left(\frac{2\pi nx}{P}\right) f(x)\, dx\]

117 |
118 |
119 |

Fourier series visualisation

120 | 122 |
123 |
124 |

Orthogonal basis: continuum case

125 |

A set \(\lbrace \phi(k, x)\rbrace\) with \(x\) and \(k\) defined over \((a, b)\), and \((c, d)\) are orthogonal with weight \(w(x)\) (\(w(x)\) real) if:

126 |

\[\int\limits_{a}^{b} w(x) \phi^* (k, x) \phi(k', x)\, dx = \delta(k - k')\, , 127 | \quad x\in(a, b),\, k\in(c, d)\, .\]

128 |
129 |
130 |

Orthogonal basis: continuum case

131 |

If the basis is complete we can write a function \(f(x)\) as

132 |

\[f(x) = \int\limits_{c}^{d} C(k) \phi(k, x)\, dk\, ,\]

133 |

with

134 |

\[C(k) = \int\limits_{a}^{b} f(x) w(x)\phi(k, x)\, dx\, .\]

135 |

\(C(k)\) is known as the tranform of \(f(x)\).

136 |
137 |
138 |

Examples of (continuous) orthogonal basis: Fourier transform

139 |

When we choose the basis functions \(\lbrace \frac{e^{ikx}}{\sqrt{2\pi}}\rbrace\), we can write a function \(f(x)\), that is piecewise continuous and does not grow faster than exponentially, as

140 |

\[f(x) = \frac{1}{\sqrt{2\pi}}\int\limits_{-\infty}^{\infty}F(k) e^{ikx}\, dx\, .\]

141 |

Using the orthonormality condition

142 |

\[\int\limits_{-\infty}^{\infty} e^{i(k -k') x}dx = 2\pi \delta(k - k')\, ,\]

143 |

we can write

144 |

\[F(k) = \frac{1}{\sqrt{2\pi}}\int\limits_{-\infty}^{\infty}f(x) e^{-ikx}\, dx\, .\]

145 |
146 |
147 |

Example of Fourier transform

148 |

We can compute the Fourier transform of a Gaussian function

149 |

\[f(x) = e^{-\alpha^2 x^2},\quad x\in(-\infty, \infty)\]

150 |

Using the definition and proceeding with the integral we get

151 |

\[\begin{align} 152 | F(k) &= \frac{1}{\sqrt{2\pi}}\int\limits_{-\infty}^{\infty} e^{-\alpha^2(x^2 + ikx/\alpha^2)} dx\\ 153 | &= \frac{e^{-k/4\alpha^2}}{\sqrt{2\pi}}\int\limits_{-\infty}^{\infty} e^{-\alpha^2(x + ikx/2\alpha^2)^2} dx\\ 154 | &= \frac{1}{\sqrt{\pi} \alpha} e^{-k^2/4\alpha^2} \, . 155 | \end{align}\]

156 |
157 |
158 |

Visualization of Fourier Transform

159 |

162 |
163 |
164 |

Visualization of Fourier Transform

165 |

168 |
169 |
170 |

References

171 | 180 |
181 | 182 | 183 | -------------------------------------------------------------------------------- /slides/fourier_analysis.md: -------------------------------------------------------------------------------- 1 | % Orthogonal bases and Fourier analysis 2 | % Nicolás Guarín-Zapata 3 | email: nguarinz@eafit.edu.co 4 | github: nicoguaro 5 | % March, 2019 6 | 7 | 8 | ------------------ 9 | 10 | # Inner products 11 | 12 | Inner products let us extend geometrical notions such as length of a vector 13 | or angle between vectors for vector spaces that are more abstract than 14 | $\mathbb{R}^2$ or $\mathbb{R}^3$. It also let us define the orthogonality 15 | between vectors. Inner product spaces generalize the notion of Euclidean 16 | spaces to any dimension. 17 | 18 | 19 | 20 | ------------------ 21 | 22 | # Orthogonal basis 23 | 24 | An orthogonal basis for an inner product spaces $V$, is a basis for $V$ 25 | whose vectors are mutually orthogonal. The angle between vectors 26 | ($\theta$) is defined using the inner product as 27 | 28 | $$\theta = \arccos\left(\frac{\langle x, y\rangle}{\Vert x\Vert\, \Vert y\Vert}\right) \, .$$ 29 | 30 | If they have magnitude 1, then the base is called _orthonormal_. 31 | 32 | ------------------ 33 | 34 | # Examples of (discrete) orthogonal basis: Fourier basis 35 | 36 | $$\left\lbrace \frac{1}{\sqrt{\pi}} \sin(nx), 37 | \frac{1}{\sqrt{\pi}} \cos(nx), 38 | \frac{1}{\sqrt{2\pi}}\middle| 39 | \forall n \in \mathbb{N}, \forall x\in [-\pi, \pi]\right\rbrace$$ 40 | 41 | 44 | 45 | ------------------ 46 | 47 | # Examples of (discrete) orthogonal basis: Hermite polynomials 48 | 49 | $$\left\lbrace (-1)^n e^{x^2}\frac{d^n}{dx^n} e^{-x^2},\middle| 50 | \forall n \in \mathbb{N}, \forall x\in [-\infty, \infty]\right\rbrace$$ 51 | 52 | with orthogonality as 53 | 54 | $$\int\limits_{-\infty}^{\infty} H_m(x) H_n(x) e^{-x^2} dx = \sqrt{\pi}s^n n! \delta_{mn}$$ 55 | 56 | 59 | 60 | ------------------ 61 | 62 | # Examples of (discrete) orthogonal basis: Chebyshev polynomials 63 | 64 | They are defined by the recursion relation 65 | 66 | $$T_0(x) = 1,\, T_1(x) = x,\, T_{n+1} = 2x T_n(x) - T_{n-1}(x),\quad \forall x\in [-1,1]$$ 67 | 68 | with orthogonality as 69 | 70 | $$\int\limits_{-1}^{1} T_m(x) T_n(x) \frac{dx}{\sqrt{1 - x^2}} = 71 | \begin{cases} 72 | 0 &n\neq m \\ 73 | \pi &n=m=0\\ 74 | \pi/2 &n=m\neq 0\end{cases}$$ 75 | 76 | 79 | 80 | ------------------ 81 | 82 | # Fourier analysis: definition 83 | 84 | From Wikipedia 85 | 86 | > In mathematics, Fourier analysis is the study of the way general functions 87 | may be represented or approximated by sums of simpler trigonometric functions. 88 | Fourier analysis grew from the study of Fourier series, and is named after 89 | Joseph Fourier, who showed that representing a function as a sum of 90 | trigonometric functions greatly simplifies the study of heat transfer. 91 | 92 | ------------------ 93 | 94 | # Fourier analysis: scientific applications 95 | 96 | Fourier analysis has many scientific applications: 97 | 98 | - Signal Processing. It may be the best application of Fourier analysis. 99 | 100 | - Approximation Theory. We use Fourier series to write a function as a 101 | trigonometric polynomial. 102 | 103 | - Control Theory. The Fourier series of functions in the differential 104 | equation often gives some prediction about the behavior of the solution 105 | of differential equation. They are useful to find out the dynamics of 106 | the solution. 107 | 108 | - Partial Differential equation. We use it to solve higher order partial 109 | differential equations by the method of separation of variables. 110 | 111 | ------------------ 112 | 113 | # Fourier analysis: applications 114 | 115 | Some examples include: 116 | 117 | - JPG image compression. 118 | 119 | - MP3 sound compression. 120 | 121 | - Image processing to remove periodic or anisotropic artifacts such as 122 | jaggies from interlaced video. 123 | 124 | - X-ray crystallography to reconstruct a crystal structure from its 125 | diffraction pattern. 126 | 127 | ------------------ 128 | 129 | # Fourier series 130 | 131 | A Fourier series allow us to represent a (periodic) function as the sum 132 | of sine and cosine functions. 133 | 134 | For a function $f(x)$ defined over $[x_0, x_0 + P]$, that is continuous 135 | or piecewise continuous, we write 136 | 137 | $$ f(x) = \frac{a_0}{2} + \sum_{n=1}^{\infty}\left[ 138 | a_n \cos\left(\frac{2\pi nx}{P}\right) + 139 | b_n \sin\left(\frac{2\pi nx}{P}\right) \right]$$ 140 | 141 | where the coefficients are obtained computing the inner product with the 142 | elements of the base, i.e. 143 | 144 | $$a_0 = \frac{2}{P}\int_{x_0}^{x_0+P} f(x)\, dx\\ 145 | a_n = \frac{2}{P}\int_{x_0}^{x_0+P} \cos\left(\frac{2\pi nx}{P}\right) f(x)\, dx\\ 146 | b_n = \frac{2}{P}\int_{x_0}^{x_0+P} \sin\left(\frac{2\pi nx}{P}\right) f(x)\, dx$$ 147 | 148 | ------------------ 149 | 150 | # Fourier series visualisation 151 | 152 | 158 | 159 | ------------------ 160 | 161 | # Orthogonal basis: continuum case 162 | 163 | A set $\lbrace \phi(k, x)\rbrace$ with $x$ and $k$ defined over $(a, b)$, and 164 | $(c, d)$ are orthogonal with weight $w(x)$ ($w(x)$ real) if: 165 | 166 | $$\int\limits_{a}^{b} w(x) \phi^* (k, x) \phi(k', x)\, dx = \delta(k - k')\, , 167 | \quad x\in(a, b),\, k\in(c, d)\, .$$ 168 | 169 | ------------------ 170 | 171 | # Orthogonal basis: continuum case 172 | 173 | If the basis is complete we can write a function $f(x)$ as 174 | 175 | $$f(x) = \int\limits_{c}^{d} C(k) \phi(k, x)\, dk\, ,$$ 176 | 177 | with 178 | 179 | $$C(k) = \int\limits_{a}^{b} f(x) w(x)\phi(k, x)\, dx\, .$$ 180 | 181 | $C(k)$ is known as the tranform of $f(x)$. 182 | 183 | ------------------ 184 | 185 | # Examples of (continuous) orthogonal basis: Fourier transform 186 | 187 | When we choose the basis functions $\lbrace \frac{e^{ikx}}{\sqrt{2\pi}}\rbrace$, 188 | we can write a function $f(x)$, that is piecewise continuous and does not grow 189 | faster than exponentially, as 190 | 191 | $$f(x) = \frac{1}{\sqrt{2\pi}}\int\limits_{-\infty}^{\infty}F(k) e^{ikx}\, dx\, .$$ 192 | 193 | Using the orthonormality condition 194 | 195 | $$\int\limits_{-\infty}^{\infty} e^{i(k -k') x}dx = 2\pi \delta(k - k')\, ,$$ 196 | 197 | we can write 198 | 199 | $$F(k) = \frac{1}{\sqrt{2\pi}}\int\limits_{-\infty}^{\infty}f(x) e^{-ikx}\, dx\, .$$ 200 | 201 | ------------------ 202 | 203 | # Example of Fourier transform 204 | 205 | We can compute the Fourier transform of a Gaussian function 206 | 207 | $$f(x) = e^{-\alpha^2 x^2},\quad x\in(-\infty, \infty)$$ 208 | 209 | Using the definition and proceeding with the integral we get 210 | 211 | \begin{align} 212 | F(k) &= \frac{1}{\sqrt{2\pi}}\int\limits_{-\infty}^{\infty} e^{-\alpha^2(x^2 + ikx/\alpha^2)} dx\\ 213 | &= \frac{e^{-k/4\alpha^2}}{\sqrt{2\pi}}\int\limits_{-\infty}^{\infty} e^{-\alpha^2(x + ikx/2\alpha^2)^2} dx\\ 214 | &= \frac{1}{\sqrt{\pi} \alpha} e^{-k^2/4\alpha^2} \, . 215 | \end{align} 216 | 217 | ------------------ 218 | 219 | # Visualization of Fourier Transform 220 | 221 | 222 | 225 | 226 | ------------------ 227 | 228 | # Visualization of Fourier Transform 229 | 230 | 231 | 234 | 235 | ------------------ 236 | 237 | # References 238 | 239 | - Alonso Sepúlveda Soto. Física matemática. Ciencia y Tecnología. Universidad 240 | de Antioquia, 2009. 241 | 242 | - Pierre Guilleminot's. [Fourier series visualisation with d3.js.](https://bl.ocks.org/jinroh/7524988), 2016. 243 | 244 | - Wikipedia contributors. ["Fourier analysis."](https://en.wikipedia.org/wiki/Fourier_analysis) 245 | Wikipedia, The Free Encyclopedia 246 | 247 | - Wikipedia contributors. ["Hermite polynomials."](https://en.wikipedia.org/wiki/Hermite_polynomials) 248 | Wikipedia, The Free Encyclopedia. 249 | 250 | - Wikipedia contributors. ["Fourier series."](https://en.wikipedia.org/wiki/Fourier_series) 251 | Wikipedia, The Free Encyclopedia. 252 | 253 | - Wikipedia contributors. ["Chebyshev polynomials."](https://en.wikipedia.org/wiki/Chebyshev_polynomials) 254 | Wikipedia, The Free Encyclopedia. 255 | 256 | - Wikipedia contributors. ["Fourier transform."](https://en.wikipedia.org/wiki/Fourier_transform) 257 | Wikipedia, The Free Encyclopedia. 258 | -------------------------------------------------------------------------------- /slides/img/Continuous_Fourier_transform_of_rect_and_sinc_functions.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicoguaro/AdvancedMath/2749068de442f67b89d3f57827367193ce61a09c/slides/img/Continuous_Fourier_transform_of_rect_and_sinc_functions.gif -------------------------------------------------------------------------------- /slides/img/Fourier_series_integral_identities.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicoguaro/AdvancedMath/2749068de442f67b89d3f57827367193ce61a09c/slides/img/Fourier_series_integral_identities.gif -------------------------------------------------------------------------------- /slides/img/Fourier_transform_time_and_frequency_domains.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicoguaro/AdvancedMath/2749068de442f67b89d3f57827367193ce61a09c/slides/img/Fourier_transform_time_and_frequency_domains.gif -------------------------------------------------------------------------------- /slides/img/Fourier_vis.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 53 | 54 | 55 |
56 |

57 | 64 | 65 |

66 |

67 |
68 | 69 | 313 | 314 | -------------------------------------------------------------------------------- /slides/img/Hermite_poly_phys.svg: -------------------------------------------------------------------------------- 1 | 2 | 4 | 7 | Produced by GNUPLOT 4.2 patchlevel 2 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | -40 33 | 34 | 35 | 36 | -30 37 | 38 | 39 | 40 | -20 41 | 42 | 43 | 44 | -10 45 | 46 | 47 | 48 | 0 49 | 50 | 51 | 52 | 10 53 | 54 | 55 | 56 | 20 57 | 58 | 59 | 60 | 30 61 | 62 | 63 | 64 | 40 65 | 66 | 67 | 68 | 50 69 | 70 | 71 | 72 | -2 73 | 74 | 75 | 76 | -1 77 | 78 | 79 | 80 | 0 81 | 82 | 83 | 84 | 1 85 | 86 | 87 | 88 | 2 89 | 90 | 91 | 92 | 3 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | H_n (x) 102 | 103 | 104 | x 105 | 106 | 107 | Hermite (physicists') Polynomials 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | n = 0 117 | 118 | 119 | 120 | 133 | 134 | 135 | 136 | 137 | 138 | n = 1 139 | 140 | 141 | 142 | 155 | 156 | 157 | 158 | 159 | 160 | n = 2 161 | 162 | 163 | 164 | 177 | 178 | 179 | 180 | 181 | 182 | n = 3 183 | 184 | 185 | 186 | 196 | 197 | 198 | 199 | 200 | 201 | n = 4 202 | 203 | 204 | 205 | 214 | 215 | 216 | 217 | 218 | 219 | n = 5 220 | 221 | 222 | 223 | 230 | 231 | 232 | 233 | 234 | 235 | 236 | 237 | 238 | -------------------------------------------------------------------------------- /slides/img/Mona_Lisa_eigenvector_grid.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicoguaro/AdvancedMath/2749068de442f67b89d3f57827367193ce61a09c/slides/img/Mona_Lisa_eigenvector_grid.png -------------------------------------------------------------------------------- /slides/img/PenduloTmg.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicoguaro/AdvancedMath/2749068de442f67b89d3f57827367193ce61a09c/slides/img/PenduloTmg.gif -------------------------------------------------------------------------------- /slides/img/airy_functions.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python2 2 | # -*- coding: utf-8 -*- 3 | """ 4 | Plots of the Airy functions 5 | """ 6 | from __future__ import division 7 | import numpy as np 8 | from scipy.special import airy 9 | import matplotlib.pyplot as plt 10 | 11 | plt.rcParams["mathtext.fontset"] = "cm" 12 | 13 | 14 | z = np.linspace(-10, 5, 500) 15 | Ai, _, Bi, _ = airy(z) 16 | 17 | 18 | plt.figure(figsize=(4, 3)) 19 | plt.plot(z, Ai) 20 | plt.plot(z, Bi) 21 | plt.ylim(-0.5, 1) 22 | plt.xlabel(r"$z$") 23 | plt.ylabel(r"$y$") 24 | plt.legend([r"$\mathrm{Ai}(z)$", r"$\mathrm{Bi}(z)$"]) 25 | plt.tight_layout() 26 | plt.savefig("airy_functions.svg", transparent=True) 27 | -------------------------------------------------------------------------------- /slides/img/bessel_functions.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python2 2 | # -*- coding: utf-8 -*- 3 | """ 4 | Plots of the Bessel functions of the first kind 5 | """ 6 | from __future__ import division 7 | import numpy as np 8 | from scipy.special import jn 9 | import matplotlib.pyplot as plt 10 | 11 | plt.rcParams["mathtext.fontset"] = "cm" 12 | 13 | 14 | z = np.linspace(0, 10, 500) 15 | 16 | plt.figure(figsize=(4, 3)) 17 | for nu in [0, 1, 2, 3]: 18 | J = jn(nu,z) 19 | plt.plot(z, J, label=r"$J_{}$".format(nu)) 20 | 21 | 22 | plt.xlabel(r"$z$") 23 | plt.ylabel(r"$y$") 24 | plt.legend() 25 | plt.tight_layout() 26 | plt.savefig("bessel_functions.svg", transparent=True) 27 | -------------------------------------------------------------------------------- /slides/img/drag_fall.mp4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicoguaro/AdvancedMath/2749068de442f67b89d3f57827367193ce61a09c/slides/img/drag_fall.mp4 -------------------------------------------------------------------------------- /slides/img/drag_fall.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python2 2 | # -*- coding: utf-8 -*- 3 | """ 4 | Animate the fall of a person with parachute 5 | """ 6 | from __future__ import division, print_function 7 | import numpy as np 8 | from scipy.integrate import odeint 9 | import matplotlib.pyplot as plt 10 | import matplotlib.animation as animation 11 | 12 | 13 | plt.rcParams["font.family"] = "serif" 14 | plt.rcParams["font.size"] = 18 15 | plt.rcParams["mathtext.fontset"] = "cm" 16 | 17 | 18 | def drag_fall(x, t, gravity, drag, mass): 19 | y, v = x 20 | return [v, -gravity + drag/mass*v**2] 21 | 22 | 23 | def update(num, ax, t, y): 24 | ax.cla() 25 | plot = ax.plot(0, y[num], "ko") 26 | ax.set_title(r"$t={:.2f}$".format(t[num])) 27 | ax.set_xlim(-1, 1) 28 | ax.set_xticks([]) 29 | return plot 30 | 31 | 32 | dist = 500 33 | y0 = [dist, 0] 34 | g = 9.81 35 | mass = 70 36 | drag = 1.2 37 | tmax = np.sqrt(2*dist/g) 38 | t = np.linspace(0, tmax, 101) 39 | sol = odeint(drag_fall, y0, t, args=(g, drag, mass)) 40 | 41 | fig, (ax1, ax2) = plt.subplots(1, 2, sharey=True, **{"figsize": (8, 5)}) 42 | ax1.plot(t, sol[:, 0]) 43 | ax1.set_xlabel(r"Time (s)") 44 | ax1.set_ylabel(r"Height (m)") 45 | 46 | ani = animation.FuncAnimation(fig, update, fargs=(ax2, t, sol[:, 0]), 47 | interval=50, blit=True) 48 | ani.save("drag_fall.mp4", dpi=600) 49 | #plt.show() 50 | -------------------------------------------------------------------------------- /slides/img/free_fall.mp4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicoguaro/AdvancedMath/2749068de442f67b89d3f57827367193ce61a09c/slides/img/free_fall.mp4 -------------------------------------------------------------------------------- /slides/img/free_fall.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python2 2 | # -*- coding: utf-8 -*- 3 | """ 4 | Animate the free fall of a body 5 | """ 6 | from __future__ import division, print_function 7 | import numpy as np 8 | from scipy.integrate import odeint 9 | import matplotlib.pyplot as plt 10 | import matplotlib.animation as animation 11 | 12 | 13 | plt.rcParams["font.family"] = "serif" 14 | plt.rcParams["font.size"] = 18 15 | plt.rcParams["mathtext.fontset"] = "cm" 16 | 17 | def free_fall(x, t, gravity): 18 | y, v = x 19 | return [v, -gravity] 20 | 21 | 22 | def update(num, ax, t, y): 23 | ax.cla() 24 | plot = ax.plot(0, y[num], "ko") 25 | ax.set_title(r"$t={:.2f}$".format(t[num])) 26 | ax.set_xlim(-1, 1) 27 | ax.set_xticks([]) 28 | return plot 29 | 30 | 31 | y0 = [10, 0] 32 | g = 9.81 33 | dist = 10 34 | tmax = np.sqrt(2*dist/g) 35 | t = np.linspace(0, tmax, 101) 36 | sol = odeint(free_fall, y0, t, args=(g,)) 37 | 38 | fig, (ax1, ax2) = plt.subplots(1, 2, sharey=True, **{"figsize": (8, 5)}) 39 | ax1.plot(t, sol[:, 0]) 40 | ax1.set_xlabel(r"Time (s)") 41 | ax1.set_ylabel(r"Height (m)") 42 | 43 | ani = animation.FuncAnimation(fig, update, fargs=(ax2, t, sol[:, 0]), 44 | interval=50, blit=True) 45 | ani.save("free_fall.mp4", dpi=600) 46 | #plt.show() 47 | -------------------------------------------------------------------------------- /slides/img/gamma_function.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python2 2 | # -*- coding: utf-8 -*- 3 | """ 4 | Plot of the gamma function 5 | """ 6 | from __future__ import division 7 | import numpy as np 8 | from scipy.special import gamma 9 | import matplotlib.pyplot as plt 10 | 11 | plt.rcParams["mathtext.fontset"] = "cm" 12 | 13 | 14 | z = np.linspace(-5, 5, 5000) 15 | 16 | plt.figure(figsize=(4, 3)) 17 | y = gamma(z) 18 | y[np.abs(y)>5.1] = np.nan 19 | plt.plot(z, y) 20 | 21 | 22 | plt.xlabel(r"$z$") 23 | plt.ylabel(r"$y$") 24 | plt.ylim(-4, 4) 25 | plt.tight_layout() 26 | plt.savefig("gamma_function.svg", transparent=True) 27 | 28 | -------------------------------------------------------------------------------- /slides/img/gamma_function.svg: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 10 | 11 | 12 | 13 | 19 | 20 | 21 | 22 | 28 | 29 | 30 | 31 | 32 | 33 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 50 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 235 | 236 | 237 | 238 | 239 | 240 | 241 | 242 | 243 | 244 | 245 | 248 | 249 | 250 | 251 | 252 | 253 | 254 | 255 | 256 | 257 | 258 | 259 | 260 | 261 | 262 | 263 | 264 | 265 | 266 | 267 | 268 | 269 | 270 | 271 | 272 | 273 | 274 | 275 | 276 | 277 | 278 | 279 | 280 | 281 | 282 | 283 | 284 | 285 | 286 | 287 | 288 | 289 | 290 | 291 | 292 | 293 | 294 | 295 | 296 | 297 | 298 | 299 | 300 | 301 | 302 | 303 | 304 | 305 | 306 | 307 | 308 | 309 | 310 | 311 | 312 | 313 | 314 | 315 | 316 | 317 | 372 | 373 | 374 | 375 | 376 | 377 | 378 | 379 | 564 | 565 | 566 | 569 | 570 | 571 | 574 | 575 | 576 | 579 | 580 | 581 | 584 | 585 | 586 | 587 | 588 | 589 | 590 | 591 | 592 | 593 | -------------------------------------------------------------------------------- /slides/img/polar_coords.webgl: -------------------------------------------------------------------------------- 1 | {"id":1,"MaxSize":2,"Center":[0.283126, 0.331925, 0.147437],"Renderers": [{"layer":0,"Background1":[1,1,1],"LookAt":[30,0.283126,0.331925,0.147437,-0.417812,-0.193779,0.887627,6.35859,3.69485,3.74136], "size": [1,1],"origin": [0,0]}, {"layer":1,"LookAt":[30,0,0,0,-0.417812,-0.193779,0.887627,5.19987,2.87826,3.07597], "size": [0.172973,0.250653],"origin": [0,0]}, {"layer":2,"LookAt":[30,0.283126,0.331925,0.147437,-0.417812,-0.193779,0.887627,6.35859,3.69485,3.74136], "size": [1,1],"origin": [0,0]}], "Objects":[{"id":2472624956880, "md5":"57cd8294f147c0a780d920684ed0d077", "parts":1, "interactAtServer":0, "transparency":1, "layer":0, "wireframe":0}, {"id":2472624955920, "md5":"2dd6256d0c5ccc6acdf011d363333254", "parts":1, "interactAtServer":0, "transparency":1, "layer":0, "wireframe":0}, {"id":2472623644624, "md5":"1ac507f6815e11d3b83b657a3c34443d", "parts":1, "interactAtServer":0, "transparency":1, "layer":0, "wireframe":0}, {"id":2472621232784, "md5":"a10fa01e1d690e5591f4cc1831e070e9", "parts":1, "interactAtServer":0, "transparency":0, "layer":1, "wireframe":0}, {"id":2472621248160, "md5":"1553bb1f792f1e5710015f9cfcce4249", "parts":1, "interactAtServer":0, "transparency":0, "layer":1, "wireframe":0}, {"id":2472621224352, "md5":"3c71f85b59b7e3786a647eec0289d592", "parts":1, "interactAtServer":0, "transparency":0, "layer":1, "wireframe":0}, {"id":2472621224848, "md5":"8af530a4853e7f0db676b9e91151d554", "parts":1, "interactAtServer":0, "transparency":0, "layer":1, "wireframe":0}, {"id":2472621241712, "md5":"6bf2a7abb18c62ebde0c8af233d59f93", "parts":1, "interactAtServer":0, "transparency":0, "layer":1, "wireframe":0}, {"id":2472621243696, "md5":"df3a588427e1ca765b7e8ace1c6edbfc", "parts":1, "interactAtServer":0, "transparency":0, "layer":1, "wireframe":0}, {"id":2472620898448, "md5":"96c275b84c93bbe816b5da3f673d2763", "parts":1, "interactAtServer":0, "transparency":0, "layer":1, "wireframe":0}, {"id":2472620899408, "md5":"630ce373ccaa00639c947d4d5ce373c4", "parts":1, "interactAtServer":0, "transparency":0, "layer":1, "wireframe":0}, {"id":2472620899888, "md5":"c6cd3cb4f4853e7b158c58bbcc4edb13", "parts":1, "interactAtServer":0, "transparency":0, "layer":1, "wireframe":0}]} -------------------------------------------------------------------------------- /slides/linear_transformations.html: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | Linear Tranformations and Eigenvalues/Eigenvectors 13 | 19 | 21 | 23 | 24 | 26 | 27 | 28 |
29 |

Linear Tranformations and Eigenvalues/Eigenvectors

30 |

31 | Nicolás Guarín-Zapata
email: nguarinz@eafit.edu.co
github: nicoguaro 32 |

33 |

July 2019

34 |
35 |
36 |

Linear Transformation

37 |

A linear map (also called a linear mapping, linear transformation) is a mapping \(V \rightarrow W\) between two vector spaces that preserves the operations of addition and scalar multiplication.

38 |

Let \(V\) and \(W\) be vector spaces over the same field \(K\). A function \(f : V \rightarrow W\) is said to be a linear map if for any two vectors \(x\) and \(y\) in \(V\) and any scalar \(α\) in \(K\), the following two conditions are satisfied:

39 | 43 |
44 |
45 |

Video lecture: Linear transformations

46 | 48 |
49 |
50 |

Applet: Linear transformations

51 | 53 |
54 |
55 |

Examples of linear transformation matrices

56 |

In two-dimensional space \(\mathbb{R}^2\) linear maps are described by 2 × 2 real matrices. These are some examples:

57 | 60 |

\[\mathbf{A}=\begin{pmatrix}0 & -1\\ 1 & 0\end{pmatrix}\]

61 | 70 |
71 |
72 |

Eigenvalues and Eigenvectors

73 |

An eigenvector or characteristic vector of a linear transformation is a non-zero vector whose direction does not change when that linear transformation is applied to it. More formally, if \(T\) is a linear transformation from a vector space \(V\) over a field \(F\) into itself and \(v\) is a vector in \(V\) that is not the zero vector, then \(v\) is an eigenvector of \(T\) if \(T(v)\) is a scalar multiple of \(v\). This condition can be written as the equation

74 |

\[T ( v ) = λ v ,\]

75 |

where \(λ\) is a scalar in the field \(F\), known as the eigenvalue, characteristic value, or characteristic root associated with the eigenvector \(v\).

76 |
77 |
78 | 79 |

82 |

In this shear mapping the red arrow changes direction but the blue arrow does not. The blue arrow is an eigenvector of this shear mapping because it doesn’t change direction, and since its length is unchanged, its eigenvalue is 1.

83 |
84 |
85 |

References

86 | 91 |
92 | 93 | 94 | -------------------------------------------------------------------------------- /slides/linear_transformations.md: -------------------------------------------------------------------------------- 1 | % Linear Tranformations and Eigenvalues/Eigenvectors 2 | % Nicolás Guarín-Zapata 3 | email: nguarinz@eafit.edu.co 4 | github: nicoguaro 5 | % July 2019 6 | 7 | 8 | ------------------ 9 | 10 | # Linear Transformation 11 | 12 | A linear map (also called a linear mapping, linear transformation) is a mapping $V \rightarrow W$ between two vector spaces that preserves the operations of addition and scalar multiplication. 13 | 14 | Let $V$ and $W$ be vector spaces over the same [field](https://en.wikipedia.org/wiki/Field_(mathematics)) $K$. A function $f : V \rightarrow W$ is said to be a _linear map_ if for any two vectors $x$ and $y$ in $V$ and any scalar $α$ in $K$, the following two conditions are satisfied: 15 | 16 | - $f(\mathbf{x}+\mathbf{y}) = f(\mathbf{x})+f(\mathbf{y})\quad \text{(Additivity)}$ 17 | - $f(\alpha \mathbf{x}) = \alpha f(\mathbf{x})\quad \text{(Homogeneity)}$ 18 | 19 | ------------------ 20 | 21 | # Video lecture: Linear transformations 22 | 23 | 29 | 30 | ------------------ 31 | 32 | # Applet: Linear transformations 33 | 34 | 40 | 41 | ------------------ 42 | 43 | # Examples of linear transformation matrices 44 | 45 | In two-dimensional space $\mathbb{R}^2$ linear maps are described by 2 × 2 real matrices. These are some examples: 46 | 47 | - rotation by 90 degrees counterclockwise: 48 | 49 | $$\mathbf{A}=\begin{pmatrix}0 & -1\\ 1 & 0\end{pmatrix}$$ 50 | 51 | - rotation by angle ''θ'' counterclockwise: $$\mathbf{A}=\begin{pmatrix}\cos\theta & -\sin\theta \\ \sin\theta & \cos\theta \end{pmatrix}$$ 52 | - reflection against the ''x'' axis: $$\mathbf{A}=\begin{pmatrix}1 & 0\\ 0 & -1\end{pmatrix}$$ 53 | - reflection against the ''y'' axis: $$\mathbf{A}=\begin{pmatrix}-1 & 0\\ 0 & 1\end{pmatrix}$$ 54 | - scaling by 2 in all directions: $$\mathbf{A}=\begin{pmatrix}2 & 0\\ 0 & 2\end{pmatrix}$$ 55 | - horizontal shear mapping: $$\mathbf{A}=\begin{pmatrix}1 & m\\ 0 & 1\end{pmatrix}$$ 56 | - squeeze mapping: $$\mathbf{A}=\begin{pmatrix}k & 0\\ 0 & 1/k\end{pmatrix}$$ 57 | - projection onto the ''y'' axis: $$\mathbf{A}=\begin{pmatrix}0 & 0\\ 0 & 1\end{pmatrix}.$$ 58 | 59 | ------------------ 60 | 61 | # Eigenvalues and Eigenvectors 62 | 63 | An eigenvector or characteristic vector of a linear transformation is a non-zero vector whose direction does not change when that linear transformation is applied to it. More formally, if $T$ is a linear transformation from a vector space $V$ over a field $F$ into itself and $v$ is a vector in $V$ that is not the zero vector, then $v$ is an eigenvector of $T$ if $T(v)$ is a scalar multiple of $v$. This condition can be written as the equation 64 | 65 | $$T ( v ) = λ v ,$$ 66 | 67 | where $λ$ is a scalar in the field $F$, known as the eigenvalue, characteristic value, or characteristic root associated with the eigenvector $v$. 68 | 69 | ------------------ 70 | 71 | 74 | 75 | In this [shear mapping](https://en.wikipedia.org/wiki/Shear_mapping) the red arrow changes direction but the blue arrow does not. The blue arrow is an eigenvector of this shear mapping because it doesn't change direction, and since its length is unchanged, its eigenvalue is 1. 76 | 77 | ------------------ 78 | # References 79 | 80 | - Grant Sanderson. [Essence of linear algebra.](http://www.3blue1brown.com/essence-of-linear-algebra/), 2016. Retrieved February 1, 2017. 81 | - Lauren Kelly Williams. [Linear Tranformations Applet](http://math.mercyhurst.edu/~lwilliams/Applets/LinearTransformations.html), 2016. Retrieved February 1, 2017. 82 | - Wikipedia contributors. [Eigenvalues and eigenvectors](https://en.wikipedia.org/w/index.php?title=Eigenvalues_and_eigenvectors&oldid=763060013). Retrieved February 1, 2017. 83 | -------------------------------------------------------------------------------- /slides/ode.md: -------------------------------------------------------------------------------- 1 | % Ordinary differential equations 2 | % Nicolás Guarín-Zapata 3 | email: nguarinz@eafit.edu.co 4 | github: nicoguaro 5 | % February, 2019 6 | 7 | 8 | 9 | ------------------ 10 | 11 | # Ordinary differential equations 12 | 13 | An ordinary differential equation (ODE) is an equation of the form 14 | 15 | $$F(z, y, y', y'', \cdots, y^{(n)}) = 0\, ,$$ 16 | 17 | where $F$ is a function of the independent variable $z$, 18 | dependent variable $y(z)$, and its derivatives. 19 | 20 | ------------------ 21 | 22 | # Classification: Number of variables 23 | 24 | How many independent variables does the equation have? 25 | 26 | \begin{align} 27 | &L\frac{d^2 Q}{dt^2} + R\frac{dQ}{dt} + \frac{1}{C}Q = E &\text{(ODE)}\\ 28 | &\frac{\partial u}{\partial t} =\alpha \frac{\partial^2 u}{\partial x^2} &\text{(PDE)}\\ 29 | &\frac{\partial u}{\partial t} =\frac{\partial^2 u}{\partial r^2} + 30 | \frac{1}{r} \frac{\partial u}{\partial r} + 31 | \frac{1}{r^2}\frac{\partial^2 u}{\partial \theta^2} &\text{(PDE)} 32 | \end{align} 33 | 34 | ------------------ 35 | 36 | # Classification: Order 37 | 38 | What is the order of the higher derivative? 39 | 40 | \begin{align} 41 | &\frac{\partial u}{\partial t} =\alpha \frac{\partial^2 u}{\partial x^2} &\text{(Second order)}\\ 42 | &\frac{d^2 u}{d t^2} = f(t) &\text{(Second order)}\\ 43 | &\frac{d^{(3)} y}{dx^3} + 2 e^x \frac{d^2 y}{d x^2} + 44 | y\frac{d y}{dx} = x^4 &\text{(Third order)} 45 | \end{align} 46 | 47 | ------------------ 48 | 49 | # Classification: Homogeneity 50 | 51 | The equation is homogeneous if the right-hand-side of 52 | 53 | $$F(z, y, y', y'', \cdots, y^{(n)}) = G(z)\, ,$$ 54 | 55 | is zero. 56 | 57 | ------------------ 58 | 59 | # Classification: Linearity 60 | 61 | The equation 62 | 63 | $$F(z, y, y', y'', \cdots, y^{(n)}) = 0\, ,$$ 64 | 65 | is linear if $F$ is a linear function of the variables $y, y', \cdots, y^{(n)}$. 66 | 67 | \begin{align} 68 | &\frac{\partial^2 u}{\partial t^2} = e^{-t} \frac{\partial^2 u}{\partial x^2} 69 | + \sin t &\text{(Linear)}\\ 70 | &\frac{d^2 \theta}{d t^2} = \frac{g}{l}\sin\theta &\text{(Non-linear)} 71 | \end{align} 72 | 73 | ------------------ 74 | 75 | # Classification: Type of coefficients 76 | 77 | In the case of linear equations, we analyze the coefficients of the linear 78 | combination. Are these coefficients constant or functions of $x$? 79 | 80 | \begin{align} 81 | &a\frac{d^2 u}{d t^2} + b \frac{d u}{d t} + c u = 0 &\text{(Constant coefficients)}\\ 82 | &\frac{d}{dx}\left(x\frac{d w}{dx}\right) = -\omega^2 w &\text{(Variable coefficients)} 83 | \end{align} 84 | 85 | 86 | ------------------ 87 | 88 | # Examples: Free fall 89 | 90 | 91 | 92 | 97 | 103 | 104 |
93 | In this case, gravity is the only force acting upon an object. The equation 94 | reads 95 | $$y'' =g = \text{const}$$ 96 | 98 | 102 |
105 | 106 | ------------------ 107 | 108 | # Examples: Parachute falling 109 | 110 | 111 | 112 | 117 | 123 | 124 |
113 | This case is similar to the previous one, but there is air resistance (drag). 114 | The drag force is normally as a constant multiplied by the square of the speed 115 | $$m\frac{d^2 y}{dt^2} = mg - b\left(\frac{dy}{dt}\right)^2$$ 116 | 118 | 122 |
125 | 126 | ------------------ 127 | 128 | # Examples: Pendulum 129 | 130 | 131 | 132 | 137 | 143 | 144 |
133 | 136 | 138 | A pendulum is a weight suspended from a pivot that can swing freely. The 139 | equation for a simple pendulum is 140 | 141 | $$L\theta'' + g\sin\theta = 0$$ 142 |
145 | 146 | ------------------ 147 | 148 | # Equations of first order 149 | 150 | Equations of first order are of the form 151 | 152 | $$\frac{\mathrm{d} y}{\mathrm{d} z} = f(z, y)\, .$$ 153 | 154 | For an arbitrary function $f$ there is not method for solving this equation 155 | in terms of elementary functions. 156 | 157 | ------------------ 158 | 159 | # Linear equations of first order 160 | 161 | They are of the form 162 | 163 | $$a_0(z) y' + a_1(z) y = f(z)\, .$$ 164 | 165 | We are assuming that $a_0(z)$, $a_1(z)$, and $f(z)$ are continuous. 166 | 167 | ------------------ 168 | 169 | # Linear equations of first order: homogeneous case 170 | 171 | We can write it as 172 | 173 | $$\frac{\mathrm{d}} {\mathrm{d}z}\ln y + \frac{a_1(z)}{a_0(z)} = 0\, ,$$ 174 | 175 | after integration 176 | 177 | $$y = y_0 \exp\left[-\int\limits_{z_0}^z \frac{a_1(t)}{a_0(t)}\mathrm{d}t\right]\, .$$ 178 | 179 | ------------------ 180 | 181 | # Linear equations of first order: inhomogeneous case 182 | 183 | To solve the equation 184 | 185 | $$y' + \frac{a_1(z)}{a_0(z)} y = \frac{f(z)}{a_0(z)}\, ,$$ 186 | 187 | with $y(0)=y_0$, we use the adjoint equation 188 | 189 | $$x' - \frac{a_1(z)}{a_0(z)} x = 0\, ,$$ 190 | 191 | with $x(0) = 1$. 192 | 193 | ------------------ 194 | 195 | # Linear equations of first order: inhomogeneous case 196 | 197 | And we solve the differential equation 198 | 199 | $$(xy)' = xy' + x' y = x\frac{f(z)}{a_0(z)}\, ,$$ 200 | 201 | and, after integration 202 | 203 | $$y = \frac{y_0}{x} + \frac{1}{x}\int\limits_{0}^{z}\frac{x f(t)}{a_0(t)}\mathrm{d}t\, .$$ 204 | 205 | ------------------ 206 | 207 | # Systems of differential equations 208 | 209 | Sometimes we have more than one differential equations. For example, 210 | 211 | $$ 212 | \begin{align} 213 | &F_1(z, y_1, y_1', y_1'', y_2, y_2') = 0\, ,\\ 214 | &F_2(z, y_1, y_1', y_2, y_2', y_2'', y_2''') = 0\, . 215 | \end{align} 216 | $$ 217 | 218 | 219 | ------------------ 220 | 221 | # Systems of differential equations 222 | 223 | Using the new variables 224 | 225 | $$ 226 | \begin{align} 227 | &x_1 = y_1\, , & x_4 = y_2'\, ,\\ 228 | &x_2 = y_1'\, , & x_5 = y_2''\, ,\\ 229 | &x_3 = y_2\, , & 230 | \end{align} 231 | $$ 232 | 233 | we can rewrite the following system 234 | 235 | $$ 236 | \begin{align} 237 | &x_1' = G_1(z, x_1, x_2, x_3, x_4) = x_2\, ,\\ 238 | &x_2' = G_2(z, x_1, x_2, x_3, x_4)\, ,\\ 239 | &x_3' = G_3(z, x_1, x_2, x_3, x_4) = x_4\, ,\\ 240 | &x_4' = G_4(z, x_1, x_2, x_3, x_4) = x_5\, ,\\ 241 | &x_5' = G_5(z, x_1, x_2, x_3, x_4)\, .\\ 242 | \end{align} 243 | $$ 244 | 245 | 246 | ------------------ 247 | 248 | # Power series solutions 249 | 250 | Consider the second-order linear differential equation 251 | 252 | $$a_0(z)f''(z)+a_1(z)f'(z)+a_2(z)f(z)=0\, ,$$ 253 | 254 | where $a_0$ is nonzero for all $z$, and $a_1/a_0$ and $a_2/a_0$ are analytic 255 | functions. 256 | 257 | The power series method calls for the construction of a power series solution 258 | $$f=\sum_{k=0}^\infty A_kz^k\, ,$$ 259 | 260 | to find the form of the coefficients $A_k$. 261 | 262 | ------------------ 263 | 264 | # Power series solutions: Example 1 265 | 266 | Consider the equation 267 | 268 | $$y' = y\, .$$ 269 | 270 | Assuming $y=\sum_{k=0}^\infty A_k z^k$, leads to 271 | 272 | $$\sum_{k=1}^\infty[A_{k-1} - k A_k] z^k = 0\, ,$$ 273 | 274 | or 275 | 276 | $$A_k = \frac{A_{k-1}}{k}\, .$$ 277 | 278 | ------------------ 279 | 280 | # Power series solutions: Example 2 281 | 282 | Consider the (not so simple) equation 283 | 284 | $$y'' - z y = 0\, .$$ 285 | 286 | Assuming $y=\sum_{k=0}^\infty A_k z^k$, leads to 287 | 288 | $$2A_2 + \sum_{k=1}^\infty[(k + 2)(k + 1)A_{k+2} - A_{k-1}] z^k = 0\, .$$ 289 | 290 | ------------------ 291 | 292 | # Power series solutions: Example 2 293 | 294 | We obtain the general solution 295 | 296 | \begin{align} 297 | y(z) =& 298 | C_0\left[1 + 299 | \sum_{k=1}^{\infty} \frac{z^{3k}}{(2\cdot 3) (5\cdot 6) \cdots ((3k-1) \cdot (3k))}\right]\\ 300 | &+ C_1\left[z + 301 | \sum_{k=1}^{\infty} \frac{z^{3k+1}}{(3\cdot 4) (6\cdot 7) \cdots ((3k) \cdot (3k+1))}\right] 302 | \end{align} 303 | 304 | ------------------ 305 | 306 | # Power series solutions: Example 2 307 | 308 | 309 | 310 | 311 | 322 | 327 | 328 |
312 | These series represent a group of _special functions_ named Airy functions 313 | 314 | $$y(z) = \mathrm{Ai}(z) + \mathrm{Bi}(z)\, ,$$ 315 | 316 | due to the British astronomer George Biddel Airy. 317 | 318 | They appear in the solution of Scrödinger equation for a particle 319 | confined within a triangular potential. They are also important 320 | in microscopy and astronomy. 321 | 323 | 326 |
329 | 330 | ------------------ 331 | 332 | # Power series solutions: A nonlinear example 333 | 334 | The equation $x' = 1 + x^2$, with initial condition $x(0) = 0$, has the 335 | solution $x = \tan(t)$. We could use the power series method, assuming 336 | $x = \sum_{k=0}^\infty A_k t^k$, to obtain 337 | 338 | $$\sum_{k=0}^{\infty} (k + 1) A_{k+1} t^k = 339 | 1 + \left(\sum_{k=0}^{\infty} A_k t^k\right)^2 = 340 | 1 + A_0^2 + \sum_{k=1}^\infty\left[\sum_{j=0}^{k} A_j A_{k-j}\right]t^k$$ 341 | 342 | and the coefficients are 343 | 344 | \begin{align} 345 | A_0 &= 0\\ 346 | A_1 &= 1 + A_0^2\\ 347 | A_{k + 1} &= \frac{1}{k + 1}\sum_{j=0}^{k} A_{k} A_{j - k}\quad \forall k\in \mathbb{N} 348 | \end{align} 349 | 350 | ------------------ 351 | 352 | # Frobenius method 353 | 354 | This method gives as a way to find infinite series solutions for the 355 | differential equation 356 | 357 | $$z^2 u'' + p(z) z u'' + q(z) u = 0\, ,$$ 358 | 359 | in the vinicinity of the regular singular point $z=0$. We could divide by 360 | $z^2$ to obtain 361 | 362 | $$u'' + \frac{p(z)}{z} u' + \frac{q(z)}{z^2} u = 0\, .$$ 363 | 364 | 365 | ------------------ 366 | 367 | # Frobenius method 368 | 369 | We are looking for a solution of the form 370 | 371 | $$u(z) = \sum_{k=0}^\infty A_k z^{k + r}\quad A_0\neq 0, r\in \mathbb{R}\, ,$$ 372 | 373 | that leads us to the equation 374 | 375 | \begin{align} 376 | 0 =&[r (r - 1) + p(z) + q(z)]A_0 z^r \\ 377 | &+ \sum_{k=1}^{\infty} [(k + r - 1)(k + r) + p(z)(k + r) + q(z)]A_k z^{k + r} 378 | \end{align} 379 | 380 | ------------------ 381 | 382 | # Frobenius method 383 | 384 | The expression 385 | 386 | $$I(r) \equiv r(r - 1) + p(0)r + q(0)$$ 387 | 388 | is called the inditial equation, and its roots give us the values for $r$. 389 | 390 | Depending on the values for the roots, we have different ways to obtain 391 | two linearly independent solutions. 392 | 393 | 394 | ------------------ 395 | 396 | # Frobenius method: Case 1 397 | 398 | 399 | The roots do not differ by an integer 400 | 401 | \begin{align} 402 | y_1 &= \sum_{k=0}^\infty A_k z^{k + r_1}\quad A_0\neq 0\\ 403 | y_2 &= \sum_{k=0}^\infty A_k z^{k + r_2}\quad A_0\neq 0 404 | \end{align} 405 | 406 | ------------------ 407 | 408 | # Frobenius method: Case 2 409 | 410 | 411 | The roots do differ by an integer 412 | 413 | \begin{align} 414 | y_1 &= \sum_{k=0}^\infty A_k z^{k + r_1}\quad A_0\neq 0\\ 415 | y_2 &= C y_1 \ln(z) + \sum_{k=0}^\infty A_k z^{k + r_2}\quad A_0\neq 0 416 | \end{align} 417 | 418 | where $C$ is a constant that could be zero. 419 | 420 | ------------------ 421 | 422 | # Frobenius method: Case 3 423 | 424 | 425 | The roots are the same 426 | 427 | \begin{align} 428 | y_1 &= \sum_{k=0}^\infty A_k z^{k + r_1}\quad A_0\neq 0\\ 429 | y_2 &= y_1 \ln(z) + \sum_{k=0}^\infty A_k z^{k + r_2}\quad A_0\neq 0 430 | \end{align} 431 | 432 | ------------------ 433 | 434 | # Bessel equation 435 | 436 | The Bessel equation is of the form 437 | 438 | $$z^2 y'' + z y' + (z^2 - \nu^2) y = 0\, .$$ 439 | 440 | And it appears frequently when solving problems in cylindrical or spherical 441 | coordinates. Particularly, when solving the temperature distribution of a 442 | circular plate or the vibration or a membrane. 443 | 444 | 445 | ------------------ 446 | 447 | # Bessel equation: Sketch of solution 448 | 449 | After pluging our infinite series we obtain 450 | 451 | $$A_0 (r^2 - \nu^2) z^r + z^r\sum_{k=1}^\infty A_k [(n + r)^2 - \nu^2]z^n + 452 | z^r \sum_{k=0}^\infty A_k z^{n + 2} = 0 $$ 453 | 454 | And the indicial equation 455 | 456 | $$r^2 - \nu^2 = 0$$ 457 | 458 | has as solutions $r_1 = \nu$, $r_2 = -\nu$. 459 | 460 | ------------------ 461 | 462 | # Bessel equation: Sketch of solution 463 | 464 | 465 | If we solve the recurrence relations for $r_1 =\nu$, we end up with 466 | 467 | 468 | $$A_{2k} = -\frac{A_{2k - 2}}{2^2 n (n + \nu)}$$ 469 | 470 | and the solution renders 471 | 472 | $$y = A_0 \sum_{n=0}^\infty \frac{(-1)^n}{2^n n! (1 +\nu)(2 + \nu)\cdots(n + \nu)} 473 | \left(\frac{z}{2}\right)^{2n + \nu}\, .$$ 474 | 475 | 476 | ------------------ 477 | 478 | # Bessel equation: Sketch of solution 479 | 480 | We could rewrite this _prettier_ using the Gamma function 481 | 482 | $$y = A_0 \sum_{n=0}^\infty \frac{(-1)^n}{n! \Gamma(1 + \nu + n)} 483 | \left(\frac{z}{2}\right)^{2n + \nu}\, ,$$ 484 | 485 | or simply 486 | 487 | $$y = A_0 \mathrm{J}_\nu(z)\, .$$ 488 | 489 | ------------------ 490 | 491 | # Bessel functions of the first kind 492 | 493 | 494 | 495 | 496 | 502 | 507 | 508 |
497 | They appear as the solution of Bessel equation for integer or positive $\nu$. 498 | 499 | For non-integer $\nu$, the functions $\mathrm{J}_\nu(z)$ and 500 | $\mathrm{J}_{-\nu}(z)$ are linearly independent. 501 | 503 | 506 |
509 | 510 | 511 | 512 | ------------------ 513 | 514 | # Gamma function 515 | 516 | 517 | 518 | 528 | 533 | 534 |
519 | The gamma function is an extension of the factorial 520 | 521 | $$\Gamma(n) = (n - 10)!\, .$$ 522 | 523 | The Gamma function is defined for all complex numbers except for non-positive 524 | integers. For complex numbers with a positive real part, it is defined via a 525 | convergent improper integral: 526 | $$\Gamma(z) = \int_{0}^{\infty} t^{z-1} e^{-t} \mathrm{d}t\, .$$ 527 | 529 | 532 |
535 | 536 | ------------------ 537 | 538 | # References 539 | 540 | - H. Hochstadt. Differential equations: a modern approach. 541 | Courier Dover Publications, 1975. 542 | 543 | - Erwin Kreyszig. Advanced engineering mathematics. John Wiley & Sons, 2010. 544 | 545 | - Dennis G. Zill. Ecuaciones diferenciales: con aplicaciones demodelado. 546 | Iternational Thomson Editores, 1997. 547 | 548 | - Ruryk, 2011. Oscilatting pendulum. Retrieved from: 549 | https://commons.wikimedia.org/wiki/File:PenduloTmg.gif 550 | -------------------------------------------------------------------------------- /slides/style.css: -------------------------------------------------------------------------------- 1 | /* slidy.css 2 | Copyright (c) 2005-2010 W3C (MIT, ERCIM, Keio), All Rights Reserved. 3 | W3C liability, trademark, document use and software licensing 4 | rules apply, see: 5 | http://www.w3.org/Consortium/Legal/copyright-documents 6 | http://www.w3.org/Consortium/Legal/copyright-software 7 | */ 8 | body 9 | { 10 | margin: 0 0 0 0; 11 | padding: 0 0 0 0; 12 | width: 100%; 13 | height: 100%; 14 | color: #333333; 15 | background-color: #eeeeee; 16 | font-family: "Source Sans Pro", sans-serif; 17 | font-size: 30pt; 18 | } 19 | 20 | .slide { 21 | font-size: 40pt; 22 | } 23 | 24 | 25 | .centObj { 26 | display: block; 27 | margin-left: auto; 28 | margin-right: auto; 29 | } 30 | 31 | div.toolbar { 32 | position: fixed; z-index: 200; 33 | top: auto; bottom: 0; left: 0; right: 0; 34 | height: 2.0em; text-align: right; 35 | padding-left: 1em; 36 | padding-right: 1em; 37 | font-size: 60%; 38 | color: red; 39 | background-color: rgb(240,240,240); 40 | border-top: solid 1px rgb(180,180,180); 41 | } 42 | 43 | div.toolbar span.copyright { 44 | color: #333333; 45 | margin-left: 0.5em; 46 | } 47 | 48 | div.initial_prompt { 49 | position: absolute; 50 | z-index: 1000; 51 | bottom: 1.2em; 52 | width: 100%; 53 | background-color: rgb(200,200,200); 54 | opacity: 0.35; 55 | background-color: rgb(200,200,200, 0.35); 56 | cursor: pointer; 57 | } 58 | 59 | div.initial_prompt p.help { 60 | text-align: center; 61 | } 62 | 63 | div.initial_prompt p.close { 64 | text-align: right; 65 | font-style: italic; 66 | } 67 | 68 | div.slidy_toc { 69 | position: absolute; 70 | z-index: 300; 71 | width: 60%; 72 | max-width: 30em; 73 | height: 30em; 74 | overflow: auto; 75 | top: auto; 76 | right: auto; 77 | left: 4em; 78 | bottom: 4em; 79 | padding: 1em; 80 | background: rgb(240,240,240); 81 | border-style: solid; 82 | border-width: 2px; 83 | font-size: 60%; 84 | } 85 | 86 | div.slidy_toc .toc_heading { 87 | text-align: center; 88 | width: 100%; 89 | margin: 0; 90 | margin-bottom: 1em; 91 | border-bottom-style: solid; 92 | border-bottom-color: rgb(180,180,180); 93 | border-bottom-width: 1px; 94 | } 95 | 96 | div.slide { 97 | z-index: 20; 98 | margin: 0 0 0 0; 99 | padding-top: 20px; 100 | padding-bottom: 20px; 101 | padding-left: 20px; 102 | padding-right: 20px; 103 | border-width: 0; 104 | clear: both; 105 | top: 0; 106 | bottom: 0; 107 | left: 0; 108 | right: 0; 109 | line-height: 120%; 110 | background-color: transparent; 111 | } 112 | 113 | div.background { 114 | display: none; 115 | } 116 | 117 | div.handout { 118 | margin-left: 20px; 119 | margin-right: 20px; 120 | } 121 | 122 | div.slide.titlepage { 123 | text-align: center; 124 | color: #333333; 125 | } 126 | 127 | div.slide.titlepage h1 { 128 | padding-top: 10%; 129 | margin-right: 0; 130 | } 131 | 132 | div.slide h1 { 133 | padding-left: 0pt; 134 | padding-right: 20pt; 135 | padding-top: 4pt; 136 | padding-bottom: 50pt; 137 | margin-top: 0; 138 | margin-left: 0; 139 | margin-right: 60pt; 140 | margin-bottom: 0.5em; 141 | display: block; 142 | color: #333333; 143 | font-size: 180%; 144 | line-height: 1.2em; 145 | background: transparent; 146 | } 147 | 148 | div.toc { 149 | position: absolute; 150 | top: auto; 151 | bottom: 4em; 152 | left: 4em; 153 | right: auto; 154 | width: 60%; 155 | max-width: 30em; 156 | height: 30em; 157 | border: solid thin black; 158 | padding: 1em; 159 | background: rgb(240,240,240); 160 | color: #333333; 161 | z-index: 300; 162 | overflow: auto; 163 | display: block; 164 | visibility: visible; 165 | } 166 | 167 | div.toc-heading { 168 | width: 100%; 169 | border-bottom: solid 1px rgb(180,180,180); 170 | margin-bottom: 1em; 171 | text-align: center; 172 | } 173 | 174 | pre { 175 | font-size: 80%; 176 | font-weight: bold; 177 | line-height: 120%; 178 | padding-top: 0.2em; 179 | padding-bottom: 0.2em; 180 | padding-left: 1em; 181 | padding-right: 1em; 182 | border-style: solid; 183 | border-left-width: 1em; 184 | border-top-width: thin; 185 | border-right-width: thin; 186 | border-bottom-width: thin; 187 | border-color: #95ABD0; 188 | color: #00428C; 189 | background-color: #E4E5E7; 190 | } 191 | 192 | li pre { margin-left: 0; } 193 | 194 | blockquote { font-style: italic } 195 | 196 | img { background-color: transparent } 197 | 198 | p.copyright { font-size: smaller } 199 | 200 | .center { text-align: center } 201 | .footnote { font-size: smaller; margin-left: 2em; } 202 | 203 | a img { border-width: 0; border-style: none } 204 | 205 | a:visited { color: navy } 206 | a:link { color: navy } 207 | a:hover { color: red; text-decoration: underline } 208 | a:active { color: red; text-decoration: underline } 209 | 210 | a {text-decoration: none} 211 | .navbar a:link {color: white} 212 | .navbar a:visited {color: yellow} 213 | .navbar a:active {color: red} 214 | .navbar a:hover {color: red} 215 | 216 | ul { list-style-type: square; } 217 | ul ul { list-style-type: disc; } 218 | ul ul ul { list-style-type: circle; } 219 | ul ul ul ul { list-style-type: disc; } 220 | li { margin-left: 0.5em; margin-top: 0.5em; } 221 | li li { font-size: 85%; font-style: italic } 222 | li li li { font-size: 85%; font-style: normal } 223 | 224 | div dt 225 | { 226 | margin-left: 0; 227 | margin-top: 1em; 228 | margin-bottom: 0.5em; 229 | font-weight: bold; 230 | } 231 | div dd 232 | { 233 | margin-left: 2em; 234 | margin-bottom: 0.5em; 235 | } 236 | 237 | 238 | p,pre,ul,ol,blockquote,h2,h3,h4,h5,h6,dl,table { 239 | margin-left: 1em; 240 | margin-right: 1em; 241 | } 242 | 243 | p.subhead { font-weight: bold; margin-top: 2em; } 244 | 245 | .smaller { font-size: smaller } 246 | .bigger { font-size: 130% } 247 | 248 | td,th { padding: 0.2em } 249 | 250 | ul { 251 | margin: 0.5em 1.5em 0.5em 1.5em; 252 | padding: 0; 253 | } 254 | 255 | ol { 256 | margin: 0.5em 1.5em 0.5em 1.5em; 257 | padding: 0; 258 | } 259 | 260 | ul { list-style-type: square; } 261 | ul ul { list-style-type: disc; } 262 | ul ul ul { list-style-type: circle; } 263 | ul ul ul ul { list-style-type: disc; } 264 | 265 | ul li { 266 | list-style: square; 267 | margin: 0.1em 0em 0.6em 0; 268 | padding: 0 0 0 0; 269 | line-height: 140%; 270 | } 271 | 272 | ol li { 273 | margin: 0.1em 0em 0.6em 1.5em; 274 | padding: 0 0 0 0px; 275 | line-height: 140%; 276 | list-style-type: decimal; 277 | } 278 | 279 | li ul li { 280 | font-size: 85%; 281 | font-style: italic; 282 | list-style-type: disc; 283 | background: transparent; 284 | padding: 0 0 0 0; 285 | } 286 | li li ul li { 287 | font-size: 85%; 288 | font-style: normal; 289 | list-style-type: circle; 290 | background: transparent; 291 | padding: 0 0 0 0; 292 | } 293 | li li li ul li { 294 | list-style-type: disc; 295 | background: transparent; 296 | padding: 0 0 0 0; 297 | } 298 | 299 | li ol li { 300 | list-style-type: decimal; 301 | } 302 | 303 | 304 | li li ol li { 305 | list-style-type: decimal; 306 | } 307 | 308 | /* 309 | setting class="outline on ol or ul makes it behave as an 310 | ouline list where blocklevel content in li elements is 311 | hidden by default and can be expanded or collapsed with 312 | mouse click. Set class="expand" on li to override default 313 | */ 314 | 315 | ol.outline li:hover { cursor: pointer } 316 | ol.outline li.nofold:hover { cursor: default } 317 | 318 | ul.outline li:hover { cursor: pointer } 319 | ul.outline li.nofold:hover { cursor: default } 320 | 321 | ol.outline { list-style:decimal; } 322 | ol.outline ol { list-style-type:lower-alpha } 323 | 324 | ol.outline li.nofold { 325 | padding: 0 0 0 20px; 326 | background: transparent url(../graphics/nofold-dim.gif) no-repeat 0px 0.5em; 327 | } 328 | ol.outline li.unfolded { 329 | padding: 0 0 0 20px; 330 | background: transparent url(../graphics/fold-dim.gif) no-repeat 0px 0.5em; 331 | } 332 | ol.outline li.folded { 333 | padding: 0 0 0 20px; 334 | background: transparent url(../graphics/unfold-dim.gif) no-repeat 0px 0.5em; 335 | } 336 | ol.outline li.unfolded:hover { 337 | padding: 0 0 0 20px; 338 | background: transparent url(../graphics/fold.gif) no-repeat 0px 0.5em; 339 | } 340 | ol.outline li.folded:hover { 341 | padding: 0 0 0 20px; 342 | background: transparent url(../graphics/unfold.gif) no-repeat 0px 0.5em; 343 | } 344 | 345 | ul.outline li.nofold { 346 | padding: 0 0 0 20px; 347 | background: transparent url(../graphics/nofold-dim.gif) no-repeat 0px 0.5em; 348 | } 349 | ul.outline li.unfolded { 350 | padding: 0 0 0 20px; 351 | background: transparent url(../graphics/fold-dim.gif) no-repeat 0px 0.5em; 352 | } 353 | ul.outline li.folded { 354 | padding: 0 0 0 20px; 355 | background: transparent url(../graphics/unfold-dim.gif) no-repeat 0px 0.5em; 356 | } 357 | ul.outline li.unfolded:hover { 358 | padding: 0 0 0 20px; 359 | background: transparent url(../graphics/fold.gif) no-repeat 0px 0.5em; 360 | } 361 | ul.outline li.folded:hover { 362 | padding: 0 0 0 20px; 363 | background: transparent url(../graphics/unfold.gif) no-repeat 0px 0.5em; 364 | } 365 | 366 | /* for slides with class "title" in table of contents */ 367 | a.titleslide { font-weight: bold; font-style: italic } 368 | 369 | /* 370 | hide images for work around for save as bug 371 | where browsers fail to save images used by CSS 372 | */ 373 | img.hidden { display: none; visibility: hidden } 374 | div.initial_prompt { display: none; visibility: hidden } 375 | 376 | div.slide { 377 | visibility: visible; 378 | position: inherit; 379 | } 380 | div.handout { 381 | border-top-style: solid; 382 | border-top-width: thin; 383 | border-top-color: black; 384 | } 385 | 386 | @media screen { 387 | .hidden { display: none; visibility: visible } 388 | 389 | div.slide.hidden { display: block; visibility: visible } 390 | div.handout.hidden { display: block; visibility: visible } 391 | div.background { display: none; visibility: hidden } 392 | body.single_slide div.initial_prompt { display: block; visibility: visible } 393 | body.single_slide div.background { display: block; visibility: visible } 394 | body.single_slide div.background.hidden { display: none; visibility: hidden } 395 | body.single_slide .invisible { visibility: hidden } 396 | body.single_slide .hidden { display: none; visibility: hidden } 397 | body.single_slide div.slide { position: absolute } 398 | body.single_slide div.handout { display: none; visibility: hidden } 399 | } 400 | 401 | @media print { 402 | .hidden { display: block; visibility: visible } 403 | 404 | div.slide pre { font-size: 60%; padding-left: 0.5em; } 405 | div.toolbar { display: none; visibility: hidden; } 406 | div.slidy_toc { display: none; visibility: hidden; } 407 | div.background { display: none; visibility: hidden; } 408 | div.slide { page-break-before: always } 409 | /* :first-child isn't reliable for print media */ 410 | div.slide.first-slide { page-break-before: avoid } 411 | } 412 | -------------------------------------------------------------------------------- /slides/vector_calculus.html: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | Curvilinear coordinates and vector calculus 13 | 19 | 21 | 23 | 24 | 26 | 27 | 28 |
29 |

Curvilinear coordinates and vector calculus

30 |

31 | Nicolás Guarín-Zapata
email: nguarinz@eafit.edu.co
github: nicoguaro 32 |

33 |

January, 2019

34 |
35 |
36 |

Tensors

37 | 38 | 39 | 47 | 52 | 53 |
40 |

Depiction of the Cauchy stress tensor, a second-order tensor. The tensor’s components, in a three-dimensional Cartesian coordinate system, form the matrix

41 |

\[\begin{align} 42 | \sigma & = \begin{bmatrix}\mathbf{T}^{(\mathbf{e}_1)} \mathbf{T}^{(\mathbf{e}_2)} \mathbf{T}^{(\mathbf{e}_3)} \\ \end{bmatrix} \\ 43 | & = \begin{bmatrix} \sigma_{11} & \sigma_{12} & \sigma_{13} \\ \sigma_{21} & \sigma_{22} & \sigma_{23} \\ \sigma_{31} & \sigma_{32} & \sigma_{33} \end{bmatrix}\\ 44 | \end{align}\]

45 | whose columns are the stresses (forces per unit area) acting on the \(\mathbf{e}_1\) , \(\mathbf{e}_2\), and \(\mathbf{e}_3\) faces of the cube. 46 |
48 | 51 |
54 |
55 |
56 |

Kronecker Delta

57 |

The Kronecker delta is defined by

58 |

\[\delta_{ij} = \begin{cases} 59 | 1\quad i=j\\ 60 | 0\quad i\neq j 61 | \end{cases}\]

62 |

and it can be thought as the components of the identity tensor.

63 |
64 |
65 |

Levi-Civita symbol

66 | 67 | 68 | 81 | 86 | 87 |
69 |

It is defined by the cross product between element of an orthonormal basis

70 |

\[\hat{\mathbf{e}}_i \times \hat{\mathbf{e}}_j = \sum_{k=1}^{3}\epsilon_{ijk} \hat{\mathbf{e}}_k\]

71 |

with

72 | \[\begin{align} 73 | \epsilon_{ijk} &= \frac{1}{2} (i - j)(j - k)(k - i)\\ 74 | &= \begin{cases} 75 | 1\quad \text{even permutation}\\ 76 | -1\quad \text{odd permutation}\\ 77 | 0\quad \text{repeated indices}\\ 78 | \end{cases} 79 | \end{align}\] 80 |
82 | 85 |
88 |
89 |
90 |

Some operations between second-order Tensors

91 | 97 |
98 |
99 |

Curvilinear coordinates example: Cylindrical Coordinates

100 | 102 |
103 |
104 |

Coordinate systems

105 |

Two common examples of curvilinear coordinates are

106 |

Cylindrical coordinates

107 |

\[\begin{align} 108 | x =& \rho \cos\varphi\\ 109 | y =& \rho \sin\varphi\\ 110 | z =& z 111 | \end{align}\]

112 |

Spherical coordinates

113 |

\[\begin{align} 114 | x =& r \sin\theta \cos\varphi\\ 115 | y =& r \sin\theta \sin\varphi\\ 116 | z =& r \cos\theta 117 | \end{align}\]

118 |
119 |
120 |

Transformations

121 |

We can write the position vector as

122 |

\[d\mathbf{r} = \sum\limits_{i=1}^3 \frac{\partial \mathbf{r}}{\partial u_i} du_i \, .\]

123 |

The factor \(\partial \mathbf{r}/\partial u_i\) is a non-unitary vector, we can introduce a normalized base \(\hat{\mathbf{e}}_i\)

124 |

\[\frac{\partial \mathbf{r}}{\partial u_i} = h_i \hat{\mathbf{e}}_i \]

125 |

where

126 |

\[\left| \frac{\partial \mathbf{r}}{\partial u_i}\right| = h_i\]

127 |

is the scale factor.

128 |
129 |
130 |

Jacobian

131 |

We can rewrite the transformation, in components, as

132 |

\[d x_i = \sum_j \frac{\partial x_i}{\partial u_j} du_j = \sum_j J_{ij} du_j \, ,\]

133 |

where \(J_{ij} = \partial x_i/\partial u_j\) are the components of the Jacobian matrix.

134 |

And, its determinant represents the (local) change in volume of the transformation

135 |

\[ |J| = h_1 h_2 h_3\, .\]

136 |
137 |
138 |

Line, surface and volume differentials

139 |

We can rewrite the transformation as

140 |

\[ d\mathbf{r} = \sum_{i=1} h_i \hat{\mathbf{e}}_i du_i = \sum_{i=1}^3 d\mathbf{l}_i \, ,\]

141 |

where \(d\mathbf{l}_i = h_i \hat{\mathbf{e}}_i du_i\) is the line differential along the coordinate \(u_i\).

142 |

We can define the surface differentials as the vectors that are perpendicular to the differential areas according to the right hand convention, namely

143 |

\[d\mathbf{S}_i = d\mathbf{l}_j \times d\mathbf{l}_k = 144 | h_j h_k \hat{\mathbf{e}}_i du_j du_k = \hat{\mathbf{e}}_i dS_i\]

145 |

And the volume differential is given by the volume of the curvilinear parallelepiped defined by the line differentials, i.e.

146 |

\[dV = d\mathbf{l}_1 \cdot (d\mathbf{l}_2 \times \mathbf{l}_3) = 147 | h_1 h_2 h_3 du_1 du_2 du_3 \, .\]

148 |
149 |
150 |

Differential operators

151 |

Many physical equations are written as differential equations, and these can be interpreted as the action of certain operators over some particular functions knows as fields. There are fields of different nature:

152 | 157 |

\[\underline{\underline{\sigma}} = 158 | \begin{pmatrix} 159 | x^2 &xy &0\\ 160 | xy &y^2 &0\\ 161 | 0 &0 &1 162 | \end{pmatrix}\]

163 |
164 |
165 | 166 |

Gradient

167 |

The gradient of a scalar function \(\phi\), denoted by \(\nabla \phi\) is given by

168 |

\[\nabla \phi \equiv \sum_{i=1}^3\frac{\hat{\mathbf{e}}_i}{h_i} 169 | \frac{\partial \phi}{\partial u_i}\]

170 |

In spherical coordinates it reads

171 |

\[\begin{align} 172 | \nabla \phi &= \frac{\hat{\mathbf{e}}_r}{h_r}\frac{\partial \phi}{\partial r} + 173 | \frac{\hat{\mathbf{e}}_\theta}{h_\theta}\frac{\partial \phi}{\partial \theta} + 174 | \frac{\hat{\mathbf{e}}_\varphi}{h_\varphi}\frac{\partial \phi}{\partial \varphi} \\ 175 | &= \hat{\mathbf{e}}_r \frac{\partial \phi}{\partial r} + 176 | + \frac{\hat{\mathbf{e}}_\theta}{r}\frac{\partial \phi}{\partial \theta} 177 | + \frac{\hat{\mathbf{e}}_\varphi}{r\sin\theta}\frac{\partial \phi}{\partial \varphi} 178 | \end{align}\]

179 |
180 |
181 | 182 |

Gradient: example

183 |

The function \(f(x,y) = -[\cos^2x + \cos^2y]^2\), has as gradient

184 |

\[ \nabla f(x, y) = 4[\cos^2 x + \cos^2 y](\cos x \sin x, \sin x \cos y )\]

185 |

188 |
189 |
190 | 191 |

Divergence

192 |

The divergence of a vector function \(\mathbf{B}\), denoted by \(\nabla\cdot\mathbf{B}\) or , is given by

193 |

\[\nabla \cdot \mathbf{B} = \operatorname{div} \mathbf{B} = \frac{1}{h}\sum_{i=1}^3 194 | \frac{\partial}{\partial u_i} \left(\frac{B_i h}{h_i}\right)\]

195 |

with \(h = h_1 h_2 h_3\).

196 |

In spherical coordinates it reads

197 |

\[ 198 | \nabla \cdot \mathbf{B} = \operatorname{div} \mathbf{B} 199 | = \frac{1}{r^2}\frac{\partial}{\partial r}(r^2 B_r) 200 | + \frac{1}{r\sin\theta}\frac{\partial}{\partial \theta}(\sin\theta B_\theta) 201 | + \frac{1}{r\sin\theta}\frac{\partial}{\partial \varphi}(B_\varphi) 202 | \]

203 |
204 |
205 | 206 |

Divergence and the Gauss theorem

207 |

We can understand the divergence as the flux per unit volume \(\operatorname{div}\mathbf{B} = d\phi/dV\), and we can extend this calculation to a finite surface

208 |

\[\phi = \oint_S \mathbf{B}\cdot d\mathbf{S} = \int_V \operatorname{div}\mathbf{B} dV\, ,\]

209 |

The second part is the Gauss theorem

210 |

\[\oint_S \mathbf{B}\cdot d\mathbf{S} = \int_V \operatorname{div}\mathbf{B} dV\, .\]

211 |
212 |
213 | 214 |

Curl

215 |

The curl describes the infinitesimal rotation of a (3-dimensional) vector field. The curl of a field \(\mathbf{B}\), denoted by \(\operatorname{curl}\mathbf{B}\), \(\operatorname{rot}\mathbf{B}\), or \(\nabla\times\mathbf{B}\), is defined by

216 |

\[\operatorname{rot} \mathbf{B} = \frac{1}{h}\sum_{i,j,k=1}^1 \hat{\mathbf{e}}_i 217 | \epsilon_{ijk} h_i \frac{\partial}{\partial u_j} (B_k h_k)\, ,\]

218 |

where \(h = h_1 h_2 h_3\), and \(\epsilon_{ijk}\) is the Levi-Civita symbol.

219 |

The Stokes theorem tranform line integrals to surface integrals, and involves the curl

220 |

\[\oint_c \mathbf{B} \cdot d\mathbf{l} = \int_S \operatorname{rot}\mathbf{B}\cdot d\mathbf{S}\]

221 |
222 |
223 | 224 |

Laplacian

225 |

The Laplacian of a scalar function \(f(u_i)\), denoted by \(\nabla\cdot\nabla f\), \(\nabla^2 f\), or \(\Delta f\), it is defined as \(\nabla\cdot\nabla f\). It is defined as

226 |

\[\nabla^2 f = \frac{1}{h}\sum_{i=1}^3 \frac{\partial}{\partial u_i} 227 | \left(\frac{h}{h_i^2}\frac{\partial f}{\partial u_i}\right)\, ,\]

228 |

with \(h = h_1 h_2 h_3\).

229 |

For a vector function, the Laplacian is defined like

230 |

\[\nabla^2\mathbf{A} = \nabla^2A_x\hat{\imath} + \nabla^2A_y\hat{\jmath} + \nabla^2A_y\hat{k}\]

231 |

for Cartesian coordinates, and

232 |

\[\nabla^2\mathbf{A} = \nabla(\nabla \cdot \mathbf{A}) - \nabla \times( \nabla \times \mathbf{A})\]

233 |

for other coordinate systems.

234 |
235 |
236 |

References

237 | 246 |
247 | 248 | 249 | -------------------------------------------------------------------------------- /slides/vector_calculus.md: -------------------------------------------------------------------------------- 1 | % Curvilinear coordinates and vector calculus 2 | % Nicolás Guarín-Zapata 3 | email: nguarinz@eafit.edu.co 4 | github: nicoguaro 5 | % January, 2019 6 | 7 | 8 | 9 | ------------------ 10 | 11 | # Tensors 12 | 13 | 14 | 15 | 27 | 32 | 33 |
16 | Depiction of the Cauchy stress tensor, a second-order tensor. 17 | The tensor's components, in a three-dimensional Cartesian coordinate 18 | system, form the matrix 19 | 20 | $$\begin{align} 21 | \sigma & = \begin{bmatrix}\mathbf{T}^{(\mathbf{e}_1)} \mathbf{T}^{(\mathbf{e}_2)} \mathbf{T}^{(\mathbf{e}_3)} \\ \end{bmatrix} \\ 22 | & = \begin{bmatrix} \sigma_{11} & \sigma_{12} & \sigma_{13} \\ \sigma_{21} & \sigma_{22} & \sigma_{23} \\ \sigma_{31} & \sigma_{32} & \sigma_{33} \end{bmatrix}\\ 23 | \end{align}$$ 24 | 25 | whose columns are the stresses (forces per unit area) acting on the $\mathbf{e}_1$ , $\mathbf{e}_2$, and $\mathbf{e}_3$ faces of the cube. 26 | 28 | 31 |
34 | 35 | ------------------ 36 | 37 | # Kronecker Delta 38 | 39 | The Kronecker delta is defined by 40 | 41 | $$\delta_{ij} = \begin{cases} 42 | 1\quad i=j\\ 43 | 0\quad i\neq j 44 | \end{cases}$$ 45 | 46 | and it can be thought as the components of the identity tensor. 47 | 48 | ------------------ 49 | 50 | # Levi-Civita symbol 51 | 52 | 53 | 54 | 70 | 71 | 76 | 77 |
55 | It is defined by the cross product between element of an orthonormal basis 56 | 57 | $$\hat{\mathbf{e}}_i \times \hat{\mathbf{e}}_j = \sum_{k=1}^{3}\epsilon_{ijk} \hat{\mathbf{e}}_k$$ 58 | 59 | with 60 | 61 | $$\begin{align} 62 | \epsilon_{ijk} &= \frac{1}{2} (i - j)(j - k)(k - i)\\ 63 | &= \begin{cases} 64 | 1\quad \text{even permutation}\\ 65 | -1\quad \text{odd permutation}\\ 66 | 0\quad \text{repeated indices}\\ 67 | \end{cases} 68 | \end{align}$$ 69 | 72 | 75 |
78 | 79 | ------------------ 80 | 81 | # Some operations between second-order Tensors 82 | 83 | - $\underline{\underline{T}} \cdot \mathbf{A} = T_{ik} A_k \hat{\mathbf{e}}_i$ 84 | 85 | - $\underline{\underline{T}} \times \mathbf{A} = \hat{\mathbf{e}}_i \epsilon_{jkl} \hat{\mathbf{e}}_l T_{ik} A_k \neq \mathbf{A} \times \underline{\underline{T}}$ 86 | 87 | - $\underline{\underline{T}} \cdot \underline{\underline{V}} = T_{ij} V_{kl}\delta_{jk} \hat{\mathbf{e}}_i \hat{\mathbf{e}}_l = T_{ik} V_{kl} \hat{\mathbf{e}}_i \hat{\mathbf{e}}_l$ 88 | 89 | - $\underline{\underline{T}} : \underline{\underline{V}} = T_{ik} V_{ki}$ 90 | 91 | ------------------ 92 | 93 | # Curvilinear coordinates example: Cylindrical Coordinates 94 | 95 | 96 | 102 | 103 | ------------------ 104 | 105 | # Coordinate systems 106 | 107 | Two common examples of curvilinear coordinates are 108 | 109 | ### Cylindrical coordinates 110 | 111 | $$\begin{align} 112 | x =& \rho \cos\varphi\\ 113 | y =& \rho \sin\varphi\\ 114 | z =& z 115 | \end{align}$$ 116 | 117 | ### Spherical coordinates 118 | 119 | $$\begin{align} 120 | x =& r \sin\theta \cos\varphi\\ 121 | y =& r \sin\theta \sin\varphi\\ 122 | z =& r \cos\theta 123 | \end{align}$$ 124 | 125 | ------------------ 126 | 127 | # Transformations 128 | 129 | We can write the position vector as 130 | 131 | $$d\mathbf{r} = \sum\limits_{i=1}^3 \frac{\partial \mathbf{r}}{\partial u_i} du_i \, .$$ 132 | 133 | The factor $\partial \mathbf{r}/\partial u_i$ is a non-unitary vector, we can 134 | introduce a normalized base $\hat{\mathbf{e}}_i$ 135 | 136 | $$\frac{\partial \mathbf{r}}{\partial u_i} = h_i \hat{\mathbf{e}}_i $$ 137 | 138 | where 139 | 140 | $$\left| \frac{\partial \mathbf{r}}{\partial u_i}\right| = h_i$$ 141 | 142 | is the [**scale factor**](https://en.wikipedia.org/wiki/Curvilinear_coordinates#Relation_to_Lam.C3.A9_coefficients). 143 | 144 | ------------------ 145 | 146 | # Jacobian 147 | 148 | We can rewrite the transformation, in components, as 149 | 150 | $$d x_i = \sum_j \frac{\partial x_i}{\partial u_j} du_j = \sum_j J_{ij} du_j \, ,$$ 151 | 152 | where $J_{ij} = \partial x_i/\partial u_j$ are the components of the [Jacobian 153 | matrix](https://en.wikipedia.org/wiki/Jacobian_matrix_and_determinant). 154 | 155 | And, its determinant represents the (local) change in volume of the 156 | transformation 157 | 158 | $$ |J| = h_1 h_2 h_3\, .$$ 159 | 160 | ------------------ 161 | 162 | # Line, surface and volume differentials 163 | 164 | We can rewrite the transformation as 165 | 166 | $$ d\mathbf{r} = \sum_{i=1} h_i \hat{\mathbf{e}}_i du_i = \sum_{i=1}^3 d\mathbf{l}_i \, ,$$ 167 | 168 | where $d\mathbf{l}_i = h_i \hat{\mathbf{e}}_i du_i$ is the _line differential_ 169 | along the coordinate $u_i$. 170 | 171 | We can define the _surface differentials_ as the vectors that are perpendicular 172 | to the differential areas according to the right hand convention, namely 173 | 174 | $$d\mathbf{S}_i = d\mathbf{l}_j \times d\mathbf{l}_k = 175 | h_j h_k \hat{\mathbf{e}}_i du_j du_k = \hat{\mathbf{e}}_i dS_i$$ 176 | 177 | And the volume differential is given by the volume of the curvilinear 178 | parallelepiped defined by the line differentials, i.e. 179 | 180 | $$dV = d\mathbf{l}_1 \cdot (d\mathbf{l}_2 \times \mathbf{l}_3) = 181 | h_1 h_2 h_3 du_1 du_2 du_3 \, .$$ 182 | 183 | ------------------ 184 | 185 | # Differential operators 186 | 187 | Many physical equations are written as differential equations, and these can be 188 | interpreted as the action of certain operators over some particular functions 189 | knows as fields. There are fields of different nature: 190 | 191 | - Scalar fields (temperature, pressure): $\phi = zy^3 - x^2$ 192 | 193 | - Vector fields (velocity, displacement): $\mathbf{A} = yz^2\hat{\imath} - 2zx^3\hat{\jmath} + xy^2\hat{k}$ 194 | 195 | - Tensor fields (strain, stresses): 196 | 197 | $$\underline{\underline{\sigma}} = 198 | \begin{pmatrix} 199 | x^2 &xy &0\\ 200 | xy &y^2 &0\\ 201 | 0 &0 &1 202 | \end{pmatrix}$$ 203 | 204 | ------------------ 205 | 206 | ## Gradient 207 | 208 | The gradient of a scalar function $\phi$, denoted by $\nabla \phi$ is given by 209 | 210 | $$\nabla \phi \equiv \sum_{i=1}^3\frac{\hat{\mathbf{e}}_i}{h_i} 211 | \frac{\partial \phi}{\partial u_i}$$ 212 | 213 | In spherical coordinates it reads 214 | 215 | $$\begin{align} 216 | \nabla \phi &= \frac{\hat{\mathbf{e}}_r}{h_r}\frac{\partial \phi}{\partial r} + 217 | \frac{\hat{\mathbf{e}}_\theta}{h_\theta}\frac{\partial \phi}{\partial \theta} + 218 | \frac{\hat{\mathbf{e}}_\varphi}{h_\varphi}\frac{\partial \phi}{\partial \varphi} \\ 219 | &= \hat{\mathbf{e}}_r \frac{\partial \phi}{\partial r} + 220 | + \frac{\hat{\mathbf{e}}_\theta}{r}\frac{\partial \phi}{\partial \theta} 221 | + \frac{\hat{\mathbf{e}}_\varphi}{r\sin\theta}\frac{\partial \phi}{\partial \varphi} 222 | \end{align}$$ 223 | 224 | ------------------ 225 | 226 | ## Gradient: example 227 | 228 | The function $f(x,y) = -[\cos^2x + \cos^2y]^2$, has as gradient 229 | 230 | $$ \nabla f(x, y) = 4[\cos^2 x + \cos^2 y](\cos x \sin x, \sin x \cos y )$$ 231 | 232 | 235 | 236 | ------------------ 237 | 238 | ## Divergence 239 | 240 | The divergence of a vector function $\mathbf{B}$, denoted by 241 | $\nabla\cdot\mathbf{B}$ or \operatorname{div} \mathbf{B} , is given by 242 | 243 | $$\nabla \cdot \mathbf{B} = \operatorname{div} \mathbf{B} = \frac{1}{h}\sum_{i=1}^3 244 | \frac{\partial}{\partial u_i} \left(\frac{B_i h}{h_i}\right)$$ 245 | 246 | with $h = h_1 h_2 h_3$. 247 | 248 | In spherical coordinates it reads 249 | 250 | $$ 251 | \nabla \cdot \mathbf{B} = \operatorname{div} \mathbf{B} 252 | = \frac{1}{r^2}\frac{\partial}{\partial r}(r^2 B_r) 253 | + \frac{1}{r\sin\theta}\frac{\partial}{\partial \theta}(\sin\theta B_\theta) 254 | + \frac{1}{r\sin\theta}\frac{\partial}{\partial \varphi}(B_\varphi) 255 | $$ 256 | 257 | ------------------ 258 | 259 | ## Divergence and the Gauss theorem 260 | 261 | We can understand the divergence as the flux per unit volume 262 | $\operatorname{div}\mathbf{B} = d\phi/dV$, and we can extend this calculation 263 | to a finite surface 264 | 265 | $$\phi = \oint_S \mathbf{B}\cdot d\mathbf{S} = \int_V \operatorname{div}\mathbf{B} dV\, ,$$ 266 | 267 | The second part is the Gauss theorem 268 | 269 | $$\oint_S \mathbf{B}\cdot d\mathbf{S} = \int_V \operatorname{div}\mathbf{B} dV\, .$$ 270 | 271 | ------------------ 272 | 273 | ## Curl 274 | 275 | The curl describes the infinitesimal rotation of a (3-dimensional) vector 276 | field. The curl of a field $\mathbf{B}$, denoted by $\operatorname{curl}\mathbf{B}$, 277 | $\operatorname{rot}\mathbf{B}$, or $\nabla\times\mathbf{B}$, is defined by 278 | 279 | $$\operatorname{rot} \mathbf{B} = \frac{1}{h}\sum_{i,j,k=1}^1 \hat{\mathbf{e}}_i 280 | \epsilon_{ijk} h_i \frac{\partial}{\partial u_j} (B_k h_k)\, ,$$ 281 | 282 | where $h = h_1 h_2 h_3$, and $\epsilon_{ijk}$ is the Levi-Civita symbol. 283 | 284 | The Stokes theorem tranform line integrals to surface integrals, and involves 285 | the curl 286 | 287 | $$\oint_c \mathbf{B} \cdot d\mathbf{l} = \int_S \operatorname{rot}\mathbf{B}\cdot d\mathbf{S}$$ 288 | 289 | ------------------ 290 | 291 | ## Laplacian 292 | 293 | The Laplacian of a scalar function $f(u_i)$, denoted by $\nabla\cdot\nabla f$, 294 | $\nabla^2 f$, or $\Delta f$, it is defined as $\nabla\cdot\nabla f$. It is defined 295 | as 296 | 297 | $$\nabla^2 f = \frac{1}{h}\sum_{i=1}^3 \frac{\partial}{\partial u_i} 298 | \left(\frac{h}{h_i^2}\frac{\partial f}{\partial u_i}\right)\, ,$$ 299 | 300 | with $h = h_1 h_2 h_3$. 301 | 302 | For a vector function, the Laplacian is defined like 303 | 304 | $$\nabla^2\mathbf{A} = \nabla^2A_x\hat{\imath} + \nabla^2A_y\hat{\jmath} + \nabla^2A_y\hat{k}$$ 305 | 306 | for Cartesian coordinates, and 307 | 308 | $$\nabla^2\mathbf{A} = \nabla(\nabla \cdot \mathbf{A}) - \nabla \times( \nabla \times \mathbf{A})$$ 309 | 310 | for other coordinate systems. 311 | 312 | ------------------ 313 | 314 | # References 315 | 316 | - Alonso Sepúlveda Soto. Física matemática. Ciencia y Tecnología. Universidad 317 | de Antioquia, 2009. 318 | 319 | - Wikipedia contributors. ["Tensor."](https://en.wikipedia.org/wiki/Tensor) 320 | Wikipedia, The Free Encyclopedia. Wikipedia, The Free Encyclopedia, 321 | Retrieved: 2 Aug. 2017. 322 | 323 | - Wikipedia contributors. ["Curvilinear coordinates."](https://en.wikipedia.org/wiki/Curvilinear_coordinates) 324 | Wikipedia, The Free Encyclopedia. Wikipedia, The Free Encyclopedia, Retrieved: 3 Feb. 2017. 325 | 326 | - Wikipedia contributors. ["Gradient."](https://en.wikipedia.org/wiki/Gradient) 327 | Wikipedia, The Free Encyclopedia. Wikipedia, The Free Encyclopedia, Retrieved: 328 | Web. 15 Feb. 2017. 329 | 330 | - Wikipedia contributors. ["Divergence."](https://en.wikipedia.org/wiki/Divergence) Wikipedia, The Free Encyclopedia. Wikipedia, The Free Encyclopedia, Retrieved: 331 | Web. 15 Feb. 2017. 332 | 333 | - Wikipedia contributors. ["Curl (mathematics)."](https://en.wikipedia.org/wiki/Curl_(mathematics)) 334 | Wikipedia, The Free Encyclopedia. Wikipedia, The Free Encyclopedia, Retrieved: 335 | Web. 15 Feb. 2017. 336 | 337 | - Wikipedia contributors. ["Laplace operator."](https://en.wikipedia.org/wiki/Laplace_operator) Wikipedia, The Free Encyclopedia. Wikipedia, The Free Encyclopedia, Retrieved: Web. 17 Feb. 2017. 338 | --------------------------------------------------------------------------------