From c30c6d537beba2308a411a2f7945ed67fff75e1b Mon Sep 17 00:00:00 2001 From: paulmasson Date: Tue, 4 May 2021 15:16:21 -0700 Subject: [PATCH] Add flow lines example --- docs/examples/flow-lines.html | 125 ++++++++++++++++++++++++++++++++++ 1 file changed, 125 insertions(+) create mode 100644 docs/examples/flow-lines.html diff --git a/docs/examples/flow-lines.html b/docs/examples/flow-lines.html new file mode 100644 index 0000000..fe3d381 --- /dev/null +++ b/docs/examples/flow-lines.html @@ -0,0 +1,125 @@ + + +Flow Lines + + + + + + + + + + +

This visualization shows typical flow lines for a three-dimensional system of real linear first-order differential equations:

+ +
+ +
+ +

A general system of linear first-order differential equations and its formal solution are

+ +\[ \frac{ d \mathbf{x} }{ dt } = A \mathbf{x} + \hspace{2em} \rightarrow \hspace{2em} \mathbf{x} = e^{At} \mathbf{x}_0 \] + +

where A is a square matrix. If it is restricted to three dimensions it will have three eigenvalues. If all elements of the matrix are real, the eigenvalues are either all real, or one real and a complex conjugate pair.

+ +

Since three eigenvalues are not enought information to determine the nine elements of the general matrix, a choice has to be made as to how the matrix will depend on only three values. The simplest choice is

+ +\[ A = \left[ \begin{array}{ccc} a & b & 0 \\ -b & a & 0 \\ 0 & 0 & c \end{array} \right] \] + +

The upper block of this matrix is a two-dimensional representation of the imaginary unit, so this matrix exponentiates easily to

+ +\[ e^{At} = \left[ \begin{array}{ccc} e^{at} \cos bt & e^{at} \sin bt & 0 \\ + -e^{at} \sin bt & e^{at} \cos bt & 0 \\ + 0 & 0 & e^{ct} \end{array} \right] \] + +

The values here relate to the eigenvalues according to

+ +\[ a = \operatorname{Re} \lambda_1 = \operatorname{Re} \lambda_2 \hspace{3em} + b = \operatorname{Im} \lambda_1 = -\operatorname{Im} \lambda_2 \hspace{3em} + c = \lambda_3 = \operatorname{Re} \lambda_3 \] + +

The exponentiated solution is visualized starting from points evenly spaced over the entire cube, with the lines truncated if they exit the framed region. The lines are colored with the scheme of this example.

+ +

Complete code for this example:

+ +

+
+
+
+

Examples Page

+ + +