スキップしてメイン コンテンツに移動

Visualization of Variational method

Introduction
Today, I will implement visualization of Variational method. Variational method is used when we want to minimize functional. functional is function of function. Please look at [1],[2],[3],[5] and [6].

Overview

  • formula 
  • Implementation
  • Visualization
Formula
I used following formula.
$$F(x) = \sqrt{1+(\frac{du}{dx}(x))^2}$$
$$l(u) = \int_{0}^{1} \sqrt{1+(\frac{du}{dx}(x))^2} dx$$

l(u) is the length of the u(x). 
I want to minimize l(u) subject to $u(0)=a$ and $u(1)=b$.
u minimizing I(u) is 
$$u(x) = (b-a)x+a$$

This u is line from (0,a) to (1,b).
Because l(u) is the length of the u(x), We found out that u minimizing l(u) is line.

Please look [5] to calculate of variational method.

Implementation
I implement visualization of variational method to check difference of optimize curve and other curve. 
Let $u_A$ is 
$$u_A = (b-a)x+a + A sin(8t)$$
$A sin(8t)$ increase the distance from $u$. $A \in [0,0.5]$.

If $A=0$, u is optimization curve. 

I publish code at github.



Visualization
The up image is $u_A(x)$. The under image is $l(u_A)$. 
We found out that the closer line $u_A(x)$ is, the smaller $l(u_A)$.







Reference
[1]http://www2.kaiyodai.ac.jp/~takenawa/optimization/resume10-4.pdf
[2]http://hooktail.sub.jp/mathInPhys/brachisto/
[3]http://eman-physics.net/math/differential21.html
[4]http://bicycle1885.hatenablog.com/entry/2014/02/14/023734
[5]http://www2.kaiyodai.ac.jp/~yoshi-s/Lectures/Optimization/2013/lecture_6.pdf
[6]http://www.qi.mp.es.osaka-u.ac.jp/personal/imoto/index-j/jugyou/Kaiseki170427.pdf

コメント

このブログの人気の投稿

ヘッセ行列

Introduction English ver 今日は、ヘッセ行列を用いたテイラー展開について書こうと思います。 これは最適化を勉強するにあたって、とても大事になってくるので自分でまとめて残しておくことにしました。とくに、機械学習では最適化を必ず行うため、このブログのタイトルにもマッチした内容だと思います。 . 概要 ヘッセ行列の定義 ベクトルを用いたテイラー展開 関数の最適性 ヘッセ行列の定義 仮定 f は次のような条件を満たす関数です。. f はn次元ベクトルから実数値を出力します。 このベクトルは次のように表せます。 \[x = [x_1,x_2,,,,x_n]\] \(\forall x_i , i \in {1,2,,,n}\), f は二回偏微分可能です。 定義 ヘッセ行列は \(\frac{\partial^2}{\partial x_i \partial x_j}を (i,j)要素に持ちます。\) よってヘッセ行列は次のように表せます。 \[ H(f) = \left( \begin{array}{cccc} \frac{\partial^ 2}{\partial x_1^2} & \frac{\partial^2 f}{\partial x_1 \partial x_2} & &\ldots \frac{\partial^2 f}{\partial x_1 \partial x_n} \\ \frac{\partial^ 2 f}{\partial x_1 \partial x_2} & \frac{\partial^ 2 f}{\partial x_2^ 2} & \ldots & \frac{\partial^2 f}{\partial x_2 \partial x_n} \\ \vdots & \vdots & \ddots & \vdots \\ \frac{\partial^ 2 f}{\partial x_n \partial x_2} & \frac{\partial^ 2 f}{\partial x_n \partial x_2} & \ldo...

Plane in two dimention

Introduction 日本語 ver Today, I prove this theorem. Plane in two dimention is expressed following. \[\{x|<x,v> = 0\}\] however, v is orthogonal vector for plane and not zero vector. Proof \[\forall k \in \{x|<x,v> = 0\},\] k is fulfill this form. \[<k,v> = 0\] Now, because k and v in two dimentinal space, each vector express following. \[k = (k_1,k_2)\] \[v = (v_1,v_2)\] Thus, \(<k,v>=k_1v_1 + k_2v_2=0\) Change this equation. \[k_2 = -\frac{v_1}{v_2} k_1\] This equation is plane that slope is \(-\frac{v_1}{v_2}\). Q.E.D

Discrete Fourier transform

Introduction 日本語 ver I will write about Discrete Fourier transform. Discrete Fourier transform is Abbreviated DFT. I am making pdf about Audio Signal Processing. I publish pdf at  github . However, I write tex in Japanese. I take a lecture about the signal processing. There is lecture at  thie page . I update this pdf.