萬象在說話︰思其思考的人!

《LOST 對話錄》

人的存在久遠矣,就像物種的存在一樣,哪有什麼同不同、做不做的事呢?如果存在有道理,那它若不普遍似乎比較神奇的吧!

 誰說人們超越了芝諾,人們果真聽明白了他的話嗎??有窮與無窮並不是人給的條件,而只是認知之不足的啊。就像諸神的時代已經遠離,人們怎麼還不知道如何過日子哩!!

我親愛的普羅米修斯火種是不夠用的,哪怕你認為把光明帶給世界仍舊徒然??因為人類根本無法承受那光亮照明的呢!!

䁗奧思,你為什麼這麼說呢?你明知道這火種既不屬於你也不屬於你的孿生兄弟奧德。它從無物反思自身存有迸發出的大霹靂之火而來 。只要還有時間,自然存在機會阿!當虛空歸寂反噬萬有之時,你曾經歷千百萬次,終究無法回想起是吧!!…

 

如果我們為著數學簡單、因果易解就流連於線性系統的話︰

何謂『線性系統』? 假使從『系統論』的觀點來看,一個物理系統 S,如果它的『輸入輸出』或者講『刺激響應』滿足

設使 I_m(\cdots, t) \Rightarrow_{S} O_m(\cdots, t)I_n(\cdots, t) \Rightarrow_{S} O_n(\cdots, t)

那麼\alpha \cdot I_m(\cdots, t) + \beta \cdot I_n(\cdots, t)  \Rightarrow_{S}  \alpha  \cdot O_m(\cdots, t) +  \beta \cdot O_n(\cdots, t)

也就是說一個線線系統︰無因就無果、小因得小果,大因得大果,眾因所得果為各因之果之總計。

如果一個線性系統還滿足

\left[I_m(\cdots, t) \Rightarrow_{S} O_m(\cdots, t)\right]  \Rightarrow_{S} \left[I_m(\cdots, t + \tau) \Rightarrow_{S} O_m(\cdots, t + \tau)\right]

,這個系統稱作『線性非時變系統』。系統中的『因果關係』是『恆常的』不隨著時間變化,因此『遲延之因』生『遲延之果』 。線性非時變 LTI Linear time-invariant theory 系統論之基本結論是

任何 LTI 系統都可以完全祇用一個單一方程式來表示,稱之為系統的『衝激響應』。系統的輸出可以簡單表示為輸入信號與系統的『衝激響應』的『卷積』Convolution 。

─── 摘自《【Sonic π】聲波之傳播原理︰原理篇《四中》

 

難道不會把常態當成異類,失之於誤讀錯置的嗎︰

非線性系統

物理科學中,如果描述某個系統的方程式其輸入(自變數)與輸出(應變數)不成正比,則稱為非線性系統。由於自然界中大部分的系統本質上都是非線性的,因此許多工程師物理學家數學家和其他科學家對於非線性問題的研究都極感興趣。非線性系統和線性系統最大的差別在於,非線性系統可能會導致混沌、不可預測,或是不直觀的結果。

一般來說,非線性系統的行為在數學上是用一組非線性聯立方程式來描述的。非線性方程式裡含有由未知數構成的非一次多項式;換句話說,一個非線性方程式並不能寫成其未知數的線性組合。而非線性微分方程式,則是指方程式裡含有未知函數及其導函數的乘冪不等於一的項。在判定一個方程式是線性或非線性時,只需考慮未知數(或未知函數)的部分,不需要檢查方程式中是否有已知的非線性項。例如在微分方程式中,若所有的未知函數、未知導函數皆為一次,即使出現由某個已知變數所構成的非線性函數,我們仍稱它是一個線性微分方程式。

由於非線性方程式非常難解,因此我們常常需要以線性方程式來近似一個非線性系統(線性近似)。這種近似對某範圍內的輸入值(自變數)是很準確的,但線性近似之後反而會無法解釋許多有趣的現象,例如孤波混沌[1]奇點。這些奇特的現象,也常常讓非線性系統的行為看起來違反直覺、不可預測,或甚至混沌。雖然「混沌的行為」和「隨機的行為」感覺很相似,但兩者絕對不能混為一談;也就是說,一個混沌系統的行為絕對不是隨機的。

舉例來說,許多天氣系統就是混沌的,微小的擾動即可導致整個系統產生各種不同的複雜結果。就目前的科技而言,這種天氣的非線性特性即成了長期天氣預報的絆腳石。

某些書的作者以非線性科學來代指非線性系統的研究,但也有人不以為然:

「在科學領域裡使用『非線性科學』這個詞,就如同把動物學裡大部分的研究對象稱作『非大象動物』一樣可笑。」

 

現今工具齊全

scipy.integrate.odeint

scipy.integrate.odeint(func, y0, t, args=(), Dfun=None, col_deriv=0, full_output=0, ml=None, mu=None, rtol=None, atol=None, tcrit=None, h0=0.0, hmax=0.0, hmin=0.0, ixpr=0, mxstep=0, mxhnil=0, mxordn=12, mxords=5, printmessg=0)
Integrate a system of ordinary differential equations.

Solve a system of ordinary differential equations using lsoda from the FORTRAN library odepack.

Solves the initial value problem for stiff or non-stiff systems of first order ode-s:

dy/dt = func(y, t0, ...)

where y can be a vector.Note: The first two arguments of func(y, t0, ...) are in the opposite order of the arguments in the system definition function used by the scipy.integrate.ode class.

Parameters:

func : callable(y, t0, …)

Computes the derivative of y at t0.

y0 : array

Initial condition on y (can be a vector).

t : array

A sequence of time points for which to solve for y. The initial value point should be the first element of this sequence.

args : tuple, optional

Extra arguments to pass to function.

Dfun : callable(y, t0, …)

Gradient (Jacobian) of func.

col_deriv : bool, optional

True if Dfun defines derivatives down columns (faster), otherwise Dfun should define derivatives across rows.

full_output : bool, optional

True if to return a dictionary of optional outputs as the second output

printmessg : bool, optional

Whether to print the convergence message

Returns:

y : array, shape (len(t), len(y0))

Array containing the value of y for each desired time in t, with the initial value y0 in the first row.

infodict : dict, only returned if full_output == True

Dictionary containing additional output information

key meaning
‘hu’ vector of step sizes successfully used for each time step.
‘tcur’ vector with the value of t reached for each time step. (will always be at least as large as the input times).
‘tolsf’ vector of tolerance scale factors, greater than 1.0, computed when a request for too much accuracy was detected.
‘tsw’ value of t at the time of the last method switch (given for each time step)
‘nst’ cumulative number of time steps
‘nfe’ cumulative number of function evaluations for each time step
‘nje’ cumulative number of jacobian evaluations for each time step
‘nqu’ a vector of method orders for each successful step.
‘imxer’ index of the component of largest magnitude in the weighted local error vector (e / ewt) on an error return, -1 otherwise.
‘lenrw’ the length of the double work array required.
‘leniw’ the length of integer work array required.
‘mused’ a vector of method indicators for each successful time step: 1: adams (nonstiff), 2: bdf (stiff)
Other Parameters:
 

ml, mu : int, optional

If either of these are not None or non-negative, then the Jacobian is assumed to be banded. These give the number of lower and upper non-zero diagonals in this banded matrix. For the banded case, Dfun should return a matrix whose rows contain the non-zero bands (starting with the lowest diagonal). Thus, the return matrix jac from Dfun should have shape (ml + mu + 1, len(y0)) when ml >=0 or mu >=0. The data in jac must be stored such that jac[i - j + mu, j] holds the derivative of the i`th equation with respect to the `j`th state variable. If `col_deriv is True, the transpose of this jac must be returned.

rtol, atol : float, optional

The input parameters rtol and atol determine the error control performed by the solver. The solver will control the vector, e, of estimated local errors in y, according to an inequality of the form max-norm of (e / ewt) <= 1, where ewt is a vector of positive error weights computed as ewt = rtol * abs(y) + atol. rtol and atol can be either vectors the same length as y or scalars. Defaults to 1.49012e-8.

tcrit : ndarray, optional

Vector of critical points (e.g. singularities) where integration care should be taken.

h0 : float, (0: solver-determined), optional

The step size to be attempted on the first step.

hmax : float, (0: solver-determined), optional

The maximum absolute step size allowed.

hmin : float, (0: solver-determined), optional

The minimum absolute step size allowed.

ixpr : bool, optional

Whether to generate extra printing at method switches.

mxstep : int, (0: solver-determined), optional

Maximum number of (internally defined) steps allowed for each integration point in t.

mxhnil : int, (0: solver-determined), optional

Maximum number of messages printed.

mxordn : int, (0: solver-determined), optional

Maximum order to be allowed for the non-stiff (Adams) method.

mxords : int, (0: solver-determined), optional

Maximum order to be allowed for the stiff (BDF) method.

See also

ode
a more object-oriented integrator based on VODE.
quad
for finding the area under a curve.

 

範例清楚
SciPyDemo/oscillators.py

 

何不親嚐杜芬振子乎?

杜芬振子 Duffing oscillator是一個描寫受驅振動的振動子,由非線性微分方程表示[1]

杜芬方程列式如下:

{\displaystyle {\frac {d^{2}x(t)}{dt^{2}}}+2\gamma {\frac {dx(t)}{dt}}+\alpha *x(t)+\beta *x(t)^{3}=\delta *cos(\omega *t)}

其中

  • γ控制阻尼度
  • α控制韌度
  • β控制動力的非線性度
  • δ驅動力的振幅
  • ω驅動力的圓頻率

受驅的杜芬方程的龐加萊截面表明混沌行為。

 

進而了解它的行為耶!

Duffing oscillator

Takashi Kanamaru, Kogakuin University, Japan

Duffing oscillator is an example of a periodically forced oscillator with a nonlinear elasticity, written as

\ddot x + \delta \dot x + \beta x + \alpha x^3 = \gamma \cos \omega t , \ \ \ \ \ (1)

Figure 1: Periodic change of the chaotic attractor of the Duffing oscillator for α=1 , β=1 , δ=0.2 , γ=0.3 , and ω=1 . By assembling the Poincaré sections of a trajectory for different phase ψωt mod 2π , the attractor of Duffing oscillator changes periodically (see also Figure 1).