#8 | Move Correctly, 10-Yen Coin! From Simple Model Verification to Animation Output
This article is part of the series here👇.
If you prefer to listen, please play the audio commentary here👇😊
The goal of this series is to theoretically animate the unnatural movement of a 10-yen coin in Kokkuri-san using high school-level mathematics and physics.
Last time, we created an Excel model that can calculate how a 10-yen coin moves (displacement) based on the force applied by a fingertip.
Although the 'force applied by the fingertip' and the 'coefficient of friction' are still zero, the basic Kokkuri-san model is now complete.
However, we haven't checked yet if the numerical values and formulas in the cells have been entered exactly as intended.
Therefore, this time, we will
first perform operation verification of the Excel model (debugging) under simple conditions.
Then, we will try making an animation with Python!
✔︎ Verifying the operation of the Excel model
The task of verifying (debugging) whether the model you created works as intended by inputting simple conditions is essential.
We will verify the Excel model created in the previous article under the following two conditions.
▶ Condition 1: When no one is touching the 10-yen coin
This is the state of the Excel model created in the previous article.
Force applied by fingertip (horizontal direction): Column H is '0' for all time
Force applied by fingertip (downward direction): Column I is '0' for all time
It's the same as no one touching it.
Therefore, the 10-yen coin should not move even as time passes.
It is okay if the displacement (horizontal direction) in column Q remains 0 (zero) throughout.
With this, we have confirmed that there are no paranormal phenomena (calculation errors) where it starts moving on its own.
▶ Condition 2: When the force pushed from the fingertip (horizontal direction) is equal to the mass of the 10-yen coin
Next, please recall the equation of motion derived in #4👇.
That equation of motion is as follows.
$$
\footnotesize
\begin{align*}
\\[0.1pt]
(Horizontal acceleration) = & \tfrac{(Force pushed horizontally from fingertip) - (Frictional force)}{Mass of 10-yen coin} \\[10pt]
(Frictional force) = & (Coefficient of friction) \times (Normal force received from paper) \\[5pt]
& ※Coefficient of friction: To be considered at a later date \\[10pt]
(Normal force received from paper) = & (Gravity) + (Force pushed downward from fingertip)
\end{align*}
$$
Since the coefficient of friction is currently 0 (zero), the frictional force is also 0 (zero), and the equation of motion becomes as follows.
$$
\footnotesize
\begin{align*}
(Horizontal acceleration) = & \tfrac{(Force pushed horizontally from fingertip)}{Mass of 10-yen coin}
\end{align*}
$$
The mass of the 10-yen coin is $${0.0045\ \text{kg}}$$.
Therefore, we enter the same value of 0.0045 for all times into the 'Force pushed from fingertip (horizontal direction)' in column H of the Excel model.
By doing this,
$$
\footnotesize
\begin{align*}
(Horizontal acceleration) = & \ 1
\end{align*}
$$
so when we calculate the velocity (horizontal direction) using this horizontal acceleration, it becomes as follows. ($${t}$$: time)
$$
\footnotesize
\begin{align*}
Velocity (horizontal direction) = & \int (Horizontal acceleration) dt + Initial velocity \\[10pt]
= & \int 1\ dt + 0 \\[10pt]
= & \ t \\[10pt]
\end{align*}
$$
Furthermore, when we calculate the displacement (horizontal direction) using this velocity (horizontal direction), it becomes as follows.
$$
\footnotesize
\begin{align*}
Displacement (horizontal direction) = & \int Velocity (horizontal direction) dt + Initial displacement \\[10pt]
= & \int t\ dt + 0 \\[10pt]
= & \tfrac{1}{2}t^2 \\[10pt]
\end{align*}
$$
Therefore, the displacement at $${t = 1.0}$$ seconds is,
$${x =\tfrac{1}{2} \times 1.0^2 = 0.5\ \text{m}}$$
as shown.
Look at the row in the Excel model where the time in column G is '1.000000', and if the displacement (horizontal) in column Q is ' about 0.5', then it is correct.
Because there are errors in integral calculations in Excel, it will not be exactly 0.5.
However, if there is a mistake in the calculation process, the answer will deviate significantly even under such simple conditions.
If the answer deviates significantly, please take your time and check again to see if there are any mistakes in the settings or the formulas entered in each cell.
✔︎ Try making an animation with Python
Finally, let's try turning the calculation results into an animation using Python.
First, let's start by preparing the calculation results to be animated.
Copy and paste the Excel file you verified, and perform the following tasks.
Please be sure to save the original file carefully.
Input the force (horizontal) pushed from the fingertip
Since I want to move the 10-yen coin, I will input some arbitrary value.
For example, enter the following formula into cell H4 of Excel and copy it to the very bottom.
※Cell G4 represents the 'time' of that row.
=0.02*COS(2*PI()*0.5*G4)Adjust the time granularity
Temporarily change the time step ($${\Delta t}$$) to 0.001 [s].
※Since the changes in the calculated values should be gradual this time, we will calculate at this interval.
The preparation is now complete.
Save the Excel file and be sure to close it.
And now, it is Python's turn.
The complete set of files, including the Python script created for animation output, can be obtained from the download area below 👇.
The contents of the script are very simple.
It just reads the Excel data and draws a 'red circle' representing the 10-yen coin in real-time on the Kokkuri-san board image, like a flipbook.
Detailed explanations of the processing are written carefully in Japanese within the script, so I will omit them here 🙇♂️
Here is the animation created with that Python script👇
The 'red dot' representing the 10-yen coin is sliding smoothly across the Kokkuri-san board!
✔︎ Conclusion
A Kokkuri-san 10-yen coin doesn't move this smoothly.
It moves in a more irregular and awkward way.
Now, if we look back at the process of building the Excel model so far...
There were physical elements for which we only used tentative values, right?
They are the following two:
The force with which the 10-yen coin is pushed by the fingertips
Frictional force (coefficient of friction)
When I tried asking an AI, it gave me a plausible answer: 'If you add frictional force, it will move irregularly.'
But wait a minute.
Frictional force is merely a force that puts a brake on movement. It is not a force that creates new, irregular movement.
Besides, would such a large frictional force really act between a smooth sheet of paper and a 10-yen coin?
If you actually place a 10-yen coin on paper and push it with your fingertips, you'll see that the 10-yen coin moves quite easily.
Unless you consciously press the 10-yen coin against the paper, you don't feel much resistance from friction.
So, next time, we will focus on the other element... The force with which the 10-yen coin is pushed by the fingertips and think about it.
Stay tuned!
🔗 Continue to the next article
If you found this even slightly helpful or
are interested in the continuation,
please consider liking or following,
as it encourages me to create the next article!
Subject: #Kokkuri-san
Theme: #Debug #PostProcessing #Animation #Python
Use Case: #IndependentResearch #Relearning #Relearning #ClassroomMaterial #Physics
Topic: #ILovePhysics #MadeIt
いいなと思ったら応援しよう!
もし具体的に何かのお役に立てたなら、チップで応援していただけると励みになります!
いただいたチップは、今後の活動に使わせていただきます😊