In this post I'll show a fast and accurate solution for the three-diagonal system of linear equations based on Gaussian elimination. In the matrix notation the system has the following form:
\begin{equation}\left(\begin{matrix} b_0 & c_0 & 0 & \dots & 0 & 0 & 0 \\
a_1 & b_1 & c_1 & \dots & 0 & 0 & 0\\
\vdots & \vdots & \vdots & \ddots & \vdots & \vdots & \vdots \\
0 & 0 & 0 & \dots & a_{n-1} & b_{n-1} & c_{n-1} \\
0 & 0 & 0 & \dots & 0 & a_{n} & b_n \end{matrix}\right)
\left(\begin{matrix} x_0 \\ x_1 \\ \vdots \\ x_{n-1} \\x_{n}\end{matrix}\right) = \left(\begin{matrix} d_0 \\ d_1 \\ \vdots \\ d_{n-1} \\d_{n}\end{matrix}\right)
\label{eq:matrix00}\nonumber\end{equation}
or in the form of the individual equations ($n+1$ equation with $n+1$ unknown $x_i$):
\begin{eqnarray}
b_0 x_0 + c_0 x_1 &=& d_0,\nonumber\\
a_1 x_0 + b_1 x_1 + c_1 x_2 &=& d_1,\nonumber\\
\dots &=& \dots, \nonumber\\
a_i x_{i-1}+ b_i x_i + c_i x_{i+1} &=& d_i,\nonumber\\
\dots &=& \dots ,\nonumber\\
a_{n-1} x_{n-2} +b_{n-1} x_{n-1} + c_{n-1} x_{n} &=& d_{n-1},\nonumber\\
a_{n} x_{n-1} +b_{n} x_{n} &=& d_{n}.\nonumber
\end{eqnarray}
Saturday, 17 August 2013
Tuesday, 16 July 2013
"The Sun is miasma of incandescent plasma"
"Why Does the Sun Shine?" is a funny song on the solar physics originally written by Singer and Zaret.
Here it is covered by They Might Be Giants, an alternative band from
the 80's, best know for their super-mega-hit "Istanbul (Not
Constantinople)". On the same album of children's music TMBG published
another song - "Why Does the Sun Really Shine?", an errata to the
original one ("the Sun is miasma of incandescent plasma" :) ). Both songs can be heard on YouTube:
Labels:
science+art,
sun
Location:
Santa Cruz de Tenerife, Spain
Sunday, 2 June 2013
Kourganoff graphs
Scharzschild equation provides a tool to easily find and analyze the solution of the radiative transfer cases for some simple source functions. First of all, the lambda operator is clearly linear, so\begin{equation}
\Lambda[a\,f(t) + b\,g(t)] = a\,\Lambda[f(t)] + b\,\Lambda[g(t)].
\end{equation}
\Lambda[a\,f(t) + b\,g(t)] = a\,\Lambda[f(t)] + b\,\Lambda[g(t)].
\end{equation}
Labels:
IDL,
lambda operator,
numerics,
radiative transfer
Saturday, 1 June 2013
Formal solution and Schwarzschild equation
The radiation transport equation (RTE) for time-independent plane-parallel atmosphere has well known form (e.g. Rutten, 2003):
\begin{equation}
\mu\,\frac{\mathrm{d}I_{\nu}}{\mathrm{d} \tau_{\nu}} = I_{\nu} - S_{\nu},
\end{equation}
where $I_{\nu}$ is specific intensity, $S_{\nu}$ source function, $\tau_{\nu}$ is the radial optical depth and $\mu$ is the cosine of the angle between the line of sight and vertical axis. Mathematically, this is a linear first order differential equation with constant coefficients. Physically, it describes propagation of radiation through an interacting medium. Properties of the medium are hidden in the source function and the optical depth. However, to make the first step toward the solution of RTE, we will assume that the optical depth is independent variable and that the source function is a know function of it.
\begin{equation}
\mu\,\frac{\mathrm{d}I_{\nu}}{\mathrm{d} \tau_{\nu}} = I_{\nu} - S_{\nu},
\end{equation}
where $I_{\nu}$ is specific intensity, $S_{\nu}$ source function, $\tau_{\nu}$ is the radial optical depth and $\mu$ is the cosine of the angle between the line of sight and vertical axis. Mathematically, this is a linear first order differential equation with constant coefficients. Physically, it describes propagation of radiation through an interacting medium. Properties of the medium are hidden in the source function and the optical depth. However, to make the first step toward the solution of RTE, we will assume that the optical depth is independent variable and that the source function is a know function of it.
Labels:
integration,
lambda operator,
radiative transfer,
tools
Location:
Stari Grad, Serbia
Sunday, 7 April 2013
Gauss quadrature and Legendre polynomials
Numerical integration is among the most common tasks in astrophysics. Simple formulae, like trapezoidal, Newton-Cotes or Simpson, are often not enough accurate. Gauss quadrature provides a more accurate solution, but its implementation is a bit more difficult. Here I will demonstrate the implementation of that algorithm in IDL. The algorithm includes finding the coefficients of Legendre polynomials and their zeros. Both tasks are explicitly solved in the following as well.
But let's go step by step. Our task is to solve numerically the integral:
$$I = \int_a^b f(x)\, \mathrm{d} x.$$
But let's go step by step. Our task is to solve numerically the integral:
$$I = \int_a^b f(x)\, \mathrm{d} x.$$
Sunday, 10 March 2013
Exponential integrals
The formal solution of the radiative transfer equation can be expressed using exponential integrals. These are mathematical functions defined as:
\begin{equation}
E_n(x) = \int_1^{\infty}\, \exp (-yx)\frac{\mathrm{d}x}{y^n}, \;\;\;\;n = 1, 2, ...
\end{equation}
There is several important properties of these functions:
\begin{equation}
E_n(x) = \int_1^{\infty}\, \exp (-yx)\frac{\mathrm{d}x}{y^n}, \;\;\;\;n = 1, 2, ...
\end{equation}
There is several important properties of these functions:
Thursday, 21 February 2013
Spinoza's tomb
The human Mind cannot be absolutely destroyed with the Body, but something of it remains which is eternal. (from Ethica, Part V, proposition 23)
Baruch (Benedict de) Spinoza
(24 November 1632 - 21 February 1677)
Dutch philosopher, born in Jodenbuurt in Amsterdam, buried in the churchyard of Nieuwe Kerk in Den Haag.
(Photo was taken on a sunny afternoon in May, 2010.)
Labels:
philosophy,
science+history,
spinoza
Location:
Zuidwal, The Hague, The Netherlands
Subscribe to:
Posts (Atom)