Electrostatic Interaction Sandbox

Project Writeup

Background: 

Charged particles are a fundamental component of our daily lives. Electricity alone is necessary for modern technologies including computers, Zoom, lights, and many others. Despite this significance of charged particles, the physics behind their forces on each other can be esoteric, especially when considering a network of multiple charges.  Because these particles are invisible to the naked eye, they can be overlooked and misunderstood. Our project seeks to shed light on this subatomic world through an interactive simulation that is accessible to all ages.

Goals: 

The primary objective of this sandbox is to provide a way for students first learning about electrostatics to explore and experiment with the Coulombic interactions of charged particles in a simple and enlightening way.  The project can serve as an additional proof of concept of the effectiveness of teaching physics through virtual simulations. 


Overview: 

Using computer science principles and our knowledge from 8.02, we programmed in C# using the Unity game engine an interactive 3D charge particle sandbox that allows users to fully build an environment with spherical charges and see the total coulombic force experienced by each charge in both vector and numerical form.  We also added an unpause feature which unfreezes the charges from their position so that users can easily see the type of motion the attractive and repulsive forces produced from Coulomb’s law produces, albeit disregarding the effects of induced electric and magnetic fields for this model. 


Key Features:

User-Friendly Interface

Coming into the project, we wanted to make sure that it was something that could be used by physics students of any age.  Thus, starting from the main splash screen, the game was designed in a simple and instantly recognizable fashion that could be run on any machine, allowing the learning benefits of the game to be accessible to more students. 

 


Charges: 

The most important physics aspect of our sandbox are the charges.  Every frame, the system iterates through a global array of charges and computes the total Coulomb’s force that would be displayed on each charge using Coulomb's Law and the user set charge values in the Charge Information menu. These force values are then passed to the rest of the system for processing.  




Navigation and Charge Features:

From the start, it was our intention to make this sandbox as simple and customizable as possible.  Thus, we wanted to give users full control to navigate the entire space environment and move charges to wherever they wanted.  

By using the mouse scroll wheel, WASD or the arrow keys, the user can travel forward and backward throughout the world, using the shift key to give the movement a speed boost or the control key to travel up and down instead of forward/back.  By holding the right mouse button, the user can rotate their camera in any direction to look around.

Regarding charges, at any point, the user can drag a charge with the left mouse button to reposition it within the x-y plane of the screen. In addition, the user can drag a charge with the middle mouse button or the left mouse button and the control key to reposition it within the x-z plane, giving the user placement controls in all three directions.   Initially, all charges start in the paused mode.  This means that they do not react to the electric force placed on them by the other charges, instead displaying a line indicating the relative direction and magnitude of the total force on itself.  As the user drags charges around within the world, these force lines automatically update to reflect the current state. By pressing the unpause button in the Charge Information or Build menu or pressing the ‘p’ button while a charge is highlighted, the user can unpause charges, making them physically receive the force the force line was indicating.  While this does accurately reflect the motion of forces produced by Coulomb’s Law in a frictionless environment, we must note that this does not consider any induced electrical or magnetic fields from the moving charges as that was not our main objective for the project. 


Charge Information Menu: 

When a user has a charge selected (indicated by the highlight that appears once a charge is clicked), a Charge Information menu will appear on the screen displaying all of the important information about that charge.  At the top, dynamically updating labels provide quantitative values for the force on the charge in all directions and the total magnitude.  Below that is a slider which enables the user to update the charge value of the spherical charge, receiving a visual color change when the polarity of the charge changes. Finally, the bottom of the menu contains several buttons to further increase the user’s ability to customize the sandbox, including a button to pause and unpause the charge, a button to neutralize the highlighted charge back to 0 Coulombs, and a button to delete the selected charge.

 


Charge Build Mode: 

By pressing the Open Build Menu button on the top left of the screen, the user toggles into build mode, the backbone of the sandbox component of our simulation.  In the top of the Build Menu, the user has the ability to adjust slighters to change the Charge, Radius, and Mass of the spherical charges they are spawning in.  Then, if the Toggle Placement button is on, the user can simply click on the screen and a charge will be generated at that location with the properties the user set.  In the World Settings section, the user has the ability to affect properties related to all charges in the environment, including pausing all charges, unpausing all charges, deleting all charges, and charging all charges to the user set charge. Once the user is done building, they can simply click the Close Build Menu button, to toggle back into select mode and continue exploring.


Reflection:

The sandbox can be found here and be used as a source of instruction, entertainment, or inspiration for future projects. Even with no solid previous knowledge of 3D development in Unity, programming and creating this game was feasible, fun, and a learning experience for both us the creators and for prospective users. Thus, we encourage future students to use their skills and creativity to further experiment with and to develop accurate simulations and instructional tools for any subject of their interest, not limited to physics. 

Comments

Log in with itch.io to leave a comment.

bro o

no