Technology

Geiger–Müller counter simulation

A Geiger-Muller (GM) counter is an instrument for detecting and measuring ionizing radiation. It operates by using a Geiger-Muller tube filled with gas, which becomes ionized when radiation passes through it. This ionization produces an electrical pulse that is counted and displayed, allowing users to determine the presence and intensity of radiation.

Svjo-2, CC BY-SA 3.0, via Wikimedia Commons

This simulation (find it at https://physicstjc.github.io/sls/gm-counter) allows students to explore the random nature of radiation and the significance of accounting for background radiation in experiments. Here’s a guide to help students investigate these concepts using the simulation.

Exploring Background Radiation

Q1: Set the source to “Background” and start the count. Observe the count for a few minutes. What do you notice about the counts recorded?

A1: The counts recorded are relatively low and vary randomly. This reflects the background radiation which is always present.


Q2: Why is it important to measure background radiation before testing other sources?

A2: Measuring background radiation is important to establish a baseline level of radiation. This helps in accurately identifying and quantifying the additional radiation from other sources.


Investigating a Banana as a Radiation Source

Q3: Change the source to “Banana” and reset the data. Start the count and observe the readings. How do the counts from the banana compare to the background radiation?

A3: The counts from the banana are higher than the background radiation. This is because bananas contain a small amount of radioactive potassium-40.


Q4: How do the counts per minute (CPM) for the banana vary over time? Is there a pattern or do the counts appear random?

A4: The counts per minute for the banana vary over time and appear random, reflecting the stochastic nature of radioactive decay.


Exploring a Cesium-137 Source

Q5: Set the source to “Cesium-137” and reset the data. Start the count and observe the readings. How do the counts from Cesium-137 compare to both the background radiation and the banana?

A5: The counts from Cesium-137 are significantly higher than both the background radiation and the banana. This is because Cesium-137 is a much stronger radioactive source.


Q6: What do the counts per minute (CPM) tell you about the intensity of the Cesium-137 source compared to the other sources?

A6: The CPM for Cesium-137 is much higher, indicating a higher intensity of radiation compared to the background and banana sources.


Understanding the Random Nature of Radiation

Q7: By looking at the sample counts, can you predict the next count value? Why or why not?

A7: No, you cannot predict the next count value because radioactive decay is a random process. Each decay event is independent of the previous ones.


Q8: How can you use the background radiation measurement to correct the readings from the banana and Cesium-137 sources?

A8: You can subtract the average background CPM from the CPM of the banana and Cesium-137 sources to get the corrected readings, isolating the radiation from the specific sources.


Graphical Representation of Waves

Use the quiz below to test your ability to interpret graphs of waves. You can click on a point in the map to read the values.

The codes for this quiz are generated by AI. However, the options and correct answers are rule-based and as such, should not have any errors.

It is able to randomly select from 4 different questions for displacement-distance graphs and 4 others for displacement-time graphs, while randomising the values of amplitude, wavelength and period.

Creating physics interactive simulations with generative AI

Shared during the East Zone Physics EdTech Workshop 6 Aug 2024

The hands-on workshop for Physics teachers will focus on the use of generative AI to create physics simulations without the user having to write code. The collection of the apps made using AI can be accessed here and the github repository here. This deck of slides is made available here for the participants’ reference. The sample prompts that we will be using can be found at the bottom of this page.

The sample app that we hope the participants can produce will look something like this:

For your convenience, you may refer to the steps below.

STEP 1:

Open ChatGPT or any other GAI (e.g. Claude, CoPilot, Gemini)

STEP 2:

Copy these instructions and paste them into the AI.

  1. Put all the codes in one page.
  2. Create a canvas showing a ball dropped from rest from a height and bouncing off the ground using javascript.
  3. Using the plotly library, plot the graph of velocity versus time for the ball. The time of contact with the ground is negligible.​
  4. Create an input box that allows the user to key in the initial height in metres.​
  5. Create a slider that changes the percentage energy loss after every collision with the ground.
  6. Create a dropdown menu that changes the vertical axis to velocity or displacement.
  7. Initialise the animation and graph upon loading. Use a button to start and stop the animation.

STEP 3:

Copy the generated code using the button provided.

STEP 4:

Paste into editor here:


“Run in New Tab” to view and test the app. Download the html file once you are happy with it, or if you would like to add media objects such as images and audio.

STEP 5:

Be prepared to generate 10 or more versions! Repeat STEPS 3-4.

Debugging Options:

  1. Change the code manually yourself.
  2. Describe any unexpected behaviour / missing component to AI.
  3. Ask AI to try a new approach (usually after a few failed iterations).
  4. To save time, just ask AI to generate the codes that need to be changed. It will tell you where to update.

STEP 6:

Make the app look pretty!

  1. Optimise for SLS by asking AI to “limit the entire page to a size of max width 580px and max height: 460px”
  2. Ask AI to beautify the app with styling.
  3. Ask AI to add image / video / audio files into the code, giving it the filenames, e.g. replace the moving ball with an image of named “ball.png”. This is an example of such an image. You can right-click and “Save as” to save this image file into the same directory as the index.html file.

STEP 7:

To embed into SLS, you will need to copy the code libraries that are used (if any) in a new .js file. The code library is a collection of pre-written code that you can use to perform specific tasks, e.g.

  • plotly.js for continously changing graphs 
  • chart.js for static charts
  • papaparse.js for processing csv data

To make a copy of the file,

  1. Paste the link to the script on browser e.g. https://cdn.plot.ly/plotly-latest.min.js
  2. Save the page using the “Save as” option in the browser and place the file in the same directory as the html file.
  3. Rename the path to the file in this way:

STEP 8:

Download as HTML.
Save file as index.html. This is important for SLS packages as it will automatically load the index.html file by default.

STEP 9:

Zip all the files and upload the zip file into SLS component. Follow the user guide on how to do so: https://www.learning.moe.edu.sg/teacher-user-guide/author/html5-content-development/#uploading-a-html5-zip-file-in-sls

Interactive Graph with Javascript

I was experimenting with using generative AI to create an interactive graph that could be used to amend the animation of a moving particle, for the topic of kinematics. Students are able to move the four points on the velocity time graph to manipulate the movement. I kept the graph to straight lines between each point to keep things simple.

The vertical axis toggles between displacement and velocity. This will be yet another way for students to learn about how the velocity-time graph affects motion. I have found that many students are confused between displacement and velocity. The app’s ability for them to vary the velocity graph and then make predictions of the resulting displacement graph and the movement should be worth the effort.

Custom AI Bots using OpenAI’s Assistant API hosted on Streamlit

I have done a basic version of this Streamlit app earlier in April with the IP3s. As I am preparing for yet another professional sharing, this time with my school’s teachers, this app is revived with a bit of refinement.

During the testing, the dialogue went like this, with the user prompt / input emphasised:

Two balls of different masses but equal volume rest at the back of a truck with a smooth floor. The truck, initially moving at a constant speed, abruptly comes to a stop. Describe how both balls will react.

wHAT IS LIFE (trying to throw the AI off by making irrelevant comments)

Let’s start by identifying the relevant concepts for the problem at hand. The scenario involves two balls of different masses but equal volume in a truck that abruptly stops.

  1. Newton’s First Law of Motion: This law states that an object will remain at rest or in uniform motion in a straight line unless acted upon by an external force.
  2. Inertia: This is the property of an object to resist changes in its state of motion. It is directly related to the mass of the object.
  3. Friction: The problem specifies that the floor is smooth, implying negligible friction.

Let’s consider the implications of these concepts:

  • What happens to objects inside the truck when it abruptly stops, considering Newton’s First Law?
  • How does the smooth floor (negligible friction) affect the motion of the balls?
  • Since the balls have different masses but equal volumes, how does their mass affect their motion?

Can you identify how these concepts apply to the problem?

The metal ball will move faster

Let’s think about this step-by-step.

  1. Newton’s First Law: What does it say about the motion of the balls when the truck stops abruptly?
  2. Smooth Floor: If the floor is smooth and there’s no friction, how does this affect the balls’ motion?
  3. Initial Speed: If both balls were moving at the same speed as the truck, what happens to their speed immediately after the truck stops?

Could you reconsider your answer based on these points?

the metal ball will move faster as it is heavier

Let’s focus on Newton’s First Law of Motion again. It states that an object in motion will stay in motion unless acted upon by an external force.

  1. Initial Speed: Both balls were moving at the same speed as the truck. When the truck stops, what happens to the balls’ motion?
  2. Smooth Floor: With no friction, will the mass of the balls affect their speed immediately after the truck stops?

Think about these points and tell me how the balls will move when the truck stops.

both balls will move forward

Great! You’ve recognized that both balls will move forward due to their inertia.

Now, considering the smooth floor and the fact that both balls were initially moving at the same speed:

  1. Smooth Floor: With no friction, will the balls’ masses affect their speeds immediately after the truck stops?
  2. Equal Volume: Does the volume of the balls have any effect on their motion in this scenario?

What can you conclude about the speeds of the two balls immediately after the truck stops?

they will be the same!

Excellent! You’ve got it.

  1. Newton’s First Law: Both balls will continue moving forward due to their inertia.
  2. Smooth Floor: With no friction, the balls’ masses do not affect their speeds.
  3. Initial Speed: Both balls will continue at the same speed they had when the truck was moving.

Well done! If you have any more questions or need further clarification, feel free to ask.

This is the end of the conversation with the AI bot. I thought the AI managed to keep to the system prompts given.

To prepare for this scaffolding conversation, I gave the AI a knowledge base consisting of the syllabus learning outcomes so that it does not engage at a level beyond the requirements.

The prompts I gave the system were:

You will play the role of a Socratic tutor who will engage the user in a discussion of a specific physics problem:
"Two balls of different masses but equal volume rest at the back of a truck with a smooth floor. The truck, initially moving at a constant speed, abruptly comes to a stop. Describe will both balls will react."

Do not answer the question directly. Referring to the syllabus document, point out the relevant topic and concepts before asking the user if he or she needs further help.

The success criteria are three-fold:
1. The user must recognise that the floor is smooth so there is no friction.
2. The user must be able to tell that both balls will move forward after the truck stops because of their inertia, according to Newton's First Law.
3. Since the floor is smooth and the two balls were initially moving at the same speed, they will also continue with the same speed immediately after the truck stops.

Guide the user toward the success criteria with questions only and never answer for them.

Encourage the user when he/she gives a good response. However, if the user repeatedly gives the wrong answer, give more direct assistance.

In your response, do not use more than 40 words for each point you are trying to make. Keep it succinct.

The advantage of such an AI bot is that I can guide it to provide scaffold without taking away the students’ need to think for themselves. If it were a generic bot, it might simply give the answer right away.

While testing out the prompts, I notice that if I specify the success criteria for the AI, it is able to know when to stop the conversation. This ensures that the student is able to fulfill with all the requirements of the question before putting an end to the conversation.

If anyone is keen to set up such a bot so that students need not sign in to access it, you can fork the codes from my python file: https://github.com/physicstjc/askme/blob/main/assistant.py and edit the display test and images from there. The system prompts are to be edited at https://platform.openai.com/assistants/. Do note that you will need to pay for the use of the API with an OpenAI developer account (different from the ChatGPT plus subscription account). If you are not sure what Assistants are, feel free to try them out at https://platform.openai.com/playground.

After that, you can create a Streamlit account and connecting it to your github account. Create an app there by deploying the python file. Copy the OpenAI API key and the Assistant ID into the app settings in Streamlit, under the “Secrets” section:

OPENAI_API_KEY= "{insert key here}"
assistant_id = "{insert assistant id here}"

If you want to consider no-code approaches to creating your own AI bots, try out Poe.com, SchoolAI.com, Mizou.com or even ChatGPT Plus. Here is a table comparing their costs and pros and cons.