STEM 隨筆︰鬼月談化學︰☶ 止 《反應》

所以能明白 Michael Nielsen 先生為何會突起『費米』之『大象說』的了︰

Overfitting and regularization

The Nobel prizewinning physicist Enrico Fermi was once asked his opinion of a mathematical model some colleagues had proposed as the solution to an important unsolved physics problem. The model gave excellent agreement with experiment, but Fermi was skeptical. He asked how many free parameters could be set in the model. “Four” was the answer. Fermi replied*

*The quote comes from a charming article by Freeman Dyson, who is one of the people who proposed the flawed model. A four-parameter elephant may be found here.

: “I remember my friend Johnny von Neumann used to say, with four parameters I can fit an elephant, and with five I can make him wiggle his trunk.”.

The point, of course, is that models with a large number of free parameters can describe an amazingly wide range of phenomena. Even if such a model agrees well with the available data, that doesn’t make it a good model. It may just mean there’s enough freedom in the model that it can describe almost any data set of the given size, without capturing any genuine insights into the underlying phenomenon. When that happens the model will work well for the existing data, but will fail to generalize to new situations. The true test of a model is its ability to make predictions in situations it hasn’t been exposed to before.

Fermi and von Neumann were suspicious of models with four parameters. Our 30 hidden neuron network for classifying MNIST digits has nearly 24,000 parameters! That’s a lot of parameters. Our 100 hidden neuron network has nearly 80,000 parameters, and state-of-the-art deep neural nets sometimes contain millions or even billions of parameters. Should we trust the results?

───

還特意給了個鍊結

How to fit an elephant

John von Neumann famously said

With four parameters I can fit an elephant, and with five I can make him wiggle his trunk.

By this he meant that one should not be impressed when a complex model fits a data set well. With enough parameters, you can fit any data set.

It turns out you can literally fit an elephant with four parameters if you allow the parameters to be complex numbers.

I mentioned von Neumann’s quote on StatFact last week and Piotr Zolnierczuk replied with reference to a paper explaining how to fit an elephant:

“Drawing an elephant with four complex parameters” by Jurgen Mayer, Khaled Khairy, and Jonathon Howard,  Am. J. Phys. 78, 648 (2010), DOI:10.1119/1.3254017.

Piotr also sent me the following Python code he’d written to implement the method in the paper. This code produced the image above.

───

大概不會是潛意識裡希望『拯救大象』的吧??又怎知卻挑起人對『大象林旺』之幽思呢!!

─── 《W!O+ 的《小伶鼬工坊演義》︰神經網絡【轉折點】一

 

『物質』若是不『穩定』,這個世界將成何面貌?

『物質』若是不『變化』,宇宙哪裡會有生命耶??

『造物』自然也『定理』,玄機一時難釐清!

Chemical bond

A chemical bond is a lasting attraction between atoms, ions or molecules that enables the formation of chemical compounds. The bond may result from the electrostatic force of attraction between oppositely charged ions as in ionic bonds or through the sharing of electrons as in covalent bonds. The strength of chemical bonds varies considerably; there are “strong bonds” or “primary bonds” such as covalent, ionic and metallic bonds, and “weak bonds” or “secondary bonds” such as dipole–dipole interactions, the London dispersion force and hydrogen bonding.

Since opposite charges attract via a simple electromagnetic force, the negatively charged electrons that are orbiting the nucleus and the positively charged protons in the nucleus attract each other. An electron positioned between two nuclei will be attracted to both of them, and the nuclei will be attracted toward electrons in this position. This attraction constitutes the chemical bond. Due to the matter wave nature of electrons and their smaller mass, they must occupy a much larger amount of volume compared with the nuclei, and this volume occupied by the electrons keeps the atomic nuclei in a bond relatively far apart, as compared with the size of the nuclei themselves.

In general, strong chemical bonding is associated with the sharing or transfer of electrons between the participating atoms. The atoms in molecules, crystals, metals and diatomic gases—indeed most of the physical environment around us—are held together by chemical bonds, which dictate the structure and the bulk properties of matter.

Examples of Lewis dot-style representations of chemical bonds between carbon (C), hydrogen (H), and oxygen (O). Lewis dot diagrams were an early attempt to describe chemical bonding and are still widely used today.

All bonds can be explained by quantum theory, but, in practice, simplification rules allow chemists to predict the strength, directionality, and polarity of bonds. The octet rule and VSEPR theory are two examples. More sophisticated theories are valence bond theory which includes orbital hybridization and resonance, and molecular orbital theory which includes linear combination of atomic orbitals and ligand field theory.Electrostatics are used to describe bond polarities and the effects they have on chemical substances.

 

『大象』四輔可定形,十三『參數』恐太多!!

History

Early speculations about the nature of the chemical bond, from as early as the 12th century, supposed that certain types of chemical species were joined by a type of chemical affinity. In 1704, Sir Isaac Newton famously outlined his atomic bonding theory, in “Query 31” of his Opticks, whereby atoms attach to each other by some “force“. Specifically, after acknowledging the various popular theories in vogue at the time, of how atoms were reasoned to attach to each other, i.e. “hooked atoms”, “glued together by rest”, or “stuck together by conspiring motions”, Newton states that he would rather infer from their cohesion, that “particles attract one another by some force, which in immediate contact is exceedingly strong, at small distances performs the chemical operations, and reaches not far from the particles with any sensible effect.”

In 1819, on the heels of the invention of the voltaic pile, Jöns Jakob Berzelius developed a theory of chemical combination stressing the electronegative and electropositive characters of the combining atoms. By the mid 19th century, Edward Frankland, F.A. Kekulé, A.S. Couper, Alexander Butlerov, and Hermann Kolbe, building on the theory of radicals, developed the theory of valency, originally called “combining power”, in which compounds were joined owing to an attraction of positive and negative poles. In 1916, chemistGilbert N. Lewis developed the concept of the electron-pair bond, in which two atoms may share one to six electrons, thus forming the single electron bond, a single bond, a double bond, or a triple bond; in Lewis’s own words, “An electron may form a part of the shell of two different atoms and cannot be said to belong to either one exclusively.”[2]

That same year, Walther Kossel put forward a theory similar to Lewis’ only his model assumed complete transfers of electrons between atoms, and was thus a model of ionic bonding. Both Lewis and Kossel structured their bonding models on that of Abegg’s rule(1904).

Niels Bohr proposed a model of the atom and a model of the chemical bond. According to his model for a diatomic molecule, the electrons of the atoms of the molecule form a rotating ring whose plane is perpendicular to the axis of the molecule and equidistant from the atomic nuclei. The dynamic equilibrium of the molecular system is achieved through the balance of forces between the forces of attraction of nuclei to the plane of the ring of electrons and the forces of mutual repulsion of the nuclei. The Bohr model of the chemical bond took into account the Coulomb repulsion – the electrons in the ring are at the maximum distance from each other.[3][4]

In 1927, the first mathematically complete quantum description of a simple chemical bond, i.e. that produced by one electron in the hydrogen molecular ion, H2+, was derived by the Danish physicist Oyvind Burrau.[5] This work showed that the quantum approach to chemical bonds could be fundamentally and quantitatively correct, but the mathematical methods used could not be extended to molecules containing more than one electron. A more practical, albeit less quantitative, approach was put forward in the same year byWalter Heitler and Fritz London. The Heitler–London method forms the basis of what is now called valence bond theory. In 1929, the linear combination of atomic orbitals molecular orbital method (LCAO) approximation was introduced by Sir John Lennard-Jones, who also suggested methods to derive electronic structures of molecules of F2 (fluorine) and O2 (oxygen) molecules, from basic quantum principles. This molecular orbital theory represented a covalent bond as an orbital formed by combining the quantum mechanicalSchrödinger atomic orbitals which had been hypothesized for electrons in single atoms. The equations for bonding electrons in multi-electron atoms could not be solved to mathematical perfection (i.e., analytically), but approximations for them still gave many good qualitative predictions and results. Most quantitative calculations in modern quantum chemistry use either valence bond or molecular orbital theory as a starting point, although a third approach, density functional theory, has become increasingly popular in recent years.

In 1933, H. H. James and A. S. Coolidge carried out a calculation on the dihydrogen molecule that, unlike all previous calculation which used functions only of the distance of the electron from the atomic nucleus, used functions which also explicitly added the distance between the two electrons.[6] With up to 13 adjustable parameters they obtained a result very close to the experimental result for the dissociation energy. Later extensions have used up to 54 parameters and gave excellent agreement with experiments. This calculation convinced the scientific community that quantum theory could give agreement with experiment. However this approach has none of the physical pictures of the valence bond and molecular orbital theories and is difficult to extend to larger molecules.

 

五四實繪不存疑??!!

Theories of chemical bonding

In the (unrealistic) limit of “pure” ionic bonding, electrons are perfectly localized on one of the two atoms in the bond. Such bonds can be understood by classical physics. The forces between the atoms are characterized by isotropic continuum electrostatic potentials. Their magnitude is in simple proportion to the charge difference.

Covalent bonds are better understood by valence bond theory or molecular orbital theory. The properties of the atoms involved can be understood using concepts such as oxidation number. The electron density within a bond is not assigned to individual atoms, but is instead delocalized between atoms. In valence bond theory, the two electrons on the two atoms are coupled together with the bond strength depending on the overlap between them. In molecular orbital theory, the linear combination of atomic orbitals (LCAO) helps describe the delocalized molecular orbital structures and energies based on the atomic orbitals of the atoms they came from. Unlike pure ionic bonds, covalent bonds may have directed anisotropic properties. These may have their own names, such as sigma bond and pi bond.

In the general case, atoms form bonds that are intermediate between ionic and covalent, depending on the relative electronegativity of the atoms involved. This type of bond is sometimes called polar covalent.

 

傳說

一個和尚提水喝;兩個和尚抬水喝;三個和尚沒水喝。

 

似乎『巨觀說法』早登台!!??

化學勢

熱力學中,某種物質的化學勢指的是,在化學反應或者相變中,此物質的粒子數發生改變時所吸收或放出的能量。在混合物中的某種物質的化學勢定義為此熱力學系統的吉布斯自由能對此物質粒子數的變化率,即偏導數(其他物質的粒子數及其他系統參數保持不變)。當溫度和壓力固定時,化學勢也被稱作偏莫耳吉布斯自由能 ,或者莫耳化學勢[1]。在化學平衡或相平衡狀態下,自由能處於極小值,各種物質的化學勢與化學計量係數乘積之加和為零[2][3][4]

半導體物理中,零溫電子系統的化學勢被稱為費米能[5]

概述

粒子總是趨向於從高化學勢流向低化學勢,因而,化學勢可視為物理中「位能」概念的推廣。當一個球從山上滾下,它從高重力勢(有更多的做功「趨勢」)跑到了低重力勢的區域。同樣,分子在運動、發生化學反應、溶解、融化等過程中,它們總是趨向於自發的從高化學勢的狀態變到低化學勢的狀態,相應的,此分子的的粒子數會發生變化,而粒子數是化學勢的共軛變量。

一個簡單的例子是,一個稀疏氣體分子體系在一個均勻環境中的擴散過程。在這個過程中,分子會自發的從高密度分布區域擴散到低密度分布的區域,直到此分子在各處的分布密度都相等。

我們可以用機械運動的理論對分子的隨機運動做微觀解釋,但是,如果用化學勢來理解這個過程則顯得更加簡單方便:在確定的溫度下,一個分子在高密度區域有更高的化學勢,而在低密度區域的化學勢則較低。當分子從高化學勢區域流到低化學勢區域時,就會釋放自由能,因此這是一個自發的過程。

另一個例子是相變過程。我們可以認為,在0°C以上時,水分子的液相(液態水)具有更低的化學勢,而固相(即冰)化學勢更高,冰化為水則是從高化學勢變為低化學勢,而在0°C以下時則正好相反。而正好處於0 °C的冰水混合物,固相和液相的化學勢則是正好相等的,系統處於平衡。

另外再比如水溶液中弱酸解離過程,比如乙酸,HA(A=CH3COO):

HA ⇌ H+ + A

醋中就包含乙酸。當乙酸分子解離時,未解離的乙酸分子數量減少 ,而產物離子(H+和A)數量增加。在此過程中,乙酸分子的化學勢變小,而H+和A離子的化學勢升高,當反應物與產物的化學勢相等時,系統達到平衡。

化學勢的概念被運用於很多關於化學平衡的方面,比如熔化沸騰蒸發溶解滲透分配係數液體萃取層析分離,這些情況下通常都會有一個表徵各分量物質化學勢的函數。

電化學中,離子不一定總是從高化學勢流向低化學勢,但是它們會從高的「電化學勢」流向低的「電化學勢」,與化學勢不同的是 ,電化學勢還計入了靜電力的作用,因而可以完全的描述離子的運動。

熱力學的定義

某種粒子-i(原子、分子或原子核)的化學勢 \displaystyle \mu _{i} 是一個強度量,其定義來自於唯象引入的的熱力學基本關係[6]

\displaystyle dU=TdS-PdV+\sum _{i=1}^{n}\mu _{i}dN_{i}

這裡 \displaystyle dU 是系統內能 U 的變化微元, \displaystyle dS 是系統 S 的變化, \displaystyle dV 是體積的變化,而 \displaystyle dN_{i} 是第i種粒子的粒子數 \displaystyle N_{i} 的變化, 絕對溫度P是壓力。當存在電磁場時,此式中還要計入相應的電磁做功的項。
由上述熱力學基本關係,我們得到化學勢的定義為:

\displaystyle \mu _{i}=\left({\frac {\partial U}{\partial N_{i}}}\right)_{S,V,N_{j\neq i}}

然而此定義對於實際系統有一些不方便,比如說對於化學溶液,當加入粒子時,又要想保持體積和熵等變量不變,這幾乎是不可能的。為此,我們通過Legendre變換來引入另一個熱力勢:吉布斯自由能\displaystyle G=U+PV-TS ,將此形式微分得到: \displaystyle dG=dU+PdV+VdP-TdS-SdT ,將這裡的dU用上面的熱力學基本關係替換,我們就可以得到:

\displaystyle dG=-SdT+VdP+\sum _{i=1}^{n}\mu _{i}dN_{i}

於是,我們就得到化學勢 \displaystyle \mu _{i} 的另一個表達式:

\displaystyle \mu _{i}=\left({\frac {\partial G}{\partial N_{i}}}\right)_{T,P,N_{j\neq i}}

在改變吉布斯自由能時同時又固定溫度和壓力不變則是在通常情況下可以做到的,於是,這種情況下我們可以得到

\displaystyle dG=\sum _{i=1}^{n}\mu _{i}dN_{i}

若一個系統的溫度和壓力固定不變,而又可以與外界環境有粒子交換,熱力學平衡狀態就意味著系統的吉布斯自由能應當處於極小值,即:

\displaystyle dG=\mu _{1}dN_{1}+\mu _{2}dN_{2}+...=0

這一等式關係可以用於建立化學反應的平衡常數。

類似的,我們還可以對 \displaystyle dU 做其它形式的 Legendre變換,從而得到其它的熱力學勢函數,如 \displaystyle H=U+PV , Helmholtz自由能 \displaystyle F=U-TS ,於是相應的化學勢為:

\displaystyle \mu _{i}=\left({\frac {\partial H}{\partial N_{i}}}\right)_{S,P,N_{j\neq i}}\qquad \mu _{i}=\left({\frac {\partial F}{\partial N_{i}}}\right)_{T,V,N_{j\neq i}}

這些不同的形式都是化學勢,只是運用於不同的物理條件下。

應用

Gibbs–Duhem方程式描述了一個熱力學系統中的組分的化學勢變化之間的關係。例如一種由兩種物質組成的混合物,在確定的溫度和壓力下,這兩種物質的化學勢滿足如下關係:

\displaystyle d\mu _{\mathrm {B} }=-{\frac {n_{\mathrm {A} }}{n_{\mathrm {B} }}}d\mu _{\mathrm {A} }

相變平衡或化學平衡往往都會有一個決定相變的常數。比如,冰融化的溫度(冰點),即為固相和液相平衡的溫度。化學勢可以用來解釋由Clapeyron方程式解出的相圖中的斜率[7],這些也可以由Gibbs–Duhem方程式給出,還可以解釋一些「依數性」(如溶劑蒸氣壓的降低導致溶液凝固點下降)[8],並可以很自然的導出拉午耳定律亨利定律[9]

歷史

化學勢首先由美國工程師、化學家、數學物理學家吉布斯(Josiah Willard Gibbs)提出:

向處於靜壓力狀態的某種均勻物質中加入無窮小量的任意添加物,而保持其仍然分布均勻且熵和體積都不變,則此時總能量變化量對於添加物粒子數的微商表徵了一種添加這種組分的位能。

“If to any homogeneous mass in a state of hydrostatic stress we suppose an infinitesimal quantity of any substance to be added, the mass remaining homogeneous and its entropy and volume remaining unchanged, the increase of the energy of the mass divided by the quantity of the substance added is the potential for that substance in the mass considered.”

吉布斯隨後意識到,由此定義出發,新加入體系的物質不一定需要是在原體系中已經存在的物質,而可以是任何化學成分,也可以是比例確定的混合成分,這種自由度可以使化學勢應用於熱力學和物理學中各種正經歷物質成分變化的系統。化學勢也被稱為偏莫耳吉布斯自由能(或偏莫耳性質),單位為能量/粒子數,或能量/莫耳 。

1873年,吉布斯在他的論文《物質熱力學性質的幾何面表示法》(A Method of Geometrical Representation of the Thermodynamic Properties of Substances by Means of Surfaces)中,提出了他的新方程式及其基本原理,用於討論當不同系統相互接觸時發生的自發過程。對於相互接觸的均勻物質(如固、液、氣組分),通過三維的體積-熵-內能圖,吉布斯定義了三種狀態:「必要穩定(necessarily stable)」,「中性(neutral)」,「不穩定(unstable)」,並借之理解某個變化過程能否自發進行。1876年,吉布斯在此理論基礎之上引入了化學勢的概念用於理解化學反應過程。他對此總結道:

考慮一種物質,處於具有確定壓力和溫度的某介質中,那麼此物質處於熱力學平衡的充要條件是:

\displaystyle \delta (\epsilon -T\eta +P\nu )=0

其中 \displaystyle \delta 表示由系統各組分狀態變化或比例變化造成的變分量。穩定平衡的條件是,上面括號中的表達式取極小值。

“If we wish to express in a single equation the necessary and sufficient condition of thermodynamic equilibrium for a substance when surrounded by a medium of constant pressure P and temperature T, this equation may be written:

\displaystyle \delta (\epsilon -T\eta +P\nu )=0

where δ refers to the variation produced by any variations in the state of the parts of the body, and (when different parts of the body are in different states) in the proportion in which the body is divided between the different states. The condition of stable equilibrium is that the value of the expression in the parenthesis shall be a minimum.”

注意這裡與現代常用的符號不同的是,吉布斯用 \displaystyle \epsilon 表示內能, \displaystyle \eta 表示熵, \displaystyle \nu 表示系統體積。

 

 

 

 

 

 

 

 

STEM 隨筆︰鬼月談化學︰☶ 止 《反應》‧前

博大精深總論前︰

Chemical reaction

A chemical reaction is a process that leads to the chemical transformation of one set of chemical substances to another.[1] Classically, chemical reactions encompass changes that only involve the positions of electrons in the forming and breaking of chemical bonds between atoms, with no change to the nuclei (no change to the elements present), and can often be described by a chemical equation. Nuclear chemistry is a sub-discipline of chemistry that involves the chemical reactions of unstable and radioactive elements where both electronic and nuclear changes can occur.

The substance (or substances) initially involved in a chemical reaction are called reactants or reagents. Chemical reactions are usually characterized by a chemical change, and they yield one or more products, which usually have properties different from the reactants. Reactions often consist of a sequence of individual sub-steps, the so-called elementary reactions, and the information on the precise course of action is part of the reaction mechanism. Chemical reactions are described with chemical equations, which symbolically present the starting materials, end products, and sometimes intermediate products and reaction conditions.

Chemical reactions happen at a characteristic reaction rate at a given temperature and chemical concentration. Typically, reaction rates increase with increasing temperature because there is more thermal energy available to reach the activation energy necessary for breaking bonds between atoms.

Reactions may proceed in the forward or reverse direction until they go to completion or reach equilibrium. Reactions that proceed in the forward direction to approach equilibrium are often described as spontaneous, requiring no input of free energy to go forward. Non-spontaneous reactions require input of free energy to go forward (examples include charging a battery by applying an external electrical power source, or photosynthesis driven by absorption of electromagnetic radiation in the form of sunlight).

Different chemical reactions are used in combinations during chemical synthesis in order to obtain a desired product. In biochemistry, a consecutive series of chemical reactions (where the product of one reaction is the reactant of the next reaction) form metabolic pathways. These reactions are often catalyzed by protein enzymes. Enzymes increase the rates of biochemical reactions, so that metabolic syntheses and decompositions impossible under ordinary conditions can occur at the temperatures and concentrations present within a cell.

The general concept of a chemical reaction has been extended to reactions between entities smaller than atoms, including nuclear reactions, radioactive decays, and reactions between elementary particles, as described by  quantum field theory.

A thermite reaction using iron(III) oxide. The sparks flying outwards are globules of molten iron trailing smoke in their wake.

 

佛歡喜日君自安。

古來丹道欲飛仙,《咸艾》《太戊》說巫咸

沖天火砲遊戲間,物理化學己當先?

History

Antoine Lavoisier developed the theory of combustion as a chemical reaction with oxygen.

Chemical reactions such as combustion in fire, fermentation and the reduction of ores to metals were known since antiquity. Initial theories of transformation of materials were developed by Greek philosophers, such as the Four-Element Theory of Empedocles stating that any substance is composed of the four basic elements – fire, water, air and earth. In the Middle Ages, chemical transformations were studied by Alchemists. They attempted, in particular, to convert lead into gold, for which purpose they used reactions of lead and lead-copper alloys with sulfur.[2]

The production of chemical substances that do not normally occur in nature has long been tried, such as the synthesis of sulfuric and nitric acids attributed to the controversial alchemist Jābir ibn Hayyān. The process involved heating of sulfate and nitrate minerals such as copper sulfate, alum and saltpeter. In the 17th century, Johann Rudolph Glauber produced hydrochloric acid and sodium sulfate by reacting sulfuric acid and sodium chloride. With the development of the lead chamber process in 1746 and the Leblanc process, allowing large-scale production of sulfuric acid and sodium carbonate, respectively, chemical reactions became implemented into the industry. Further optimization of sulfuric acid technology resulted in the contact process in the 1880s,[3] and the Haber process was developed in 1909–1910 for ammonia synthesis.[4]

From the 16th century, researchers including Jan Baptist van Helmont, Robert Boyle, and Isaac Newton tried to establish theories of the experimentally observed chemical transformations. The phlogiston theory was proposed in 1667 by Johann Joachim Becher. It postulated the existence of a fire-like element called “phlogiston”, which was contained within combustible bodies and released during combustion. This proved to be false in 1785 by Antoine Lavoisier who found the correct explanation of the combustion as reaction with oxygen from the air.[5]

Joseph Louis Gay-Lussac recognized in 1808 that gases always react in a certain relationship with each other. Based on this idea and the atomic theory of John Dalton, Joseph Proust had developed the law of definite proportions, which later resulted in the concepts of stoichiometry and chemical equations.[6]

Regarding the organic chemistry, it was long believed that compounds obtained from living organisms were too complex to be obtained synthetically. According to the concept of vitalism, organic matter was endowed with a “vital force” and distinguished from inorganic materials. This separation was ended however by the synthesis of urea from inorganic precursors by Friedrich Wöhler in 1828. Other chemists who brought major contributions to organic chemistry include Alexander William Williamson with his synthesis of ethers and Christopher Kelk Ingold, who, among many discoveries, established the mechanisms of substitution reactions.

 

倘使不知『後』與『前』?!如何平衡『變不變』!?

Equations

As seen from the equation CH4 + 2 O2CO2 + 2 H2O, a coefficient of 2 must be placed before the oxygen gas on the reactants side and before the water on the products side in order for, as per the law of conservation of mass, the quantity of each element does not change during the reaction

Chemical equations are used to graphically illustrate chemical reactions. They consist of chemical or structural formulas of the reactants on the left and those of the products on the right. They are separated by an arrow (→) which indicates the direction and type of the reaction; the arrow is read as the word “yields”.[7] The tip of the arrow points in the direction in which the reaction proceeds. A double arrow (⇌) pointing in opposite directions is used for equilibrium reactions. Equations should be balanced according to the stoichiometry, the number of atoms of each species should be the same on both sides of the equation. This is achieved by scaling the number of involved molecules (\displaystyle {\ce {A, B, C}} and \displaystyle {\ce {D}} in a schematic example below) by the appropriate integers a, b, c and d.[8]

\displaystyle {\ce {{\mathit {a}}A{}+{\mathit {b}}B->{\mathit {c}}C{}+{\mathit {d}}D}}

More elaborate reactions are represented by reaction schemes, which in addition to starting materials and products show important intermediates or transition states. Also, some relatively minor additions to the reaction can be indicated above the reaction arrow; examples of such additions are water, heat, illumination, a catalyst, etc. Similarly, some minor products can be placed below the arrow, often with a minus sign.

An example of organic reaction: oxidation of ketones to esters with a peroxycarboxylic acid

Retrosynthetic analysis can be applied to design a complex synthesis reaction. Here the analysis starts from the products, for example by splitting selected chemical bonds, to arrive at plausible initial reagents. A special arrow (⇒) is used in retro reactions.[9]

 

還請回歸大道原??!!

Elementary reactions

The elementary reaction is the smallest division into which a chemical reaction can be decomposed, it has no intermediate products.[10] Most experimentally observed reactions are built up from many elementary reactions that occur in parallel or sequentially. The actual sequence of the individual elementary reactions is known as reaction mechanism. An elementary reaction involves a few molecules, usually one or two, because of the low probability for several molecules to meet at a certain time.[11]

Isomerization of azobenzene, induced by light (hν) or heat (Δ)

The most important elementary reactions are unimolecular and bimolecular reactions. Only one molecule is involved in a unimolecular reaction; it is transformed by an isomerization or a dissociation into one or more other molecules. Such reactions require the addition of energy in the form of heat or light. A typical example of a unimolecular reaction is the cis–trans isomerization, in which the cis-form of a compound converts to the trans-form or vice versa.[12]

In a typical dissociation reaction, a bond in a molecule splits (ruptures) resulting in two molecular fragments. The splitting can be homolytic or heterolytic. In the first case, the bond is divided so that each product retains an electron and becomes a neutral radical. In the second case, both electrons of the chemical bond remain with one of the products, resulting in charged ions. Dissociation plays an important role in triggeringchain reactions, such as hydrogen–oxygen or polymerization reactions.

\displaystyle {\ce {AB -> A + B}}
Dissociation of a molecule AB into fragments A and B

For bimolecular reactions, two molecules collide and react with each other. Their merger is called chemical synthesis or an addition reaction.

\displaystyle {\ce {A + B -> AB}}

Another possibility is that only a portion of one molecule is transferred to the other molecule. This type of reaction occurs, for example, in redox and acid-base reactions. In redox reactions, the transferred particle is an electron, whereas in acid-base reactions it is a proton. This type of reaction is also called metathesis.
\displaystyle {\ce {HA + B -> A + HB}}
for example
\displaystyle {\ce {NaCl + AgNO3 -> NaNO3 + AgCl(v)}}

Chemical equilibrium

Most chemical reactions are reversible, that is they can and do run in both directions. The forward and reverse reactions are competing with each other and differ in reaction rates. These rates depend on the concentration and therefore change with time of the reaction: the reverse rate gradually increases and becomes equal to the rate of the forward reaction, establishing the so-called chemical equilibrium. The time to reach equilibrium depends on such parameters as temperature, pressure and the materials involved, and is determined by the minimum free energy. In equilibrium, the Gibbs free energy must be zero. The pressure dependence can be explained with the Le Chatelier’s principle. For example, an increase in pressure due to decreasing volume causes the reaction to shift to the side with the fewer moles of gas.[13]

The reaction yield stabilizes at equilibrium, but can be increased by removing the product from the reaction mixture or changed by increasing the temperature or pressure. A change in the concentrations of the reactants does not affect the equilibrium constant, but does affect the equilibrium position.

Thermodynamics

Chemical reactions are determined by the laws of thermodynamics. Reactions can proceed by themselves if they are exergonic, that is if they release energy. The associated free energy of the reaction is composed of two different thermodynamic quantities, enthalpyand entropy:[14]

\displaystyle \Delta G=\Delta H-T\cdot \Delta S .

G: free energy, H: enthalpy, T: temperature, S: entropy, Δ: difference(change between original and product)

Reactions can be exothermic, where ΔH is negative and energy is released. Typical examples of exothermic reactions are precipitation and crystallization, in which ordered solids are formed from disordered gaseous or liquid phases. In contrast, in endothermicreactions, heat is consumed from the environment. This can occur by increasing the entropy of the system, often through the formation of gaseous reaction products, which have high entropy. Since the entropy increases with temperature, many endothermic reactions preferably take place at high temperatures. On the contrary, many exothermic reactions such as crystallization occur at low temperatures. Changes in temperature can sometimes reverse the sign of the enthalpy of a reaction, as for the carbon monoxide reduction ofmolybdenum dioxide:

\displaystyle {\ce {2CO(g) + MoO2(s) -> 2CO2(g) + Mo(s)}} ; \displaystyle \Delta H^{o}=+21.86\ {\text{kJ at 298 K}}

This reaction to form carbon dioxide and molybdenum is endothermic at low temperatures, becoming less so with increasing temperature.[15] ΔH° is zero at 1855 K, and the reaction becomes exothermic above that temperature.

Changes in temperature can also reverse the direction tendency of a reaction. For example, the water gas shift reaction

\displaystyle {\ce {CO(g) + H2O({v}) <=> CO2(g) + H2(g)}}

is favored by low temperatures, but its reverse is favored by high temperature. The shift in reaction direction tendency occurs at 1100 K.[15]

Reactions can also be characterized by the internal energy which takes into account changes in the entropy, volume and chemical potential. The latter depends, among other things, on the activities of the involved substances.[16]

\displaystyle {d}U=T\cdot {d}S-p\cdot {d}V+\mu \cdot {d}n

U: internal energy, S: entropy, p: pressure, μ: chemical potential, n: number of molecules, d: small change sign

Kinetics

The speed at which reactions takes place is studied by reaction kinetics. The rate depends on various parameters, such as:

  • Reactant concentrations, which usually make the reaction happen at a faster rate if raised through increased collisions per unit time. Some reactions, however, have rates that are independent of reactant concentrations. These are called zero order reactions.
  • Surface area available for contact between the reactants, in particular solid ones in heterogeneous systems. Larger surface areas lead to higher reaction rates.
  • Pressure – increasing the pressure decreases the volume between molecules and therefore increases the frequency of collisions between the molecules.
  • Activation energy, which is defined as the amount of energy required to make the reaction start and carry on spontaneously. Higher activation energy implies that the reactants need more energy to start than a reaction with a lower activation energy.
  • Temperature, which hastens reactions if raised, since higher temperature increases the energy of the molecules, creating more collisions per unit time,
  • The presence or absence of a catalyst. Catalysts are substances which change the pathway (mechanism) of a reaction which in turn increases the speed of a reaction by lowering the activation energy needed for the reaction to take place. A catalyst is not destroyed or changed during a reaction, so it can be used again.
  • For some reactions, the presence of electromagnetic radiation, most notably ultraviolet light, is needed to promote the breaking of bonds to start the reaction. This is particularly true for reactions involving radicals.

Several theories allow calculating the reaction rates at the molecular level. This field is referred to as reaction dynamics. The rate v of a first-order reaction, which could be disintegration of a substance A, is given by:

\displaystyle v=-{\frac {d[{\ce {A}}]}{dt}}=k\cdot [{\ce {A}}].

Its integration yields:

\displaystyle {\ce {[A]}}(t)={\ce {[A]}}_{0}\cdot e^{-k\cdot t}.

Here k is first-order rate constant having dimension 1/time, [A](t) is concentration at a time t and [A]0 is the initial concentration. The rate of a first-order reaction depends only on the concentration and the properties of the involved substance, and the reaction itself can be described with the characteristic half-life. More than one time constant is needed when describing reactions of higher order. The temperature dependence of the rate constant usually follows the Arrhenius equation:

\displaystyle k=k_{0}e^{{-E_{a}}/{k_{B}T}}

where Ea is the activation energy and kB is the Boltzmann constant. One of the simplest models of reaction rate is the collision theory. More realistic models are tailored to a specific problem and include the transition state theory, the calculation of the potential energy surface, the Marcus theory and the Rice–Ramsperger–Kassel–Marcus (RRKM) theory.[17]

 

工具善用能畫圓??!!

/chempy

⚗ A package useful for chemistry written in Python

ChemPy

Build status PyPI version Python version License airspeedvelocity coverage Journal of Open Source Software DOI

About ChemPy

ChemPy is a Python package useful for chemistry (mainly physical/inorganic/analytical chemistry). Currently it includes:

  • Numerical integration routines for chemical kinetics (ODE solver front-end)
  • Integrated rate expressions (and convenience fitting routines)
  • Solver for equilibria (including multiphase systems)
  • Relations in physical chemistry:
    • Debye-Hückel expressions
    • Arrhenius & Eyring equation
    • Einstein-Smoluchowski equation
  • Properties (pure python implementations from the litterature)
    • water density as function of temperature
    • water permittivity as function of temperature and pressure
    • water diffusivity as function of temperature
    • water viscosity as function of temperature
    • sulfuric acid density as function of temperature & weight fraction H₂SO₄
    • More to come… (and contributions are most welcome!)

Documentation

The easiest way to get started is to have a look at the examples in this README, and also the jupyter notebooks. In addition there is auto-generated API documentation for the latest stable release here (and here are the API docs for the development version).

※ 註︰ 安裝

sudo apt-get install python3-pulp

sudo pip3 install chempy

 

 

 

 

 

 

 

 

 

STEM 隨筆︰鬼月談化學︰☵ 陷 《變化》

卜筮』是為『決疑』,既然『無疑』又何需『卜筮』的呢?孔子既卜得『』卦,又為什麼以為『不好』的呢?如果看《易經》的《十翼》,或可知其一二

彖曰賁,亨﹔柔來而文剛,故亨。分剛上而文柔,故小利有攸往。天文也﹔文明以止,人文也。觀乎天文,以察時變﹔觀乎人文,以化成天下。

象曰:山下有火,賁﹔君子以明庶政,無敢折獄。

顯然像『子貢』說的是個『吉卦』的吧!『』是『文采』,想『孔老夫子』周遊列國一無所成,正感嘆著『無力於』這個『黑白不分』的時代,偏偏卻得到這麼個『紋過飾非』的現實『象徵』,他老先生當然『不高興』的啦!想必是占卜『所求不得』的吧!!

就像《觀水》一文中講古人喜歡『論水』講『智者樂水』,那麼『易經』中的『坎為水』為什麼又是『坎陷』與『坎險』的意思的呢?或許『』和『』本相反相成,就像是『善泳者死於水』的告誡一般,『水之潤下』的『特性』使它容易遇着『』等等『陷阱』,因此此卦特別用『習坎』為名強調需要一再的『練習』以及『謹慎』之意的吧!!

漢代有兩位『京房』,都研究『易經』,也都是『太守』,一是

齊郡太守』之京房:漢昭帝時為太中大夫、齊郡太守,治易學,師從菑川人『楊何』。有弟子『梁丘賀』。

,另一是

郎、魏郡太守』之京房︰字君明,東郡頓丘人。西漢學者漢元帝時官員。本 姓李,因其愛好吹奏音律,自定為京氏,羌笛原本有三個音孔,京房改進後成了多一個,音孔定為商聲,從而使它能奏全宮、商、角、徵、羽五聲。漢元帝時為郎、 魏郡太守。治易學,師從梁人『焦延壽』,詳於災異,開創了京氏易學,有《京氏易傳》存世。焦延壽曾憂慮說︰『得我道以亡身者,京生也。』漢元帝初元四年,西羌叛亂,又有日蝕。漢元帝召見他時,京房宣稱:『古帝王以功舉賢,則萬化成,瑞應著;末世以毀譽取人,故功業廢而致災異。宜令百官各試其功,災異可息。』又提出《考功課吏法》 。當時宦官石顯擔任中書令,誣陷其誹謗朝政,歸惡天子,元帝將京房下獄,死獄中。

這位『京房』青出於藍,以易經的《說卦傳‧第十章》之『乾坤生六子』創造了『易經象數派』之『八宮卦』,之後宋代著名的『安樂先生‧邵康節』用於『梅花易數』,今日『命理術數』所稱『世應』,所取干支『五行生剋』,從之而出,果真耶其是『無的放矢』的嗎?卻又因『以功舉賢』得罪『當道宦官』以『取死』,若是果非耶『不可前知』的呢??於此僅列出『習坎』之『京房八宮卦』的『彖‧象對照』以饗讀者吧!

甲骨文習
易經‧坎卦
坎:習坎,有孚,維心亨,行有尚。

彖曰:習坎,重險也。 水流而不盈,行險而不失其信。 維心亨,乃以剛中也。 行有尚,往有功也。 天險不可升也,地險山川丘陵也,王公設險以守其國,坎之時用大矣哉!
象曰:水洊至,習坎﹔君子以常德行,習教事。

初六:習坎,入于坎窞,凶。
象曰:習坎入坎,失道凶也。

 

 

 

九二:坎有險,求小得。
象曰:求小得,未出中也。

 

 

 

六三:來之坎坎,險且枕,入于坎窞,勿用。
象曰:來之坎坎,終無功也。

 

 

六四:樽酒簋貳,用缶,納約自牖,終無咎。
象曰:樽酒簋貳,剛柔際也。

 

 

 

九五:坎不盈,只既平,無咎。
象曰:坎不盈,中未大也。

 

 

 

 

 

 

 

上六:係用徽纆,置于叢棘,三歲不得,凶。
象曰:上六失道,凶三歲也。

幼鳥在巢裡振動翅膀練習飛行。

《說文解字》:習,數飛也。从羽,从白。凡習之屬皆从習。

 

 

 

 

 

 

一世‧水澤節 ☵ ☱

彖曰:節,亨,剛柔分,而剛得中。苦節不可貞,其道窮也。說以行險,當位以節,中正以通。 天地節而四時成,節以制度,不傷財,不害民。
象曰:澤上有水,節﹔君子以制數度,議德行。

二世‧水雷屯 ☵ ☳

彖曰:屯,剛柔始交而難生,動乎險中,大亨貞。雷雨之動滿盈,天造草昧,宜建侯而不寧。
象曰:云,雷,屯﹔君子以經綸。

三世‧水火既濟 ☵ ☲

彖曰:既濟,亨,小者亨也。利貞,剛柔正而位當也。 初吉,柔得中也。終止則亂,其道窮也。
象曰:水在火上,既濟﹔君子以思患而預防之。

四世‧澤火革 ☱ ☲

彖曰:革,水火相息,二女同居,其志不相得,曰革。己日乃孚﹔革而信也。 文明以說,大亨以正,革而當,其悔乃亡。天地革而四時成,湯武革命,順乎天而應乎人,革之時義大矣哉!
象曰:澤中有火,革﹔君子以治歷明時。

五世‧雷火豐 ☳ ☲

彖曰:丰,大也。 明以動,故丰。王假之,尚大也。 勿憂宜日中,宜照天下也。日中則昃,月盈則食,天地盈虛,與時消息,而況於人乎?況於鬼神乎?
象曰:雷電皆至,丰﹔君子以折獄致刑。

遊魂‧地火明夷 ☷ ☲

彖曰:明入地中,明夷。 內文明而外柔順,以蒙大難,文王以之。 利艱貞,晦其明也,內難而能正其志,箕子以之。
象曰:明入地中,明夷﹔君子以蒞眾,用晦而明。

歸魂‧地水師 ☷ ☵

彖曰:師,眾也,貞正也,能以眾正,可以王矣。 剛中而應,行險而順,以此毒天下,而民從之,吉又何咎矣。
象曰:地中有水,師﹔君子以容民畜眾。

─── 《水的生命!!下

 

俗話說︰『謠言』止於『智者』。既有所『止』,焉無所『始』乎 ? 有曰︰『造假』出自『聰明人』也!

想當初練習『化學動力學』

Chemical kinetics

Chemical kinetics, also known as reaction kinetics, is the study of rates of chemical processes. Chemical kinetics includes investigations of how different experimental conditions can influence the speed of a chemical reaction and yield information about thereaction’s mechanism and transition states, as well as the construction of mathematical models that can describe the characteristics of a chemical reaction.

 

讀其簡短『歷史』

History

In 1864, Peter Waage and Cato Guldberg pioneered the development of chemical kinetics by formulating the law of mass action, which states that the speed of a chemical reaction is proportional to the quantity of the reacting substances.[1][2][3]

Van ‘t Hoff studied chemical dynamics and published in 1884 his famous “Etudes de dynamique chimique”.[4] In 1901 he was awarded by the first Nobel Prize in Chemistry “in recognition of the extraordinary services he has rendered by the discovery of the laws of chemical dynamics and osmotic pressure in solutions”.[5] After van ‘t Hoff, chemical kinetics deals with the experimental determination of reaction rates from which rate laws and rate constants are derived. Relatively simple rate laws exist for zero order reactions (for which reaction rates are independent of concentration), first order reactions, and second order reactions, and can be derived for others. Elementary reactions follow the law of mass action, but the rate law of stepwise reactions has to be derived by combining the rate laws of the various elementary steps, and can become rather complex. In consecutive reactions, the rate-determining step often determines the kinetics. In consecutive first order reactions, a steady state approximation can simplify the rate law. The activation energyfor a reaction is experimentally determined through the Arrhenius equation and the Eyring equation. The main factors that influence the reaction rate include: the physical state of the reactants, the concentrations of the reactants, the temperature at which the reaction occurs, and whether or not any catalysts are present in the reaction.

Gorban and Yablonsky have suggested that the history of chemical dynamics can be divided into three eras.[6] The first is the van ‘t Hoff wave searching for the general laws of chemical reactions and relating kinetics to thermodynamics. The second may be called theSemenovHinshelwood wave with emphasis on reaction mechanisms, especially for chain reactions. The third is associated with Aris and the detailed mathematical description of chemical reaction networks.

 

數過『影響因素』之數

Factors affecting reaction rate

Nature of the reactants

The reaction rate varies depending upon what substances are reacting. Acid/base reactions, the formation of salts, and ion exchange are usually fast reactions. When covalent bond formation takes place between the molecules and when large molecules are formed, the reactions tend to be slower.

The nature and strength of bonds in reactant molecules greatly influence the rate of their transformation into products.

Physical state

The physical state (solid, liquid, or gas) of a reactant is also an important factor of the rate of change. When reactants are in the same phase, as in aqueous solution, thermal motion brings them into contact. However, when they are in different phases, the reaction is limited to the interface between the reactants. Reaction can occur only at their area of contact; in the case of a liquid and a gas, at the surface of the liquid. Vigorous shaking and stirring may be needed to bring the reaction to completion. This means that the more finely divided a solid or liquid reactant the greater its surface area per unit volume and the more contact it with the other reactant, thus the faster the reaction. To make an analogy, for example, when one starts a fire, one uses wood chips and small branches — one does not start with large logs right away. In organic chemistry, on water reactions are the exception to the rule that homogeneous reactions take place faster than heterogeneous reactions.

Surface area of solids

In a solid, only those particles that are at the surface can be involved in a reaction. Crushing a solid into smaller parts means that more particles are present at the surface, and the frequency of collisions between these and reactant particles increases, and so reaction occurs more rapidly. For example, Sherbet (powder) is a mixture of very fine powder of malic acid (a weak organic acid) and sodium hydrogen carbonate. On contact with the saliva in the mouth, these chemicals quickly dissolve and react, releasing carbon dioxide and providing for the fizzy sensation. Also, fireworks manufacturers modify the surface area of solid reactants to control the rate at which the fuels in fireworks are oxidised, using this to create different effects. For example, finely divided aluminium confined in a shell explodes violently. If larger pieces of aluminium are used, the reaction is slower and sparks are seen as pieces of burning metal are ejected.

Concentration

 

The reactions are due to collisions of reactant species. The frequency with which the molecules or ions collide depends upon their concentrations. The more crowded the molecules are, the more likely they are to collide and react with one another. Thus, an increase in the concentrations of the reactants will usually result in the corresponding increase in the reaction rate, while a decrease in the concentrations will usually have a reverse effect. For example, combustion will occur more rapidly in pure oxygen than in air (21% oxygen).

The rate equation shows the detailed dependence of the reaction rate on the concentrations of reactants and other species present. Different mathematical forms are possible depending on the reaction mechanism. The actual rate equation for a given reaction is determined experimentally and provides information about the reaction mechanism. The mathematical expression of the rate equation is often given by

rate = k [A]x[B]y

Here ‘x’ and ‘y’ are constants for each reactant, while [A] and [B] are molar concentrations of reactants. Also ‘k’ is the reaction rate constant which can only be determined experimentally.

Temperature

 

Temperature usually has a major effect on the rate of a chemical reaction. Molecules at a higher temperature have more thermal energy. Although collision frequency is greater at higher temperatures, this alone contributes only a very small proportion to the increase in rate of reaction. Much more important is the fact that the proportion of reactant molecules with sufficient energy to react (energy greater than activation energy: E > Ea) is significantly higher and is explained in detail by the Maxwell–Boltzmann distribution of molecular energies.

The ‘rule of thumb’ that the rate of chemical reactions doubles for every 10 °C temperature rise is a common misconception. This may have been generalized from the special case of biological systems, where the α (temperature coefficient) is often between 1.5 and 2.5.

A reaction’s kinetics can also be studied with a temperature jump approach. This involves using a sharp rise in temperature and observing the relaxation time of the return to equilibrium. A particularly useful form of temperature jump apparatus is a shock tube, which can rapidly jump a gas’s temperature by more than 1000 degrees.

Catalysts

Generic potential energy diagram showing the effect of a catalyst in a hypothetical endothermic chemical reaction. The presence of the catalyst opens a different reaction pathway (shown in red) with a lower activation energy. The final result and the overall thermodynamics are the same.

A catalyst is a substance that alters the rate of a chemical reaction but remains chemically unchanged afterwards. The catalyst increases the rate of the reaction by providing a different reaction mechanism to occur with a loweractivation energy. In autocatalysis a reaction product is itself a catalyst for that reaction leading to positive feedback. Proteins that act as catalysts in biochemical reactions are called enzymes. Michaelis–Menten kinetics describe the rate of enzyme mediated reactions. A catalyst does not affect the position of the equilibrium, as the catalyst speeds up the backward and forward reactions equally.

In certain organic molecules, specific substituents can have an influence on reaction rate in neighbouring group participation.[citation needed]

Pressure

Increasing the pressure in a gaseous reaction will increase the number of collisions between reactants, increasing the rate of reaction. This is because the activity of a gas is directly proportional to the partial pressure of the gas. This is similar to the effect of increasing the concentration of a solution.

In addition to this straightforward mass-action effect, the rate coefficients themselves can change due to pressure. The rate coefficients and products of many high-temperature gas-phase reactions change if an inert gas is added to the mixture; variations on this effect are called fall-off and chemical activation. These phenomena are due to exothermic or endothermic reactions occurring faster than heat transfer, causing the reacting molecules to have non-thermal energy distributions (non-Boltzmann distribution). Increasing the pressure increases the heat transfer rate between the reacting molecules and the rest of the system, reducing this effect.

Condensed-phase rate coefficients can also be affected by (very high) pressure; this is a completely different effect than fall-off or chemical-activation. It is often studied using diamond anvils.

A reaction’s kinetics can also be studied with a pressure jump approach. This involves making fast changes in pressure and observing the relaxation time of the return to equilibrium.

Presence of Light

Light provides necessary activation energy to the starting materials, therefore, most of the reactions becomes faster in the presence of light

 

讚嘆『生生不息』造化,果然『不可思議』哩!!

能在『非線性』『平衡』

Equilibrium

While chemical kinetics is concerned with the rate of a chemical reaction, thermodynamics determines the extent to which reactions occur. In a reversible reaction, chemical equilibrium is reached when the rates of the forward and reverse reactions are equal [the principle of dynamic equilibrium ] and the concentrations of the reactants and Products no longer change. This is demonstrated by, for example, the Haber–Bosch process for combining nitrogen and hydrogen to produce ammonia. Chemical clock reactions such as the Belousov–Zhabotinsky reaction demonstrate that component concentrations can oscillate for a long time before finally attaining the equilibrium.

 

中,游刃有餘耶??

故爾今日『後話先講』

Chemical kinetics

In chemistry one is often interested in how fast a chemical process proceeds. Chemical reactions (when viewed as single events on a molecular scale) are probabilitic. However, most reactive systems of interest involve very large numbers of molecules (a few grams of a simple substance containts on the order of {10}^{23} molecules. The sheer number allows us to describe this inherently stochastic process deterministically.

Law of mass action

In order to describe chemical reactions as as system of ODEs in terms of concentrations (cici) and time (tt), one can use the law of mass action:

\frac{dc_i}{dt} = \sum_j S_{ij} r_j

where r_j is given by:

r_j = k_j\prod_l c_l^{R_{jl}}

and S is a matrix with the overall net stoichiometric coefficients (positive for net production, negative for net consumption), and R is a matrix with the multiplicities of each reactant for each equation.

Example: Nitrosylbromide

We will now look at the following (bi-directional) chemical reaction:

\mathrm{2\,NO + Br_2 \leftrightarrow 2\,NOBr}

which describes the equilibrium between nitrogen monoxide (NO) and bromine (Br22) and nitrosyl bromide (NOBr). It can be represented as a set of two uni-directional reactions (forward and backward):

\mathrm{2\,NO + Br_2 \overset{k_f}{\rightarrow} 2\,NOBr} \\ \mathrm{2\,NOBr \overset{k_b}{\rightarrow} 2\,NO + Br_2}

The law of mass action tells us that the rate of the first process (forward) is proportional to the concentration Br_2 and the square of the concentration of NO. The rate of the second reaction (the backward process) is in analogy proportional to the square of the concentration of NOBr. Using the proportionality constants k_f and k_b we can formulate our system of nonlinear ordinary differential equations as follows:

\frac{dc_1}{dt} = 2(k_b c_3^2 - k_f c_2 c_1^2) \\ \frac{dc_2}{dt} = k_b c_3^2 - k_f c_2 c_1^2 \\ \frac{dc_3}{dt} = 2(k_f c_2 c_1^2 - k_b c_3^2)

where we have denoted the concentration of NO, Br_2, NOBr with c_1, c_2, c_3 respectively.
This ODE system corresponds to the following two matrices:

S = \begin{bmatrix} -2 & 2 \\ -1 & 1 \\ 2 & -2 \end{bmatrix}

R = \begin{bmatrix} 2 & 1 & 0 \\ 0 & 0 & 2 \end{bmatrix}

 

 

方便『有所準備』勒!!??

/pyneqsys

Solve symbolically defined systems of non-linear equations numerically.

pyneqsys

Build status Build status on CircleCI Build status on Travis-CI PyPI version Python version DOI License file coverage

pyneqsys provides a convenience class for representing and solving non-linear equation systems from symbolic expressions (provided e.g. with the help of SymPy).

The numerical root finding is perfomed using either:

In addition to offering a unified interface to different solvers, pyneqsys can also derive the Jacobian analytically (when usingpyneqsys.SymbolicSys). This is useful since doing so manually is widely recognized as both tedious and error prone.

The symbolic representation is usually in the form of SymPy expressions, but the user may choose another symbolic back-end (seesym).

In addition to deriving the Jacobian analytically the symbolic representation can for example apply row-reduce. This is usful for when you have a overdetermined system ( formed from e.g. applying conservation laws) and want to solve the system by root-finding rather than using a least-square optimization of e.g. Levenberg-Marquardt style.

Last, but not the least having a symbolic representation of your system of equations allows you to generate publication quality latex representations of your equations (through SymPy’s latex printer) from a single source‒no more error prone hand-rewriting of the same equations in another format for presentation!

Documentation

Autogenerated API documentation for latest stable release is found here: https://bjodah.github.io/pyneqsys/latest (and the development version for the current master branch is found here: http://hera.physchem.kth.se/~pyneqsys/branches/master/html).

※ 註︰ 安裝

sudo apt-get install libsundials-*
sudo pip3 install pykinsol
sudo pip3 install pyneqsys

 

 

 

 

 

 

 

 

STEM 隨筆︰鬼月談化學︰風起

《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]奇點。這些奇特的現象,也常常讓非線性系統的行為看起來違反直覺、不可預測,或甚至混沌。雖然「混沌的行為」和「隨機的行為」感覺很相似,但兩者絕對不能混為一談;也就是說,一個混沌系統的行為絕對不是隨機的。

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

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

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

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

 

不明聲響,不知何處而來,恍惚中依稀聽聞︰

䁗奧思︰普羅米修斯你看到了吧。人們根本分不清什麼是『混沌』與『隨機』呢?他事實沒有

神農

神農氏,又稱烈山氏,或稱連山[1],相傳生存年代在夏朝[2]以前,現存文字記載多出現在在戰國以後[3]。相傳「神農嘗百草」、教人醫療農耕,中國人視之為傳說中的農業醫藥的發明者、守護神,尊稱為「藥王」、「五穀王」、「五穀先帝」、「神農大帝 」等。

氏之『水晶肚』

據說神農氏的樣貌很奇特,身材瘦削,全身除了頭和四肢外,都是透明的(水晶肚),因此內臟清晰可見。神農氏嘗盡百草,只要藥草是有毒的,服下後他的內臟就會呈現黑色,因此什麼藥草對於人體哪一個部位有影響就可以輕易地知道了。後來,由於神農氏服太多種毒藥,積毒太深,最後因為斷腸草(有人說是百足蟲)而身亡 。

竟敢『嚐毒』哩!

普羅米修斯︰我親愛的䁗奧思,你當然知道『知識』是無法『揠苗助長』呦☺為何自然還賦予『希望』耶☆『熟成』總需要時間◎

莫非『鬼月』月色絕美,所以失魂落魄!!

少所見則多所怪,見駱駝言馬腫背。韓愈作『五原』論︰《原道》 、《原性》、《原人》、《原毀》、《原鬼》。之所以終於

【原鬼】

李石曰:「退之作《原鬼》,與晉阮千里相表裏。至作《羅池碑》欲以鬼威喝人,是為子厚求食也。《送窮文》雖出游戲,皆自叛其說也。退之以長慶四年寢疾,帝遣神召之曰:『骨使世與韓氏相仇,欲同力討之,天帝之兵欲行陰誅,乃更藉人力乎?』當是退之數窮識亂,為鬼所乘,不然,平生強聒,至死無用。」

有嘯於梁,「於梁」、「於堂」下,一本各有「者」。從而燭之,無見也。斯鬼乎?曰:非也,鬼無聲。有立於堂,從而視之,無見也。斯鬼乎?曰:非也,鬼無形。有觸吾躬,從而執之,無得也。斯鬼乎?曰:非也,鬼無聲與形,安有氣。「鬼無聲與形」上,或有「鬼無氣」三字,非是。曰:鬼無聲也,無形也,無氣也,果無鬼乎?曰:有形而無聲者,物有之矣,土石是也;有聲而無形者,物有之矣,風霆是也;有聲與形者,物有之矣,人獸是也;無聲與形者,物有之矣,鬼神是也。李石曰:「公子彭生托形於豕,晉文公托聲如牛,韓子謂鬼無聲與形,未盡也。」曰:然則有怪而與民物接者,何也?曰:是有二:有鬼,有物。有怪或作見怪,二下或有說字;或有說字,而無「有鬼有物」四字。漠然無形與聲者,鬼之常也。民有忤於天,有違於民,上民字一作人,下民字或作時。有爽於物,逆於倫,而感於氣,於是乎鬼有形於形 ,有形或作有托。有憑於聲以應之,而下殃禍焉,皆民之為之也。為下或無之字。其既也,又反乎其常。曰:何謂物?曰:成於形與聲者 ,土石、風霆、人獸是也;反乎無聲與形者,鬼神是也;反乎或作反其,非是。不能有形與聲,不能無形與聲者,物怪是也。或無「不能有形與聲」六字,或無「不能無形與聲」六字。故其作而接於民也無恆,故有動於民而為禍,亦有動於民而為福,本或先言為福。按《左氏》、《國語》:「周惠王十五年,有神降於莘。王問諸內史過,對曰云云。有得神以興,亦有以亡。夏之興也,祝融降於崇山;其亡也,回祿信於聆隧。商之興也,勹淮嗚山;其亡也,夷羊在牧。周之興也,蝶弄C於歧山;其衰,以杜伯射於於高阜。」動於民而為禍福,其斯之謂歟?亦有動於民而莫之為禍福,適丁民之有是時也。作《原鬼》。閣、蜀、粹無作字。今按:古書篇題多在後者,如《荀子》諸賦正此類也。但此篇前已有題,不應複出,故且從諸本存作字。

 

,欲初五接『財神』!!初六想《送窮》乎??

古來『知』、『行』二字,添上『難』、『易』判語,加了『先』、『後』助詞,不曉多少文章??當真『行道難』也!!

【行難】

行,下孟切。公《與祠部陸參員外書》,在貞元十八年。此篇言參自越州召拜祠部員外郎,豈在前歟?參字公佐云。

或問「行孰難?」曰:「舍我之矜,從爾之稱,孰能之。」曰:「陸先生參,何如?」按:《李習之集》,參作人參。曰:「先生之賢聞天下,是是而非非。聞下或有於字。貞元中,自越州徵拜祠部員外郎 ,京師之人日造焉,閉門而拒之滿街。愈嘗往間客席,嘗或作常。間或作問。客或作賓。席下或有坐定二字。先生矜語其客曰:『某胥也,某商也,其生某任之,其死某誄之,某與某可人也,可或作何。或從閣、杭、苑作可,云:「可人見《禮記》,鄭注曰:此人可也。」今按:據《禮記》是也。然詳下文韓公之語,似以陸公雖嘗任誄此人,複自疑於有罪,則頗有薄其門地之意。而以薦引之力自多者,恐須作何字,語勢乃協。更詳之。任與誄也非罪歟?』皆曰:『然。』也或作之。罪一作過。曰上或有應字。愈曰:『某之胥,某之商,其得任與誄也,有由乎?抑有罪不足任而誄之邪? 』任而誄或作誄而任。而或作與。先生曰:『否,吾惡其初,惡去聲。不然,任與誄也何尤。』愈曰:『苟如是,先生之言過矣!昔者管敬子取盜二人為大夫於公,《禮記》:「管仲遇盜,取二人焉,上以為公臣,曰:『其所與由闢也,可人也。』」敬子,仲之謚也。趙文子舉管庫之士七十有餘家,《禮記》:「趙文子所舉於晉國,管庫之士七十有餘家。」夫惡求其初?』惡音烏。先生曰:『不然,彼之取者賢也。』愈曰:『先生之所謂賢者,大賢歟?抑賢於人之賢歟?齊也,晉也,且有二與七十 ,而可謂今之天下無其人邪?而可上或有焉字,邪上或有也字。先生之選人也已詳。』先生曰:『然。』愈曰:『聖人不世出,賢人不時出 ,千百歲之間倘有焉;聖人賢人,人,或皆作之,或並有人之二字。世出或作世生,百歲或作百年。不幸而有出於胥商之族者,先生之說傳,吾不忍赤子之不得乳於其母也!』先生曰:『然。』乳於或無於字。他日又往坐焉。或無坐字。先生曰:『今之用人也不詳。位乎朝者,吾取某與某而已,在下者多於朝,凡吾與者若干人。』愈曰:『先生之與者,盡於此乎?其皆賢乎?抑猶有舉其多而缺其少乎?』或無「其皆賢乎」四字。缺或作沒。少或作細,或作一。少下或有者字。今按:此言人之才或不全備,姑舉其可取之多,而略其可棄之少也。先生曰:『固然,吾敢求其全。』其或作於。今按:作其語意為近,但陸公此句正不敢必求全才之意,而下文韓公又以太詳而不早責之,殊不可曉,當更考之。愈曰:『由宰相至百執事凡幾位?由一方至一州凡幾位?先生之得者,無乃不足充其位邪 ?其位下或有也字。不早圖之,一朝而舉焉。今雖詳,其後用也必粗。 』舉焉或作索之,詳下或有且微字,非是。粗,聰徂切。先生曰:『然。子之言,孟軻不如。』」《文錄》作「退語其人曰,乃今吾見孟軻」。

─── 摘自《W!O+ 的《小伶鼬工坊演義》︰神經網絡【深度學習】一

 

一時起風了,夜空裡

化學動力學

化學動力學也稱反應動力學化學反應動力學,是物理化學的一個分支,研究化學反應反應速率反應機理。它的主要研究領域包括:分子反應動力學催化動力學基元反應動力學宏觀動力學表觀動力學等,也可依不同化學分支分類為有機反應動力學無機反應動力學。化學動力學往往是化工生產過程中的決定性因素 。

化學動力學與化學熱力學不同,不是計算達到反應平衡時反應進行的程度或轉化率,而是從一種動態的角度觀察化學反應,研究反應系統轉變所需要的時間,以及這之中涉及的微觀過程。化學動力學與熱力學的基礎是統計力學量子力學分子運動論

碰撞理論預測了反應速率會隨著反應物濃度上升而增加。

 

文字忽隱忽現☆★

 

 

 

 

 

 

 

STEM 隨筆︰古典力學︰運動學【十】

假使人還不能知道『自我』 Self 是什麼?那麼人能找到榮格所說的『自性』嗎?就像一股『味道』帶出了『情懷』,漸漸的發覺那是早年的『記憶』!有種特殊的『感覺』!!如是一個記不清童年的我,能有什麼不同的『聯想』呢??

……

因此縱聞古有廓庵十牛圖

1) 尋牛

2) 見跡

3) 見牛

4) 得牛

5) 牧牛

6) 騎牛歸家

7) 忘牛存人

8) 人牛俱忘

9) 返本還源

10) 入鄽垂手

 

果能『轉態』度一生??

狀態轉移矩陣

狀態轉移矩陣(state-transition matrix)是控制理論中的矩陣,是時間 \displaystyle t 和初始時間 \displaystyle t_{0} 的函數,可以將時間 \displaystyle t_{0} 的狀態向量 \displaystyle x 和此矩陣相乘,得到時間 \displaystyle t 時的狀態向量 \displaystyle x 。狀態轉移矩陣可以用來找線性動態系統的通解。

線性系統的解

狀態轉移矩陣用來找以下形式線性系統狀態空間下的解:

\displaystyle {\dot {\mathbf {x} }}(t)=\mathbf {A} (t)\mathbf {x} (t)+\mathbf {B} (t)\mathbf {u} (t),\mathbf {x} (t_{0})=\mathbf {x} _{0} ,

其中 \displaystyle \mathbf {x} (t) 為系統狀態, \displaystyle \mathbf {u} (t) 為輸入信號,而 \displaystyle \mathbf {x} _{0} 為時間 \displaystyle t_{0} 時的初始條件。利用狀態轉移矩陣 \displaystyle \mathbf {\Phi } (t,\tau ) ,其解如下[1][2]

\displaystyle \mathbf {x} (t)=\mathbf {\Phi } (t,t_{0})\mathbf {x} (t_{0})+\int _{t_{0}}^{t}\mathbf {\Phi } (t,\tau )\mathbf {B} (\tau )\mathbf {u} (\tau )d\tau

第一項為零輸入響應(zero-input response),第二項為零狀態響應(zero-state response)。

若系統是時不變系統,可以將 \displaystyle \mathbf {\Phi } 定義為

\displaystyle \mathbf {\Phi } (t,t_{0})=e^{\mathbf {A} (t-t_{0})}

在時變系統的例子中,可能有許多不同的函數滿足上述條件,而解和系統的結構有關。在分析時變系統的解之前,需要先確定其狀態轉移矩陣。

─── 《萬象在說話︰心理是聯想網絡?

 

數已至十,又是歸零進位之時!宜乎尋氣味相投友朋共修耶?

green-raspberry

red-raspberry

golden-raspberry

White raspberry flowers

black-raspberry

五官 ── ── 從,各有『』與『』。有的人『不聽講』自己看書『看不懂』;又有人『一目十行』,可以『既讀即解』;還有的人非得『親為』否則『不解』。難道說『』與『』就果真或與『讀書無緣』?俗話說︰『氣味相投』自然朋比;『把酒飛斝』無非道友。學習的過程中,如果有志同道合的『朋友』,彼此切磋琢磨,想必更能日行千里,事半功倍吧!!

莊子講『庖丁解牛』的故事,講到庖丁功夫之深厚,竟然能讓『解牛不知其死,真真的是出神入化的好勒!!科學教育的重要性在於求『』,然而需要了解的是,世界有『價值』的不只是『』而已,也許說還有著『』與『』吧。曾經有一位西方哲人說道︰所謂『』就是把『』的事,用『』得方式呈現;古時或有另一位東方覺者談起︰大、大、亦大 ──

佚名詩

大地藏無盡,

勤勞資有生;

念哉斯意厚,

努力事春耕。

──,

大人者不失其『赤子之心』。

 

科學的方法在於『實驗』,不斷驗證『人以為知』之事,而這個 方法要求『人人都能』與『時時都可』,是嚴格的『事實』立論的基石,故可以說是強調『他証性』;然而人世間『經驗』的廣褒,自有『如人飲水』『自証』之,與『朋比道友』『互証』之

 

相互切磋琢磨文章︰

Andrew Gibiansky   ::   Math → [Code]

Quadcopter Dynamics and Simulation

FRIDAY, NOVEMBER 23, 2012

Introduction

A helicopter is a flying vehicle which uses rapidly spinning rotors to push air downwards, thus creating a thrust force keeping the helicopter aloft. Conventional helicopters have two rotors. These can be arranged as two coplanar rotors both providing upwards thrust, but spinning in opposite directions (in order to balance the torques exerted upon the body of the helicopter). The two rotors can also be arranged with one main rotor providing thrust and a smaller side rotor oriented laterally and counteracting the torque produced by the main rotor. However, these configurations require complicated machinery to control the direction of motion; a swashplate is used to change the angle of attack on the main rotors. In order to produce a torque the angle of attack is modulated by the location of each rotor in each stroke, such that more thrust is produced on one side of the rotor plane than the other. The complicated design of the rotor and swashplate mechanism presents some problems, increasing construction costs and design complexity.

A quadrotor helicopter (quadcopter) is a helicopter which has four equally spaced rotors, usually arranged at the corners of a square body. With four independent rotors, the need for a swashplate mechanism is alleviated. The swashplate mechanism was needed to allow the helicopter to utilize more degrees of freedom, but the same level of control can be obtained by adding two more rotors.

The development of quadcopters has stalled until very recently, because controlling four independent rotors has proven to be incredibly difficult and impossible without electronic assistance. The decreasing cost of modern microprocessors has made electronic and even completely autonomous control of quadcopters feasible for commercial, military, and even hobbyist purposes.

Quadcopter control is a fundamentally difficult and interesting problem. With six degrees of freedom (three translational and three rotational) and only four independent inputs (rotor speeds), quadcopters are severely underactuated. In order to achieve six degrees of freedom, rotational and translational motion are coupled. The resulting dynamics are highly nonlinear, especially after accounting for the complicated aerodynamic effects. Finally, unlike ground vehicles, helicopters have very little friction to prevent their motion, so they must provide their own damping in order to stop moving and remain stable. Together, these factors create a very interesting control problem. We will present a very simplified model of quadcopter dynamics and design controllers for our dynamics to follow a designated trajectory. We will then test our controllers with a numerical simulation of a quadcopter in flight.

Quadcopter Dynamics

We will start deriving quadcopter dynamics by introducing the two frames in which will operate. The inertial frame is defined by the ground, with gravity pointing in the negative zz direction. The body frame is defined by the orientation of the quadcopter, with the rotor axes pointing in the positive zz direction and the arms pointing in the xx and yy directions.

image
Quadcopter Body Frame and Inertial Frame

………

Conclusion

We derived equations of motion for a quadcopter, starting with the voltage-torque relation for the brushless motors and working through the quadcopter kinematics and dynamics. We ignored aerodynamical effects such as blade-flapping and non-zero free stream velocity, but included air friction as a linear drag force in all directions. We used the equations of motion to create a simulator in which to test and visualize quadcopter control mechanisms.

We began with a simple PD controller. Although the PD controller worked, it left a significant steady-state error. In order to decrease the steady-state error, we added an integral term in order to create a PID controller. We tested the PID controller (with minor modifications to prevent integral wind-up) and found that it was better at preventing steady-state error than the PD controller when presented with the same disturbances and using the same proportional and derivative gains. We also found that tuning the PID controller was difficult, and would often lead to an unstable system for unknown reasons. In order to avoid the difficulty of PID tuning and find the optimal set of parameters, we used a gradient-descent based extremum seeking method in order to numerically estimate gradients of a cost function in PID-parameter space and iteratively choose a set of parameters to minimize the cost function. We found that the resulting controller was significantly better than the one using manually turned parameters.

 

可將四軸飛行器送上青天☆

讓它表演特技呦☆☆

A Flying Inverted Pendulum

Markus Hehn and Raffaello D’Andrea