STEM 隨筆︰鬼月談化學︰☷ 《生化》順

派生碼訊

辰 龍

胡兒騎馬走長安,
開闢中原海境寬;
洪水乍平洪水起,

清光宜向漢中看。

辰龍︰《 文 》文說︰辰,震也。三月,陽气動,靁電振,民農時也。物皆生,从乙、匕,象芒達;厂,聲也。辰,房星,天時也 。从二,二,古文 上 上字。凡辰之屬皆从辰。或言 辰 辰之古意為手持石锄,日出而作。 龍 龍,鱗蟲之長。能幽,能明,能細,能巨,能短,能長;春分而登天,秋分而潛淵。从肉,飛之形,童省聲。凡龍之屬皆从龍。

派說到此龍的來歷,

200px-28_xiu.svg 二十八宿裡有,

,實是『青龍』之星象也。《 易 》易《乾》䷀ 卦講︰

乾:元,亨,利,貞。

初九:潛龍,勿用。
九二:見龍再田,利見大人。
九三:君子終日乾乾,夕惕若,厲無咎。
九四:或躍在淵,無咎。
九五:飛龍在天,利見大人。
上九:亢龍有悔。
用九:見群龍無首,吉。

彖曰:大哉乾元,萬物資始,乃統天。云行雨施,品物流形。大明始終,六位時成,時乘六龍以御天。乾道變化,各正性命,保合大和,乃利貞。首出庶物,萬國咸寧。

象曰:天行健,君子以自強不息。潛龍勿用,陽在下也。 見龍再田 ,德施普也。 終日乾乾,反復道也。 或躍在淵,進無咎也。飛龍在天,大人造也。 亢龍有悔,盈不可久也。 用九,天德不可為首也。

文言曰:「元者,善之長也,亨者,嘉之會也,利者,義之和也,貞者,事之干也。 君子體仁,足以長人﹔嘉會,足以合禮﹔利物,足以和義﹔貞固,足以干事。 君子行此四者,故曰:乾:元亨利貞。」

自『雷龍』啟春,震動四時,大地萬象更新,皆此一龍所始也。故而《 易 》易《坤》䷁ 卦又講︰

坤:元,亨,利牝馬之貞。 君子有攸往,先迷后得主,利西南得朋 ,東北喪朋。 安貞,吉。

彖曰:至哉坤元,萬物資生,乃順承天。 坤厚載物,德合無疆。 含弘光大,品物咸亨。 牝馬地類,行地無疆,柔順利貞。 君子攸行,先迷失道,后順得常。 西南得朋,乃與類行﹔東北喪朋,乃終有慶 。安貞之吉,應地無疆。

象曰:地勢坤,君子以厚德載物。

初六:履霜,堅冰至。
象曰:履霜堅冰,陰始凝也。 馴致其道,至堅冰也。

六二:直,方,大,不習無不利。
象曰:六二之動,直以方也。 不習無不利,地道光也。

六三:含章可貞。 或從王事,無成有終。
象曰:含章可貞﹔以時發也。 或從王事,知光大也。

六四:括囊﹔無咎,無譽。
象曰:括囊無咎,慎不害也。

六五:黃裳,元吉。
象曰:黃裳元吉,文在中也。

上六:戰龍於野,其血玄黃。
象曰:戰龍於野,其道窮也。

用六:利永貞。
象曰:用六永貞,以大終也。

文言曰:坤至柔,而動也剛,至靜而德方,后得主而有常,含萬物而化光。坤其道順乎? 承天而時行。積善之家,必有餘慶﹔積不善之家,必有餘殃。 臣弒其君,子弒其父,非一朝一夕之故,其所由來者漸矣,由辯之不早辯也。 易曰:「履霜堅冰至。」 蓋言順也。直其正也,方其義也。 君子敬以直內,義以方外,敬義立,而德不孤。 「直,方,大,不習無不利」﹔則不疑其所行也。陰雖有美,含之﹔以從王事,弗敢成也。 地道也,妻道也,臣道也。 地道無成 ,而代有終也。天地變化,草木蕃﹔ 天地閉,賢人隱。 易曰:「括囊﹔無咎,無譽。」 蓋言謹也。君子黃中通理,正位居體,美在其中,而暢於四支,發於事業,美之至也。陰疑於陽,必戰。為其嫌於無陽也,故稱龍焉。猶未離其類也,故稱血焉。 夫玄黃者,天地之雜也,天玄而地黃。

后土乘『牝馬』順天載物,行地無疆,終至品物咸亨。所謂『龍馬精神 』蓋此之謂耶!!

乾坤萬象自有它之內蘊機理,好似程序能將系統的輸入轉成輸出,或許這正是科學所追求之『萬物理論』的吧??

生 西方英國有學者,名作『史蒂芬‧沃爾夫勒姆』 Stephen Wolfram 創造『 Mathematica 』,曾寫

一種新科學》 A New Kind of Science

,分類『細胞自動機』, 欲究事物之本原。

Cellular automaton

Gospers_glider_gun

Oscillator

A cellular automaton (pl. cellular automata, abbrev. CA) is a discrete model studied in computability theory, mathematics, physics, complexity science, theoretical biology and microstructure modeling. Cellular automata are also called cellular spaces, tessellation automata, homogeneous structures, cellular structures, tessellation structures, and iterative arrays.[2]

─── 《M♪O 之學習筆記本《辰》組元︰【䷀】萬象一原

 

亢龍有悔。故九二雖見龍在田,還得終日乾乾乎?

戰龍於野。原初六履霜堅冰至,直方大不習無不利耶?!

總須面對乾坤萬象,為何品物咸亨的呢!

或宜黃裳元吉、飛龍在天也!?

不過是順時依序

【一】

The Belousov-Zhabotinsky (BZ) reaction is a classical example of a non-equibrium chemical oscillator in which the components exhibit periodic changes in concentration.

The model

The BZ reaction mechanism is complex and still not fully understood, but its essential features can be captured in a simple reaction model involving three chemical substrates[1, 2]:

\mathrm{A} + \mathrm{B}  \rightarrow 2A \ \alpha
\mathrm{B} + \mathrm{C}  \rightarrow 2B \ \beta
\mathrm{C} + \mathrm{A}  \rightarrow 2C \ \gamma

where \alpha, \beta and \gamma are rate constants. The concentrations of A, B and C may be followed on a grid of discrete time points through the equations

[\mathrm{A}]_{t+1} = [\mathrm{A}]_t + [\mathrm{A}]_t(\alpha[\mathrm{B}]_t - \gamma[\mathrm{C}]_t)
[\mathrm{B}]_{t+1} = [\mathrm{B}]_t + [\mathrm{B}]_t(\beta[\mathrm{C}]_t - \alpha[\mathrm{A}]_t)
[\mathrm{A}]_{t+1} = [\mathrm{C}]_t + [\mathrm{C}]_t(\gamma[\mathrm{A}]_t - \beta[\mathrm{B}]_t)

In order to account for the spatial variation in concentration the reaction is assumed to take place on a discrete two-dimensional grid of cells. At every time step the concentration of each component at a cell is set to its average across that cell and its eight neighbours (the Moore neighbourhood). The grid is wrapped top-to-bottom and left-to-right and, for simplicity, the concentrations are constrained to lie between 0 and 1. The initial concentrations are set to random values in this range.

Example outputs

Spirals and waves appear spontaneously and unpredictably in the concentration profiles of the reaction components on a scale dictated by the values of αα, ββ and γγ.

For \alpha=\beta=\gamma=1:

BZ reaction for alpha=beta=gamma=1

For \alpha=1.2, \beta=\gamma=1:

BZ reaction for alpha=1.2, beta=gamma=1

The code

The Python code below creates an animation of the BZ reaction using NumPy and Matplotlib. Significant speed improvements over Python looping are achieved by averaging the neighbour concentrations by convolution with a 3 \times 3 array of values \frac{1}{9} (see scipy.signal.convolve2d).

To create the animation movie, ffmpeg or some other encoder should be installed.

import numpy as np
from scipy.signal import convolve2d
import matplotlib.pyplot as plt
from matplotlib import animation

# Width, height of the image.
nx, ny = 600, 450
# Reaction parameters.
alpha, beta, gamma = 1, 1, 1

def update(p,arr):
    """Update arr[p] to arr[q] by evolving in time."""

    # Count the average amount of each species in the 9 cells around each cell
    # by convolution with the 3x3 array m.
    q = (p+1) % 2
    s = np.zeros((3, ny,nx))
    m = np.ones((3,3)) / 9
    for k in range(3):
        s[k] = convolve2d(arr[p,k], m, mode='same', boundary='wrap')
    # Apply the reaction equations
    arr[q,0] = s[0] + s[0]*(alpha*s[1] - gamma*s[2])
    arr[q,1] = s[1] + s[1]*(beta*s[2] - alpha*s[0])
    arr[q,2] = s[2] + s[2]*(gamma*s[0] - beta*s[1])
    # Ensure the species concentrations are kept within [0,1].
    np.clip(arr[q], 0, 1, arr[q])
    return arr

# Initialize the array with random amounts of A, B and C.
arr = np.random.random(size=(2, 3, ny, nx))

# Set up the image
fig, ax = plt.subplots()
im = ax.imshow(arr[0,0], cmap=plt.cm.winter)
ax.axis('off')

def animate(i, arr):
    """Update the image for iteration i of the Matplotlib animation."""

    arr = update(i % 2, arr)
    im.set_array(arr[i % 2, 0])
    return [im]

anim = animation.FuncAnimation(fig, animate, frames=200, interval=5,
                               blit=False, fargs=(arr,))

# To view the animation, uncomment this line
plt.show()

# To save the animation as an MP4 movie, uncomment this line
#anim.save(filename='bz.mp4', fps=30)

 

【二】

The Belousov-Zhabotinsky Reaction in a CSTR Using Python

 

『三』

 

而已矣!!??