Born2bwire
Diamond Member
- Oct 28, 2005
- 9,840
- 6
- 71
Originally posted by: TecHNooB
Hm. My 2-d fdtd code for maxwell's equations freaks out after several iterations (everything goes to infinity or -infinity). Any idea why this is happening? Just a prod in the right direction will do
I set all the boundaries to E = 0 and set one of the E vectors to a gaussian pulse. The matrices fill up and then blow up lol
Edit: actually, i think it might be a stability criterion. didnt put those in yet. ~_~
Edit2: still blows up
Edit3: Hm.. my magnitudes seem way to high, i wonder why that is O_O
Make sure that it is a single pulse so that you can track it or do a sine wave. For a sine wave, ramp up and down the amplitude at the turn on and turn off so that it is not discontinuous. Does it blow up before it hits the boundaries, at, or after? Calculate the fields by hand and run the code in debugger mode (or have the appropriate cout stuff) and check to see the calculation is correct. Make sure your dx, dy, and dt satisfy the stability conditions (and then reduce them further).
