ラベル polarizer の投稿を表示しています。 すべての投稿を表示
ラベル polarizer の投稿を表示しています。 すべての投稿を表示

2024年2月12日月曜日

数学グラフ計算機Desmosで偏光板アプリを作る

 以前のこのブログ記事で、量子計算に基づく、偏光板のスマホアプリを作成した。
これと同等機能のアプリを、最近知ったDesmos(2D3D数学グラフ計算機)を用いて作成してみた。Desmosの素晴らしさに感嘆!

 ノーコードで(というよりも、宣言的記述だけで)、インタラクティブに動作するアプリが簡単に作れてしまう。例えば、関数の計算式に未定義のパラメータ名が出てくると、そのパラメータを設定するスライダーが自動的に出てくる。それを動かすとパラメータを変化させたアニメーションも簡単に作れる。プログラミングにとらわれず、やりたいことを数学的に記述すれば良い、という感があって嬉しい。

 さらにwebで作成したアプリは、ほとんどそのままスマホアプリのように使うこともできる。
これで、ビジュアライゼーションの強力なツールを身につけられる!

 以下の図1、図2をご覧いただきたい。説明はほとんど不要であろう。
 以下の短いビデオもご覧ください。
 さらに、国際数学アートコンテストもやっていて、楽しく、ためになる。

 なお、上記はDemosの「幾何ツール」と呼ばれるものを使った。この中で、角度θに偏光した光子が軸角度αの偏光板を通過する確率p(θ, α)を使ったいるのだが、その3Dグラフを見たい場合は、別途「3Dgraph」で描いたものを参照できる。以下の例をご覧いただきたく。

2023年5月20日土曜日

A smartphone app reproducing the appearance through polarizers

Abstract
This app shows what it looks like with some polarizers placed between the image and the eye. That is, the polarization angle of the photons emitted from the plane of the image and the axis angles of the polarizers are used to calculate how bright they appear. The mathematical model is fully explained in Prof. Chris Berhardt's book "Quantum Computing for Everyone". This relates the spin of an electron to the polarization of  a photon.

■ Experiments on light using polarizers
A typical experiment is shown in Fig1. When a polarizer with an axis angle of 0° (north direction) is superimposed on another polarizer with an axis angle of 90°, it becomes completely dark as shown in (a). This is because no photons pass through the second polarizer due to the fact that the two directions are perpendicular. However, when a polarizer with an axial angle of 45° is inserted between these two polarizers, the image can be seen to some extent well as shown in (b).

■ A smartphone app that simulates polarizers
We designed a smartphone app that can perfectly reproduce the above mysterious phenomenon, and developed it quickly using MIT App Inventor. Fig.2(a) shows its user interface. On the other hand, Fig.2(b) is the explanation screen of the mathematical model which is the principle of this application. This shows the formula for calculating the probability of a photon passing through a polarizer. This probability is reflected in the transparency of the color. Furthermore, Fig. 3 shows it visually.



The experiments with this app shown in Fig.4(a) and Fig.4(b) correspond to Fig.1(a) and Fig.1(b), respectively. The axis angle of each polarizer can be set with a slider. These results perfectly reproduce the manual experiments shown in Fig. 1(a) and (b). And Fig. 5 shows the observation when the polarization angle θ of the incident photon is changed from 0° to 45°. This result also seems perfectly convincing.

■ Youtube video showing how this app works
The above experiment using this app is published in the following Youtube video:
(the link to the video has been updated, so please click again.)


■ MIT App Inventor program
As mentioned above, this app was efficiently developed with MIT App Inventor. Fig.6 shows its main part. The polarization angle of the incident photon and the angle of the axis of the polarizer determine the probability of the photon passing through it, and determine the color transparency accordingly.

■
 
A little improvement for your enjoyment
You can also change the background image and user interface design to your liking. Fig.7 shows an example.