You are browsing as a guest. Sign up (or log in) to start making projects!

MR. ELECTRIC!

  • 3 Devlogs
  • 26 Total hours

I picked up Griffiths Electrodynamics as a gift from my physics teacher this summer, and I've been trying to create a simulator with Matplotlib and NumPy/SciPy. It has taken a lot of passion and hard work, a lot of planning for modes and work with mathematics, and a lot of debugging help from cursor AI. The app displays a one charge and two charge electric field, a gaussian sphere with a calculation of enclosed charge and flux, and a Delta cluster. The app has a few sincere limitations, the vector field has been scaled to be visible, and the Dirac-Delta function was a personal addition, and is purely cosmetic. Future versions will update it, and add more interactive features. To run, simply run Physics.py, the static files provide an html guide of how it works and how to run!

Ship #1 Pending review

I made an electric field simulator. It took about the past two or so months to actually figure out how anything works. It’s designed to help people visualize electric fields when doing electrostatics. It took a long time to learn the HTML, Python and JS to actually code it but I’m proud of the fact that it even exists. Future modes will include more stuff, and I’m happy to get a chance to ship it!

  • 3 devlogs
  • 26h
Try project → See source code →
Open comments for this post

4h 44m 53s logged

Devlog 3: I added the ability to set a probe point on the first three run modes, the probe point will return electric field magnitude at that point, but it will also return the x, y and z components of that magnitude, so that anyone doing electrostatics problems can check their work as well. The graph now takes inputs in nanocoulombs, and it grows when larger inputs are put in, rather than changing the color. Guide and gallery have been updated to include these changes as well. Inputs have also been stacked neatly rather than arrayed one by one. Honest limits: One single color for all the plots, Gaussian mode not yet helpful because it still only contains one charge, and Dirac Delta is still just cosmetic! Future work will fix these!

0
0
9
Open comments for this post

13h 0m 42s logged

It’s been a while since I’ve posted a devlog! This is Mr. Electric updates. I’ve brought the simulator into the html proper with a new simulate page. The code uses python connected to javascript. New features: Smoothed out the html and cleaned up any bugs. Added a simulate.html page where the simulator actually runs using Pyodide. Added dropdown options and menus to input values for the simulator. Future features: Planned expansion of simulator with more probe points, and drag and drop feature for probes. Ability to do actual calculations with the fields, and more dynamic fields that are prettier and smoother. Cleaner html and better style and buttons, including a unified nav style. 
0
0
7
Open comments for this post

8h 33m 15s logged

This is the first devlog for my Mr. Electric project, its a small scale passion project designed to simulate electric fields with user input. I designed it over the span of about eight hours, alongside working the physics problems myself from Griffiths Electrodynamics Fourth Edition. Cursor assisted in debugging the code. The code uses NumPy, SciPy and Matplotlib. There are a few honest limits: I had to scale the arrows so nothing was generated close to the origin, the result was monstrous arrows because of the divide by zero issue. Dirac Delta is furthermore, simply a cosmetic feature. Dirac Delta represents particles, and graphically it is just an infinitely tall spike, I tried to simulate that in 3d and ended up with the current delta cluster. The project contains four run modes, one charge, two charge, Gaussian sphere plus probe and delta cluster. The main issue for this log was simply setting up the functions, and making sure everything worked! Up next is a public demo, more features, and a heatmap to help indicate relative vector strength.

1
0
4

Delete project?

Are you sure you want to permanently delete this project? This action cannot be undone.

All devlogs, followers, and associated data will be removed.

Followers

Loading…