Author Topic: Electric Field Sim  (Read 6026 times)

0 Members and 1 Guest are viewing this topic.

Offline squidgetx

  • Food.
  • CoT Emeritus
  • LV10 31337 u53r (Next: 2000)
  • *
  • Posts: 1881
  • Rating: +503/-17
  • rawr.
    • View Profile
Electric Field Sim
« on: February 22, 2011, 06:04:07 pm »
So in physics we were supposed to be doing a predict-the-electric-field activity, but instead I decided to spend the time writing a program that could do it for me (Axe). I think it's not too shabby, but if someone could help me fine-tune the accuracy of it a bit? In some situations it behaves oddly. Source (Axe) is in prgmA0E.

Controls:
2nd: place positive charge
Alpha: place neg. charge
Enter: advance scenario
« Last Edit: February 22, 2011, 06:04:43 pm by squidgetx »

Offline Happybobjr

  • James Oldiges
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2325
  • Rating: +128/-20
  • Howdy :)
    • View Profile
Re: Electric Field Sim
« Reply #1 on: February 22, 2011, 07:48:14 pm »
I read electric fan Sim :O

This is much better than an electric fan.

(I think the jumping is because some number keeps wrapping around between 'a really big number' and 0)
School: East Central High School
 
Axe: 1.0.0
TI-84 +SE  ||| OS: 2.53 MP (patched) ||| Version: "M"
TI-Nspire    |||  Lent out, and never returned
____________________________________________________________

Offline Darl181

  • «Yo buddy, you still alive?»
  • CoT Emeritus
  • LV12 Extreme Poster (Next: 5000)
  • *
  • Posts: 3408
  • Rating: +305/-13
  • VGhlIEdhbWU=
    • View Profile
    • darl181.webuda.com
Re: Electric Field Sim
« Reply #2 on: February 22, 2011, 08:59:49 pm »
Wow, this is pretty cool.
What's wrong with it, though?  Is it just he accuracy, or is there something else?
Vy'o'us pleorsdti thl'e gjaemue

Offline Deep Toaster

  • So much to do, so much time, so little motivation
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 8217
  • Rating: +758/-15
    • View Profile
    • ClrHome
Re: Electric Field Sim
« Reply #3 on: February 22, 2011, 09:31:30 pm »
So in physics we were supposed to be doing a predict-the-electric-field activity, but instead I decided to spend the time writing a program that could do it for me (Axe). I think it's not too shabby, but if someone could help me fine-tune the accuracy of it a bit? In some situations it behaves oddly. Source (Axe) is in prgmA0E.

Wow, awesome. Some attraction cases look off, though?
« Last Edit: February 22, 2011, 09:31:36 pm by Deep Thought »




Offline squidgetx

  • Food.
  • CoT Emeritus
  • LV10 31337 u53r (Next: 2000)
  • *
  • Posts: 1881
  • Rating: +503/-17
  • rawr.
    • View Profile
Re: Electric Field Sim
« Reply #4 on: February 23, 2011, 03:23:46 pm »
Ok, I fixed a few of the problems. The program still flips out once a test charge meets with a negative charge (I suspect a divide by 0 leading to a velocity change of 65535, but I haven't been able to fix it). Also I changed the graphics and fixed something that was wrong with one of the formulas before.

Offline ztrumpet

  • The Rarely Active One
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5712
  • Rating: +364/-4
  • If you see this, send me a PM. Just for fun.
    • View Profile
Re: Electric Field Sim
« Reply #5 on: February 23, 2011, 04:12:21 pm »
Make sure to cap the max speed of the vars at whatever you're inflating it to.  That way, it can only move a max of one pixel per frame. :)
Other than that, it looks nice! ;D

Offline Builderboy

  • Physics Guru
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5673
  • Rating: +613/-9
  • Would you kindly?
    • View Profile
Re: Electric Field Sim
« Reply #6 on: February 23, 2011, 06:30:15 pm »
Another thing that might be interesting to make is have you place charges, and then it draws the electric field lines or something :D

Offline Deep Toaster

  • So much to do, so much time, so little motivation
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 8217
  • Rating: +758/-15
    • View Profile
    • ClrHome
Re: Electric Field Sim
« Reply #7 on: February 24, 2011, 10:14:58 am »
Ok, I fixed a few of the problems. The program still flips out once a test charge meets with a negative charge (I suspect a divide by 0 leading to a velocity change of 65535, but I haven't been able to fix it). Also I changed the graphics and fixed something that was wrong with one of the formulas before.

That looks great :D Do the test charges still attract/repel each other? I can't tell from the shot...




Offline squidgetx

  • Food.
  • CoT Emeritus
  • LV10 31337 u53r (Next: 2000)
  • *
  • Posts: 1881
  • Rating: +503/-17
  • rawr.
    • View Profile
Re: Electric Field Sim
« Reply #8 on: February 24, 2011, 03:21:43 pm »
Test charges don't have any effect on each other :P

Offline Deep Toaster

  • So much to do, so much time, so little motivation
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 8217
  • Rating: +758/-15
    • View Profile
    • ClrHome
Re: Electric Field Sim
« Reply #9 on: February 24, 2011, 03:54:35 pm »
Oh, I see. I got confused at first because I thought the first screenshot had only "test charges." Makes sense now :)




Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Electric Field Sim
« Reply #10 on: February 26, 2011, 02:34:16 pm »
This is interesting. I think this could be fun to mess around :D

Offline shmibs

  • しらす丼
  • Administrator
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2132
  • Rating: +281/-3
  • try to be ok, ok?
    • View Profile
    • shmibbles.me
Re: Electric Field Sim
« Reply #11 on: February 26, 2011, 08:02:31 pm »
SQUIDGET!!!
you know what you need to do?
turn this simulator into electric field hockey.
http://phet.colorado.edu/en/simulation/electric-hockey

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Electric Field Sim
« Reply #12 on: February 28, 2011, 07:24:51 pm »
Hmm that sounds cool actually :D

Offline meishe91

  • Super Ninja
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2946
  • Rating: +115/-11
    • View Profile
    • DeviantArt
Re: Electric Field Sim
« Reply #13 on: February 28, 2011, 07:27:58 pm »
I remember playing that in AP Physics last year :P

Very cool simulator though :)
Spoiler For Spoiler:



For the 51st time, that is not my card! (Magic Joke)

Offline Deep Toaster

  • So much to do, so much time, so little motivation
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 8217
  • Rating: +758/-15
    • View Profile
    • ClrHome
Re: Electric Field Sim
« Reply #14 on: March 01, 2011, 08:01:38 pm »
And a suggestion for this one: Having a mode where the test charges interact with each other too.