Electrostatic wallpaper

Discussion in 'Physics' started by bretm, May 7, 2012.

  1. bretm

    Thread Starter Member

    Feb 6, 2012
    152
    24
    My Saturday project...rendering 2D electrostatic configurations.

    Full resolution: http://i.imgur.com/WluC1.jpg

    • Point charges are all of equal magnitude but mixed polarity, net charge of zero overall.
    • Field "lines" are yellow with brightness increasing logarithmically with field strength.
    • Equipotential lines are blue near the chosen 0V point (at infinity), shading toward red for one polarity and green for the other polarity. The red and green mix with the bright yellow field lines near the charges to make orange and yellow/green.
    • Charge locations are red and black dots to evoke red and blue colors of common DC power supply connections.
    • Scale is arbitrary (could be small charges close together or large charges far apart).
     
  2. StayatHomeElectronics

    Well-Known Member

    Sep 25, 2008
    864
    40
    Nice. What did you use to generate the picture?
     
  3. bretm

    Thread Starter Member

    Feb 6, 2012
    152
    24
    A program I wrote using C#, attached.
     
  4. strantor

    AAC Fanatic!

    Oct 3, 2010
    4,302
    1,988
    That's awesom but I have no idea what it is. By wallpaper, I assume you mean a computer desktop image? Or do you literally mean wallpaper on a wall? Are the patterns random? What I mean is, did you have a pattern in mind, and you wrote a program to achieve that pattern, or was the end result something that you never visualized?
     
  5. bretm

    Thread Starter Member

    Feb 6, 2012
    152
    24
    It's just a computer desktop image.

    The specific position of each charge is random, but limited to being inside a circle.

    The general design was intentional, but the color scheme, etc., was worked out over several iterations of looking at the results. For example, originally I used blue for all of the equipotential lines, but then I wanted to be able to visually trace the "0V" line all the way through the obstacle course of charges, so I used different color for positive vs. negative voltages.

    And obviously I didn't know ahead of time exactly where the equipotential lines would end up. I just had a general sense of the kinds of patterns they would produce.
     
    strantor likes this.
  6. StayatHomeElectronics

    Well-Known Member

    Sep 25, 2008
    864
    40
    That is really nice. When I get a few minutes, I will definitely browse through the code. Thanks!
     
  7. bretm

    Thread Starter Member

    Feb 6, 2012
    152
    24
    Then I suppose I should add comments. :) (attached)
     
  8. StayatHomeElectronics

    Well-Known Member

    Sep 25, 2008
    864
    40
    Thanks. That will make it a bit easier to browse.
     
  9. bretm

    Thread Starter Member

    Feb 6, 2012
    152
    24
    I've animated this, and I'm working on a screen-saver implementation. I posted a crappy Youtube-quality video at http://youtu.be/8JpwAKE69BM in which the field lines are totally wiped out from their compression.

    I implemented it in a pixel shader so it runs in real-time at 60fps+ in HD quality. I will post the Windows screen-saver and XNA source code (if I ever finish it :)).
     
    MvGulik likes this.
Loading...