分類彙整: 樹莓派

勇闖新世界︰ W!o《卡夫卡村》變形祭︰感知自然‧幽境夢鄉

不久後終於抵達北岸碼頭,空蕩蕩似無人煙。月兒升的更高了,望著眼前土丘,顯的有些淒冷。或許 Mrphs 見我不言不語,因說道︰跨過面前的小山,就到了『幽境夢鄉』。再穿越『幽境夢鄉』,即達《卡夫卡村》。邊聽邊走,登上了山丘,『幽境夢鄉』在目,黑壓壓的一片,不知何處是盡頭。 Mrphs 又講起︰說來『幽境夢鄉』之名原該是『幽竟夢卿』的古稱。當地原鄉人本叫它『奇幻森林』 ,林內多有五十步高之參天巨木,樹蔭之大可蔽日,又為奇藤異草纏繞,彷彿是個天然暖房。故而林中香草靈芝常生,卵生溼生常居 。遂因此生生不斷,變異驚奇而得名。此林之中央有個『林中道』正是前往《卡夫卡村》的門徑。路底有塊大石,將入村道路分成了東西兩向。誰知一日有人卻意外的用『紫外線』拍着了這石,之後驚訝的發現其上儼然有圖文。北面刻的是『 幽 竟 』,南面上頭有『 夢 鄉』。故詢之 M♪o ,得其解為『幽竟夢卿』,然而此人以為是 M♪o 誤寫,當是作『幽境夢鄉』,於是延誤至今。這麼一說反而倒讓人好奇起來,故問︰難到 M♪o 沒有分辯。 Mrphs 接答︰據『小學堂』同學講,一回有人問過這事,老師說︰『幽竟夢卿』之本義是『 幽 』幽靜將『 竟 』盡,此景恐不再,或終『 夢 』在夢裡相『 鄉 』向。總帶著點『傷春悲秋』之意。錯讀為『幽境夢鄉』沒什麼不好的吧!!多少可以『安定人心』的啊??

只覺一時惘然不知所之何境何鄉的了。或許真應該振奮精神,換個調子續彈『 Sense Hat 』的『 IMU 』inertial measurement unit 之曲的乎!!何不就反其道而行,從『實驗』起頭的哩??

Raspberry Pi Experiment: Foucault Pendulum

200px-Foucault_pendulum

The Foucault Pendulum with some RPi’s Mounted to it

Purpose

Analyze the motion of a pendulum using an inertial measurement unit (IMU) with a Raspberry Pi.

Equipment

The following items are necessary:

  • Raspberry Pi with your choice of IMU
  • Scissors or snips
  • Zip ties (at least 2)
  • A few small pylons
  • A cart

You’ll need to acquire the following pieces of equipment from the observatory:

  • Extended hook
  • 30 kg pendulum mass

Optional:

  • Raspberry Pi mount

Procedure

  1. Place all your necessities on the cart and wheel it to the main floor in CCIS where the hanging solar system is.
  2. Grab your snips and extended hook and head up to the second floor so that you’re near to the coiled-up pendulum wire. Use the extended hook to grab the coiled up bundle and use the snips to cut the zip ties from the previous user. Gently lower the pendulum wire to the main level.
  3. Head back downstairs to your cart and wheel it over to where the pendulum wire is hanging. If you have a mount to secure your Pi to the pendulum, place it over the hole on top of the pendulum mass. Then grab the mounting screw hanging on the pendulum wire, and place the washer on top of your Raspberry Pi mount. Screw the wire into the pendulum mass for 6 full turns, then tighten the locking nut down onto the washer.
  4. Carefully lift the mass off the cart with two hands and slowly lower it until it is hanging about an inch off the ground.
    • If you need to physically initiate IMU recording using a switch or some other piece of hardware, now would be a good time to to do so.
  5. Place the safety pylons around the desired space you want the pendulum to swing in.
  6. With two hands holding the pendulum mass, begin to pull it back so that the pendulum is displaced approximately 2 meters from it’s resting position. When you are ready, let the mass just slip out of your hands to minimize wobbling as it begins it’s motion.
  7. If you are initiating your data collection remotely (such as SSH), go ahead and do that now. Once you have collected data for around 3 minutes you should have enough data. Stop the pendulum and lift it back onto the cart. Unscrew the locking nut, and remove the screw from the mass. Make sure the washer is secured on the mounting screw.
  8. Grab two of your zip ties and the pendulum wire. Without letting go, walk up the stairs and around to where you cut the zip ties off from before. Coil the pendulum wire until there is no more slack. Zip tie the coil in two places and gently release it over the atrium

Analysis

Since this pendulum is so long, the radial acceleration will be very tiny, and therefore difficult for the IMU to detect. The collected data will be very noisy and hard to analyze. So we will try to fit a sine curve to our data and use that for analysis instead. There are 3 parameters we need to obtain from our data: frequency, amplitude, and vertical displacement. You could also find the phase of the sine wave, although it is not important or relevant to your results. Make sure to trim down your data to only include the times when it is swinging on the pendulum.

Here is some sample raw data of the acceleration in the z direction vs time:

1000px-Foucault_pend_data_sim

Finding the Frequency

To find the frequency of our pendulum, we’ll need to pass our data through something called a ‘Fourier transform’. It will output a graph which shows the prevalence of all the frequencies present in the original signal. There should be a large spike which will be the frequency we are looking for. This is the frequency of the radial acceleration that the Raspberry Pi experienced. This will be exactly double the frequency of the pendulum, since every time the pendulum goes through one period, the radial acceleration will go through two.

1000px-Pendulum_fourier

Finding the Amplitude

To find the amplitude, we’ll use the root mean square method. It utilizes the standard deviation of your data, which is a measure how ‘how spread out’ the data is. The formula you want to use for calculating it is:

a = \frac{3}{\sqrt{2}} \sigma
where:

  • a = the amplitude of the wave
  • σ = the standard deviation of your data

Finding the Vertical Displacement

If your data is trimmed down to only include times when it is swinging, the average should be equal to the vertical displacement. Luckily it is very easy to find the average. Simply sum up all of your data points, and divide by the number of them.

d = \frac{1}{n} \sum \limits_{1}^{n} a_n
At this stage you should have found the necessary values. If you would like to visualize your results, just plug them into your standard wave equation:

y = a \cdot sin(2 \pi f t ) + d
 

1000px-Foucault_pend_fitted_sine

 

Determining the Length of the Pendulum

In order to find the length of the pendulum, you’ll need to make use of the value you got for the frequency. You’ll also need to know the acceleration due to gravity; you can take it to be 9.8m/s2. The following equation will also prove useful:

\frac{1}{f} = T = 2 \pi \sqrt{\frac{l}{g}}
Just solve for l and plug in your numbers.

Determining the Maximum Speed

To find the maximum speed, you’ll need to know the value of the amplitude of the vertical acceleration. The value of the amplitude, is equal to the maximum radial acceleration the pendulum will experience. The pendulum will only experience maximum radial acceleration when it is moving at its highest velocity. So we can estimate the maximum velocity using the amplitude and this equation:

a_r = \frac{v^2}{r}
Here the radius is just the length of the pendulum from a previous step. This will most likely be a far more inaccurate result because of the low magnitude of the radial acceleration. Once you find the maximum speed you could also estimate how high the pendulum was raised to initiate swinging using your conservation of energy laws. Using that height you could estimate the arc length over which the pendulum traveled.

───

 

或終於明白萊昂‧傅科之意旨的耶??!!

EastHanSeismograph

錯誤的原理

懸垂擺原理

Foucault_pendulum_animated

300px-Pendule_de_Foucault
巴黎先賢祠傅科擺

Foucault-rotz

160px-Foucault_pendulum_at_north_pole_accurate
北極,角速度為零

Foucault_pendulum_plane_of_swing_semi3D
北緯 30° 一周兩天

之前曾經談過『張衡』的『候風地動儀』為何失傳,它與漢代『讖緯之學』的關係,於此摘引『前因後果』的一小段

既然叫做『候風地動儀』,它的命名必然有些來歷。西漢末年隨著社會的衝突加劇,『讖緯之學』開始廣泛大流行。 《後漢書‧光武帝紀》光武帝於中元元年宣布『圖讖』於天下,把圖讖國教化。生於之後的張衡自當深知讖緯之術。就像『物候曆』的傳統,比如說《禮記‧月令》 更是其來有自。然後發展成用『占候』來『預測』人事的『吉凶禍福』。因此命名裡那個『』字應是指『徵候』,藉著此徵候來『預測』之義。而『』字當是 『風角』之術的觀『八方』風的用法,藉以表達『八個方位 』的意思。如此看來這個候風地動儀的名義就是『測知八方地動之器』。
……
自公元一三二年張衡發明候風地動儀以來,接連發生了幾次地震,到公元一三四年的隴西地震,張衡名氣大造,候風地動儀也聲名遠播。然而因著『天象』結合了『政爭』,頻起的『地震』 究竟是『誰的過錯』?懺緯之說如是說︰地震起於『用人不當』,此上天之所以『罰罪』。縱使張衡有『天才之能』亦『無力分說』那個『地震之是非』 。因此公元一三四年有『高官免職』後,張衡的『官運』也就步上了『黯淡之途』。由於沒有人希望能夠再『測出地震』,這時那個候風地動儀已經成為了『不祥之器』!短短幾年後,到了公元一三九年張衡抑鬱而逝。東漢末年,公元一九零年,董卓一把大火燒毀了『洛陽城』,一切終歸於『灰飛煙滅』!!

由此觀之,持守『科學精神』的『理性』實屬不易,『科技文明』的『發達』,也很難度杜絕『無根之言』,也許應該說面對『大自然』的『神奇奧妙』,人類其實『所知甚少』。而且一些雖然說是人們『已知之事』,但由於是『抽象』的,在缺乏了『直接經驗』下,總是顯得有些『難明難了』的吧!舉個例子來說,我們都知道『地球自轉』產生了太陽的『東升西落』,也學過牛頓力學所講的『慣性系統』,可是我們並不感覺地球在自轉的啊!一八五一年二月法國物理學家『萊昂‧傅科』Jean Bernard Léon Foucault 首度次在『巴黎天文台』的子午儀室公開展示了一的『單擺』。幾星期之後,傅科他又在『巴黎先賢祠』的拱頂下,用一根長六十七公尺的鋼索,其下懸掛了一顆重二十八公斤的鉛錘,然後使之擺動。這個單擺的『擺動平面』它每小時順時針方向旋轉 11° 度,經三十點七小時後環繞一圈。這就是大名鼎鼎的『傅科擺』 Foucault pendulum ,它的旋轉角速度 \omega 與『緯度\varphi 成正比,可以表示為 \omega=360\sin\varphi\ ^\circ/\mathrm{day}

,此處,『北緯』角度為『』,表示『順時針方向旋轉』。據聞一八五五年,這個單擺被移到了國立巴黎工藝技術學院之國立工藝博物館。然後在二零一零年四月六日,國立工藝博物館內懸掛鉛錘的鋼索不知何故斷裂,使得單擺和博物館的大理石地板都受到無法修補的損壞。或許自傅科擺第一次以簡單的實驗證明『地球自轉』以來,這個擺已經善盡了『告知大眾』的『義務』的吧!!

─── 引自《水的生命!!下

 

 

 

 

 

 

 

 

 

 

勇闖新世界︰ W!o《卡夫卡村》變形祭︰感知自然‧尖端‧八

雖然還想多花些時間參觀湖心小築,深入的了解這東西北『水』之三相館,或及『模擬館』和『學習營』之建制。不過就在 Mrphs 的告知與催促下不得不趕路前往那《卡夫卡村》變形祭開始前之盛大的遊行的耶??此刻抉擇有如《物理哲學·下中…》所言︰

禮記‧禮運篇

故聖人耐【能】以天下為一家,以中國為一人者,非意【測】之也,必知其情,辟【開】於其義,明於其利,達於其患,然後能為之。

何謂人情喜、怒、哀、懼、愛、惡、欲,七者,弗學而能。何謂人義?父慈、子孝、兄良、弟弟、夫義、婦聽、長惠、幼順、君仁、臣忠,十者,謂之人義。講信脩睦,謂之人利爭奪相殺,謂之人患。故聖人之所以治人七情,脩十義,講信脩睦,尚辭讓,去爭奪,舍禮何以治之?飲食男女,人之大欲存焉。死亡貧苦,人之大惡存焉。故欲惡者,心之大端也。人藏其心,不可測度也,美惡皆在其心,不見其色也,欲一以窮之,舍禮何以哉?

故人者,其天地之德,陰陽之交,鬼神之會,五行之秀氣也。

天秉陽,垂日星;地秉陰,竅於山川。播五行於四時,和而後月生也。是以三五而盈,三五而闕。五行之動,迭相竭也。五行、四時、十二月,還也。五聲、六律、十二管,還相為也。五味、六和、十二食,還也。五色、六章、十二衣,還也。

故人者,天地之心也,五行之端也,食味、別聲、被色而生者也。故聖人作,則必以天地,以陰陽,以四時,以日星以為鬼神以為五行以為禮義以為人情以為四靈以為。以天地為本,故物可舉也。以陰陽為端 ,故情可睹也。以四時為柄,故事可勸也。以日星為紀,故事可列也。月以為量,故功有藝也。鬼神以為徒,故事有守也。五行以為質,故事可復也。禮義以為器,故事行有考也,人情以為田,故人以為奧也。四靈以為畜,故飲食有由也。何謂四靈?麟、鳳、龜、龍,謂之四靈。故龍以為畜,故魚鮪不淰。鳳以為畜,故鳥不獝。麟以為畜,故獸不狘。龜以為畜,故人情不失。

當白努利提出了一個理論來解釋『聖彼得堡悖論』時,就開啟了『效用』 Utility 的大門︰

邊際效用遞減原理】:一個人對於『財富』的擁有多多益善,也就是說『效用函數U(w) 的一階導數大於零 \frac{dU(w)}{dw} > 0;但隨著『財富』的增加,『滿足程度』的積累速度卻是不斷下降,正因為『效用函數』之二階導數小於零 \frac{d^2U(w)}{dw^2} < 0

最大效用原理】:當人處於『風險』和『不確定』的條件下,一個人『理性決策』的『準則』是為著獲得最大化『期望效用』值而不是最大之『期望金額』值。

Utility』依據牛津大字典的『定義』是︰

The state of being useful, profitable, or beneficial:
(In game theory or economics) a measure of that which is sought to be maximized in any situation involving a choice.

如此『效用』一詞,不論代表的是哪種『喜好度』 ── 有用 useful 、有利 profitable 、滿足 Satisfaction 、愉快 Pleasure 、幸福 Happiness ──,都會涉及主觀的感覺,那麼真可以定出『尺度』的嗎?『效用函數』真的『存在』嗎??

170px-Pakkanen
溫度計
量冷熱

魯班尺
魯班尺
度吉凶

一九四七年,匈牙利之美籍猶太人數學家 ,現代電腦創始人之一。約翰‧馮‧諾伊曼 Jhon Von Neumann 和德國-美國經濟學家奧斯卡‧摩根斯特恩 Oskar Morgenstern 提出只要『個體』的『喜好性』之『度量 』滿足『四條公設』,那麼『個體』之『效用函數』就『存在』,而且除了『零點』的『規定』,以及『等距長度』之『定義』之外,這個『效用函數』還可以說是『唯一』的。就像是『個體』隨身攜帶的『理性』之『溫度計』一樣,能在任何『選擇』下,告知最大『滿意度』與『期望值』。現今這稱之為『期望效用函數理論』 Expected Utility Theory。

由於每個人的『冷熱感受』不同,所以『溫度計』上的『刻度』並不是代表數學上的一般『數字』,通常這一種比較『尺度』只有『差距值』有相對『強弱』意義,『數值比值』並不代表什麼意義,就像說,攝氏二十度不是攝氏十度的兩倍熱。這一類『尺度 』在度量中叫做『等距量表』 Interval scale 。

溫度計』量測『溫度』的『高低』,『理性』之『溫度計』度量『選擇』的『優劣』。通常在『實驗經濟學』裡最廣泛採取的是『彩票選擇實驗』 lottery- choice experiments,也就是講,請你在『眾多彩票』中選擇一個你『喜好』 的『彩票』。

這樣就可以將一個有多種『機率p_i,能產生互斥『結果A_i 的『彩票L 表示成︰

L = \sum \limits_{i=1}^{N} p_i A_i ,  \  \sum \limits_{i=1}^{N} p_i  =1,  \ i=1 \cdots N

如此『期望效用函數理論』之『四條公設』可以表示為︰

完整性公設】Completeness

L\prec MM\prec L,或 L \sim M

任意的兩張『彩票』都可以比較『喜好度』 ,它的結果只能是上述三種關係之一,『偏好 ML\prec M,『偏好 LM\prec L,『無差異L \sim M

遞移性公設】 Transitivity

如果 L \preceq M,而且 M \preceq N,那麼 L \preceq N

連續性公設】 Continuity

如果 L \preceq M\preceq N , 那麼存在一個『機率p\in[0,1] ,使得 pL + (1-p)N = M

獨立性公設】 Independence

如果 L\prec M, 那麼對任意的『彩票N 與『機率p\in(0,1],滿足 pL+(1-p)N \prec pM+(1-p)N

對於任何一個滿足上述公設的『理性經紀人』 rational agent ,必然可以『建構』一個『效用函數u,使得 A_i \rightarrow u(A_i),而且對任意兩張『彩票』,如果 L\prec M \Longleftrightarrow \  E(u(L)) < E(u(M))。此處 E(u(L)) 代表對 L彩票』的『效用期望值』,簡記作 Eu(L),符合

Eu(p_1 A_1 + \ldots + p_n A_n) = p_1 u(A_1) + \cdots + p_n u(A_n)

它在『微觀經濟學』、『博弈論』與『決策論』中,今天稱之為『預期效用假說』 Expected utility hypothesis,指在有『風險』的情況下,任何『個體』所應該作出的『理性選擇』就是追求『效用期望值』的『最大化』。假使人生中的『抉擇』真實能夠如是的『簡化』,也許想得到『快樂』與『幸福』的辦法,就清楚明白的多了。然而有人認為這個『假說』不合邏輯。一九五二年,法國總體經濟學家莫里斯‧菲力‧夏爾‧阿萊斯 Maurice Félix Charles Allais ── 一九八八年,諾貝爾經濟學獎的得主 ── 作了一個著名的實驗,看看實際上人到底是怎麼『做選擇』的,這個『阿萊斯』發明的『彩票選擇實驗』就是大名鼎鼎的『阿萊斯悖論』 Allais paradox 。

───

 

到底『機會』跟『風險』能不能有個『計算』的哩!!

 

 

 

 

 

 

 

 

 

 

勇闖新世界︰ W!o《卡夫卡村》變形祭︰感知自然‧數據分析‧八下

假使我們再次回到

勇闖新世界︰ W!o《卡夫卡村》變形祭︰感知自然‧溼度》文本中所提之『溫度平均』議題︰

Raspberry Pi Learning Resources

Temperature

The Sense HAT features a number of sensors, including a temperature sensor.

The image above shows a clinical thermometer. You may have been asked to place one in your mouth when you’ve been ill. Notice that the numbers start at 35, so it’s only used for measuring human body temperature. The Sense HAT temperature sensors can measure temperatures from as low as -40 degrees Celsius up to +120 degrees Celsius though, so they are much more versatile than a clinical thermometer. The Sense HAT has two temperature sensors. One is built into the humidity sensor and the other is built into the pressure sensor. You can choose which one to use, or you could use both and average the result.

───

『溫度』文本,所謂『平均』的說法是否『合適』的呢?這又該用什麼『原則』來判斷的耶??

【用什麼度量溫度?】

pi@raspberrypi ~ sudo python3 Python 3.2.3 (default, Mar  1 2013, 11:53:50)  [GCC 4.6.3] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from sense_hat import SenseHat >>> 感測 = SenseHat()  # 壓力計量溫度 >>> 溫度_壓力計 = 感測.get_temperature_from_pressure() >>> print("溫度: %s C" % 溫度_壓力計) 溫度: 30.652084350585938 C >>> 壓力 = 感測.get_pressure() >>> print("壓力: %s Millibars" % 壓力) 壓力: 1008.718994140625 Millibars  # 溼度計量溫度 >>> 溫度_溼度計 = 感測.get_temperature_from_humidity() >>> print("溫度: %s C" % 溫度_溼度計) 溫度: 30.774192810058594 C >>> 溼度 = 感測.get_humidity() >>> print("溼度: %s %%rH" % 溼度) 溼度: 70.17244720458984 %rH >>>  </pre> ───     <span style="color: #808000;">不知讀者是否已經有了答案的呢??僅就比較</span>  <span style="color: #808080;">【壓力之溫度感測器】︰ 0 - 65^{\circ}  C \  \pm 2^{\circ} C</span>  <span style="color: #808080;">【溼度之溫度感測器】︰ 0 - 60^{\circ}  C \  \pm 1^{\circ} C</span>  <span style="color: #808000;">準確度而言,這個『平均』的作法恐怕是無攸利的吧!或知在相對溼度的量測中,溫度是個重要的因子乎!!因此必須考慮它的影響 ,所以工廠的『校準』方才會有這麼大的一張表︰</span>  <a href="http://www.freesandal.org/wp-content/uploads/Humidity-Temperature-data-conversion.png"><img class="alignnone size-full wp-image-42450" src="http://www.freesandal.org/wp-content/uploads/Humidity-Temperature-data-conversion.png" alt="Humidity-Temperature-data-conversion" width="988" height="1194" /></a>  <span style="color: #808000;"> </span>  <span style="color: #808000;">那麼什麼是『<a style="color: #808000;" href="https://zh.wikipedia.org/zh-tw/%E6%A0%A1%E5%87%86">校準</a>』 <a style="color: #808000;" href="https://en.wikipedia.org/wiki/Calibration">Calibration</a> 的呢?維基百科的詞條講︰</span>  <b>Calibration</b> is process of finding a relationship between two unknown (when the measurable quantities are not given a particular value for the amount considered or found a standard for the quantity) quantities. When one of quantity is known, which is made or set with one device, another measurement is made as similar way as possible with the first device using a second device.The measurable quantities may differ in two devices which are equivalent. The device with the known or assigned correctness is called the <a title="Standard (metrology)" href="https://en.wikipedia.org/wiki/Standard_%28metrology%29">standard</a>. The second device is the <a title="Device under test" href="https://en.wikipedia.org/wiki/Device_under_test">unit under test</a>, test instrument, or any of several other names for the device being calibrated.  The formal definition of calibration by the <a title="International Bureau of Weights and Measures" href="https://en.wikipedia.org/wiki/International_Bureau_of_Weights_and_Measures">International Bureau of Weights and Measures</a> is the following: "Operation that, under specified conditions, in a first step, establishes a relation between the quantity values with measurement uncertainties provided by measurement standards and corresponding indications with associated measurement uncertainties (of the calibrated instrument or secondary standard) and, in a second step, uses this information to establish a relation for obtaining a measurement result from an indication."<sup id="cite_ref-metrology_terms_1-0" class="reference"><a href="https://en.wikipedia.org/wiki/Calibration#cite_note-metrology_terms-1">[1]</a></sup>  <a href="http://www.freesandal.org/wp-content/uploads/Avery_postal_scale.jpg"><img class="alignnone size-full wp-image-42493" src="http://www.freesandal.org/wp-content/uploads/Avery_postal_scale.jpg" alt="Avery_postal_scale" width="170" height="257" /></a>  An example of a device whose calibration is off: a <a title="Weighing scale" href="https://en.wikipedia.org/wiki/Weighing_scale">weighing scale</a> that reads ½ ounce without any load.  ───     <span style="color: #808000;">簡單的說就是︰選擇已知『精準度』的 □□ 物理量之量測儀器為『標準』,在相同的條件下,用其對此 □□ 物理量之『度量值』作『基礎』,建立其與『待校正設備』對這同一 □□ 物理量之 ○○ 『量測值』的『數值關係』。這個  ○○ 『量測值』就是由該設備之『量測方法』所決定的。比方說︰</span>  <span style="color: #808000;">【壓力感測器用電阻】</span>  <a href="http://www.freesandal.org/wp-content/uploads/基本壓力感測器構造.png"><img class="alignnone size-full wp-image-41373" src="http://www.freesandal.org/wp-content/uploads/基本壓力感測器構造.png" alt="基本壓力感測器構造" width="517" height="541" /></a>     <span style="color: #808000;">【溼度感測器用電容】</span>  <a href="http://www.freesandal.org/wp-content/uploads/溼度感測器工作原理.png"><img class="alignnone size-full wp-image-41984" src="http://www.freesandal.org/wp-content/uploads/溼度感測器工作原理.png" alt="溼度感測器工作原理" width="1076" height="640" /></a>     <span style="color: #808000;">若是 □□ 物理量與 ○○ 物理量之間是『線性關係』</span> \Box = \alpha \cdot \bigcirc + \beta<span style="color: #808000;">,那麼一般可用『兩點』來作校正。如果『量測模型』是『非線性 』的,就得作『多點』校準的了。由於『微機電』裝置的『尺寸』很小,因此 ○○ 物理量 ── 舉例講,電阻或電容 ── 也就非常的小。所以『製造』與『度量』之『精準要求』極高。或可說明那個 ADC 的『 bit 數』為什麼得很大的耶??要是從『標準差』來看 </span>\sigma_{\Box} = \alpha \cdot \sigma_{\bigcirc}<span style="color: #808000;">,也可明白最終『精準度』怎麼會沒有那麼高的了!!</span>  <span style="color: #808000;">如是以《 <a style="color: #808000;" href="https://www.raspberrypi.org/learning/getting-started-with-the-sense-hat/worksheet/">Sensing the environment</a> 》範例中的某部份意譯來看︰</span> <pre class="lang:sh decode:true">pi@raspberrypi ~ python3
Python 3.4.2 (default, Oct 19 2014, 13:31:11) 
[GCC 4.9.1] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from sense_hat import SenseHat
>>> 感測 = SenseHat()
>>> 溫度 = 感測.get_temperature()
>>> 壓力 = 感測.get_pressure()
>>> 溼度 = 感測.get_humidity()

>>> 溫度 = round(溫度, 1)
>>> 壓力 = round(壓力, 1)
>>> 溼度 = round(溼度, 1)

>>> print(溫度, 壓力, 溼度) 
27.9 1017.3 67.5
>>> 

 

,恐怕仍舊是不符合『有效數字』之科學記數法者也。

 

 

 

 

 

 

 

 

 

 

 

勇闖新世界︰ W!o《卡夫卡村》變形祭︰感知自然‧數據分析‧八上

當我們量測一個『物理量』之時,為什麼需要知道『測量方法』的呢?事實上,如果能夠建立『模型』,還可以現象『模擬』更好!因為如此就先知道『待測量』與『理論值』之間的關係,如是也曉得並分析了『精準度』之範圍耶!!所以必須明白『感測器原理』乎??

【壓力量測】

基本壓力感測器構造

【溼度量測】

溼度感測器工作原理

 

因而得以『解讀』感測器之『數據表』 data sheet ︰

【壓力感測器數據表】

Mechanical-Specification

 

【校正】

factory-calibration

 

【濾波‧補償】

hardware-filter

 

【溼度感測器數據表】

Humidity-Specification

 

【校正】

Humidity-factory-calibration

 

【線性化處理】

Humidity-Temperature-data-conversion

 

Humidity-temperature

 

嫻熟『科學記數法』之『應用實務』的了??!!

Scientific notation

Normalized notation

Any given integer can be written in the form m×10n in many ways: for example, 350 can be written as 3.5×102 or 35×101 or 350×100.

In normalized scientific notation, the exponent n is chosen so that the absolute value of m remains at least one but less than ten (1 ≤ |m| < 10). Thus 350 is written as 3.5×102. This form allows easy comparison of numbers, as the exponent n gives the number’s order of magnitude. In normalized notation, the exponent n is negative for a number with absolute value between 0 and 1 (e.g. 0.5 is written as 5×10−1). The 10 and exponent are often omitted when the exponent is 0.

Normalized scientific form is the typical form of expression of large numbers in many fields, unless an unnormalized form, such as engineering notation, is desired. Normalized scientific notation is often called exponential notation—although the latter term is more general and also applies when m is not restricted to the range 1 to 10 (as in engineering notation for instance) and to bases other than 10 (as in 3.15× 220).

Engineering notation

Engineering notation (often named “ENG” display mode on scientific calculators) differs from normalized scientific notation in that the exponent n is restricted to multiples of 3. Consequently, the absolute value of m is in the range 1 ≤ |m| < 1000, rather than 1 ≤ |m| < 10. Though similar in concept, engineering notation is rarely called scientific notation. Engineering notation allows the numbers to explicitly match their corresponding SI prefixes, which facilitates reading and oral communication. For example, 12.5×10−9 m can be read as “twelve-point-five nanometers” and written as 12.5 nm, while its scientific notation equivalent 1.25×10−8 m would likely be read out as “one-point-two-five times ten-to-the-negative-eight meters”.

Significant figures

A significant figure is a digit in a number that adds to its precision. This includes all nonzero numbers, zeroes between significant digits, and zeroes indicated to be significant. Leading and trailing zeroes are not significant because they exist only to show the scale of the number. Therefore, 1,230,400 usually has five significant figures: 1, 2, 3, 0, and 4; the final two zeroes serve only as placeholders and add no precision to the original number.

When a number is converted into normalized scientific notation, it is scaled down to a number between 1 and 10. All of the significant digits remain, but the place holding zeroes are no longer required. Thus 1,230,400 would become 1.2304 × 106. However, there is also the possibility that the number may be known to six or more significant figures, in which case the number would be shown as (for instance) 1.23040 × 106. Thus, an additional advantage of scientific notation is that the number of significant figures is clearer.

Estimated final digit(s)

It is customary in scientific measurements to record all the definitely known digits from the measurements, and to estimate at least one additional digit if there is any information at all available to enable the observer to make an estimate. The resulting number contains more information than it would without that extra digit(s), and it (or they) may be considered a significant digit because it conveys some information leading to greater precision in measurements and in aggregations of measurements (adding them or multiplying them together).

Additional information about precision can be conveyed through additional notations. It is often useful to know how exact the final digit(s) are. For instance, the accepted value of the unit of elementary charge can properly be expressed as 1.602176487(40)×10−19 C,[1] which is shorthand for (1.602176487±0.000000040)×10−19 C

………

 

 

 

 

 

 

 

 

勇闖新世界︰ W!o《卡夫卡村》變形祭︰感知自然‧數據分析‧七

為什麼用『區間不等式』表達的『誤差 = 量測值 – 真值』

X_{min} \leq X_{true} \leq X_{max}

interval-method

會和『 robust 』健壯一詞扯上關係呢?需知許多『物理現象』可能存在『臨界點』,那時『量測值』的微小誤差,對『臨界現象』之『真值』或『理論值』來講,可就結果大不同的了!俗話說︰壓垮駱駝的最後一根稻草。並非這根草有什麼本事,只恰好是那駱駝再不可承受之『輕』的吧!!也許一段有關『可靠性』文本足以回答的耶??

宇宙是否壽命』?會成住壞空的道?目前的科學尚在爭論是冷死』、『熱死』或是『漲縮間振盪』??祇是就『可信不可信』而言,這世間果真有一個試金石』?果有之,這個『試金石可信嗎人要是能知當是自然能知要是乾坤未賦于可知之理,人又將怎知?只不過對於科學上所有『不論』之事,或有人就『存而不論』或有人能『自了自解』,就任之於『奧秘』的『不可說』之中吧!!

350px-Bathtub_curve.svg

260px-Neonatal_Death

磨损曲線

在現今的科學與工程上倒是有一個『可靠信』的理論,有一條稱作『浴盆曲線』的圖。說道這條曲線的來源之一,頗令人感傷,它來自對於『新生兒』的『死亡率』之觀察,『出生』的『前三個月』和『後一個月』是『存亡』的關鍵期,絕大多數的『早夭』都發生在這之前,然後進入『常態階段。工廠生產『□□』為什麼需要『熱機測試 Burn In Test,就是因是之故。另一源自研究東西的『老化』磨耗,論及正常』或『異常使用狀況,反映出不同的『故障率』。結合這兩條曲線就得到所說的那條浴盆曲線了。

圖示於左。

現在的用眼』『用耳過度;飲食的『口味』又太重,或許該想想這樣做,難道就真的是沒『後果』的嗎?也許老子道德經》中的一段話,頗值得今人來思考
第十二章

五色令人目盲五音令人耳聾五味令人口爽馳騁畋 ㄊㄧㄢˊ獵,令人心發狂;難得之貨,令人行妨。是以聖人為腹不為目,故去彼取此

cat-machine1

cat-mach2small

一般物理學中只講『線性系統』,是因為它的數學比較簡單,用之於大多數事物又能『相當符合』的緣故。那什麼是線性系統呢?它是說如果『甲因』產甲果』,『乙因』產乙果』;那麼『甲乙和因』就產生『甲乙果之和』。然而自然之大,當然不是線性可以『窮盡』的。英國的 Christopher Zeeman 爵士一生致力於宣說『非線性』現象,宣講『巨變理論』Catastrophe Theory。他還為此特別建造了一個『突變機』,以方便學生理解巨變』是如何發生。美國的 Drexel 大學有一個塞曼突變機的 Flash 演示網頁,有興趣的讀者可以到那裡去玩一玩。

這個『突然變化』的理論,正理解『橋樑』為何斷裂』,又怎是此時的科學說明。常常有一種天真』的想法 ,以為人事物『昨天』如此,『今天』也如此;『明天』『必然 如此事實上,明天只能或然如此的吧!!同時這個理論也補足講解了『老化曲線的『死亡點』將『在那裡』等著結束這條曲線,終將不可能一直持續磨耗,定然會有一個壽限!!

─── 引自《目盲與耳聾

 

雖說現今微機電感測器已經可以量測許多『物理量』︰

Table 8.4 List of mechanical measurands. Adapted from Gardner (1994)

mechanical-measurands

 

即使再加上已知的各種『換能器』︰

424px-Signal_processing_system

換能器』 Transducer 是轉換不同『能量形式』的『裝置』,這些能量形式包括了『電能』、『機械能』、『電磁能』、『光能』、『化學能』、『聲能』和『熱能』等等,或許很快將擴及『生化能』與『生物能』種種。雖然現今這個『術語』一般使用在『感測器』 Sensor 上,常用於『測量儀錶』的領域中。從事實上來講『換能器』的『概念』來自於『自然現象』裡,無所不在的各式各樣的『能量交換形式』。就像人類的『五官』以及各類生物的『感覺器官』都需要與『大自然』環境中的『聲、光、臭、味、溫度、壓力…』打交道,才能夠『探得』環境中的『資訊』維持『物種延續』一樣。也可以說『生物界』本身就是換能器之『自然設計』的『大教室』,有人把仿效『自然生物』設計的『學問』稱之為『仿生學』,果真如老子所言︰人法地,地法天,天法道,道法自然的啊!!

在那個還不了解『電是什麼』 的時代,當然也不會有『量測電』的『儀器』,更不會有穩定供電的『電源』存在,於是即使如『卡文迪什』之『聰慧』,或許也只可能用『自然之身』去『感測』那『電容器』放電之『衝擊』大小來『揣度』物理上『電荷量』度量的『定量』基準,因是之故縱使他已失去了『科學實驗』的『基本要求』── 人人可重覆之驗證性與精準性 ──,然而即使想要不如此去『度量』,他又能夠如何『』的呢??所以也就可以說『伏打電堆』的發明對『電學』的重要性,這或許也正是『電壓』的『單位』要叫做『伏特』 Volt 的原因。

─── 引自《【Sonic π】電聲學補充《一》

 

還是有許多的『物理量』依舊無法直接量測。因此『誤差傳播』之計算仍然是少不了。由於《實驗數據的處理與分析》文本已經言之甚詳︰

誤差傳遞:

      經常一個物理量 是經由測量 數個 物理量,再藉由 關係式 計算而得出。

例如:動量是由測量值 質量與速度相乘而得(速度又由位移與時間測量值得出)。

          當測量時,質量、位移與時間的個別誤差 將影響最後結果的誤差。

假設 X 代表某一個物理量,由

      等測量值所決定。

即 

而以 分別代表等分量 樣本分佈的平均值。

則 平均值 

對於某一組測量樣本數據,可以表示為 

測量值的方差

其中

而 稱為 協方差(corvarance)。

如果 u 和 v (測量物理量)彼此不相關,則 協方差為零。

(通常 測量時的個別參數間是互不相干的)

於是 方差可以簡化為 

……

 

此處也就不再贅述的了。