Hypothesis on Electron and Ion Behavior Inside the Polywell.

Discuss how polywell fusion works; share theoretical questions and answers.

Moderators: tonybarry, MSimon

happyjack27
Posts: 1439
Joined: Wed Jul 14, 2010 5:27 pm

Post by happyjack27 »

i've seem to run into a problem modeling the b-field of particle-particle interatction. when i turn it on all the particles disappear. i'm guessing they their positions become infinit. so why? well at first i was thinking a bug, but now i'm thinking that as a proton and electron get closer they attract each other more and more, so they are going faster and faster, relative to each other, and this makes for a proportionally stronger magnetic field between them. and thus increasingly stronger force.

i looked it up and apparently the answer lies in quantum physics: in acting as a wave a particle can only have a number of discrete wavelengths. to actually collide with the proton an electron would have to have a wavelength exactly equal to the distance between them. but it can't, so it always overshoots. i'm going to try implementing this as a minimum distance between an ion and electron dependant on the charge of the ion.

(curious - i wonder if the quantized energy levels are exactly those energy levels that keep this runaway force problem from happening.)

happyjack27
Posts: 1439
Joined: Wed Jul 14, 2010 5:27 pm

Post by happyjack27 »

got it working now.
i don't have any static electric or magnetic fields yet though,
so all it does is expand. i got 1 part protons 1 part b-11 ions, and 6 parts electrons (to make net neutral). i start everything off with a velocity of zero and a random position, and the electrons just fly off right away, leaving the ions to expand more slowly.

no i've got to write the code for taking a 3-d wireframe of current and using it to apply static e and b fields. to the simulation.

happyjack27
Posts: 1439
Joined: Wed Jul 14, 2010 5:27 pm

Post by happyjack27 »

Tada!

http://www.youtube.com/watch?v=x5zPjqashAc

i've made the protons a little darker blue since i recorded that video 'cause i noticed they were a little hard to differentiate from the borons.

now i can officially say i did something that was pretty cool and had something to show for it. ;)

Will
Posts: 9
Joined: Mon Nov 10, 2008 3:21 am

Post by Will »

happyjack27 wrote:Tada!

http://www.youtube.com/watch?v=x5zPjqashAc

i've made the protons a little darker blue since i recorded that video 'cause i noticed they were a little hard to differentiate from the borons.

now i can officially say i did something that was pretty cool and had something to show for it. ;)
Nice work.

I am actually pretty excited to see what happens when you add in the static B and E fields.

Also as a note: have you considered that (once you do) there might be some value in deleting particles which get sufficiently far away from the static fields (i.e. "outside" the reactor) and birthing some new particles into it to approximate a steady state.

happyjack27
Posts: 1439
Joined: Wed Jul 14, 2010 5:27 pm

Post by happyjack27 »

yes i have. that's stage 3: particle cycling.

and i've actualy thought a little into that already. there's going to be a "loss radius" coming off the wire segments, which is basically the radius of the wire. a particle in that radius is considered lost. also, as you said, too high x^2+y^2+z^2 and it's considered lost. then it's a matter of reseting lost particles to injection points.

happyjack27
Posts: 1439
Joined: Wed Jul 14, 2010 5:27 pm

Post by happyjack27 »


happyjack27
Posts: 1439
Joined: Wed Jul 14, 2010 5:27 pm

Post by happyjack27 »

i was using this: http://cnx.org/content/m31103/latest/
to find the magnetic field on a point induced by a current in a finite straight wire, only to find out in the end that it only calculated magnitude, and not direction.

so i calculated direction as the cross product of the current and the line perpendicular to the current that runs through the point. and i calculated the latter by using a vector projection to get the point where said perpendicular line intersects the wire.

then since after doing that i had the whole line as a vector, i just used that vector's magnitude as the distance from the current line to the point.

anyways, a lot of algebra later, i've got the code for relative mag field.
(by "relative" i mean you still have to multiply it by current density and m0/(4pi) to get the strength in teslas.)

so my point of all this is: could someone double-check my math here? please! (the two parts that say "correct??" are the answers that i need to be correct)

Code: Select all

#define translate(a,b) { a.x-b.x, a.y-b.y, c.z-c.z } //translate vector a by b
#define dot(a,b) (a.x*b.x + a.y*b.y + c.z*c.z) //dot product
#define SCALE(a) rsqrt(dot(a,a))  //reciprocal of the length of vector a.

//cross product stuff
#define crossx(a,b) (a.y*b.z - a.z*b.y)
#define crossy(a,b) (a.z*b.x - a.x*b.z)
#define crossz(a,b) (a.x*b.y - a.y*b.x) 
#define cross(a,b) { crossx(a,b), crossy(a,b), crossz(a,b), a.w*b.w }

#define norm(a) { a.x*a.w, a.y*a.w, a.z*a.w, 1.0f }  //norm of vector a

#define project(a,b) (dot(a,b)*b.w) //length of projection of a onto b
#define cosangle(a,b) (project(a,b)*a.w) //cosine of the angle between vector a and b.

//declaration of basic data types (T = scalar, T4 = vector)
typedef float T;
struct T4 {
	T x,y,z,w;
}

//given a point p, and finite straight wire from point a to b, find the magnetic field direction and strength induced from current in the wire onto the point p:

T4 bfield_of_seg_on_point(T4 p, T4 a, T4 b) {

	//convert point pairs to vectors.

	T4 lvector = translate(b,a);
	lvector.w = SCALE(lvector);

	T4 v1 = translate(p,a);
	v1.w = SCALE(v1);

	T4 v2 = translate(p,b);
	v2.w = SCALE(v2);


	//proj = length of projection of v1 onto lvector, times the reciprocal magnitude of lvector.
	T proj = project(v1,lvector)*lvector.w;

	//r = perpendicular vector from line to point.
	T4 r;
	r.x = v1.x-lvector.x*proj; //=p.x-(a.x+lvector.x*proj);
	r.y = v1.y-lvector.y*proj;
	r.z = v1.z-lvector.z*proj;
	r.w = SCALE(r);

	T4 cr = cross(lvector,r);
	T4 ret = norm(cr); //this is the direction of the magnetic field.  <-correct??
	
	T strength = cosangle(lvector,v1);
	lvector.w = -lvector.w;   //this effectively switches the direction of the vector.
	strength += cosangle(lvector,v2);

	ret.w = strength*r.w;  //this is the relative strength of the magnetic field.  <-correct??

	return ret;
}
Please and thank you.

krenshala
Posts: 914
Joined: Wed Jul 16, 2008 4:20 pm
Location: Austin, TX, NorAm, Sol III

Post by krenshala »

happyjack27 wrote:yes i have. that's stage 3: particle cycling.

and i've actualy thought a little into that already. there's going to be a "loss radius" coming off the wire segments, which is basically the radius of the wire. a particle in that radius is considered lost. also, as you said, too high x^2+y^2+z^2 and it's considered lost. then it's a matter of reseting lost particles to injection points.
Don't use the radius of the wire if it that is the radius the magrid is at, as a number of us would love to see just what electrons do when they move out through cusps -- do they just run off, do they (mostly|somewhat|not at all) recirculate back into the cusp(s), etc.

If you could model double the magrid radius that should, I think, be sufficient. Anything that gets to twice the magrid distance from the center would be considered "lost" to the chamber walls, unless others think a larger distance outside the magrid would be worthwhile to simulate.

Nice work so far. N-body simulations are one of the reasons I learned what little coding I know. I've always been fascinated watching the virtual results. :)

happyjack27
Posts: 1439
Joined: Wed Jul 14, 2010 5:27 pm

Post by happyjack27 »

those virtual results are wrong - there's an oddity in the original code i wasn't aware of (and apparently neither was nvidia). position is stored as a 4-vector so i just use the extra field to store the charge (the original used it to store mass). turns out thou that 4th field actually scales the position. that's why the borons occupy 1/5 the radius (5 times the charge) of the protons, and the electrons don't show up at all. clearly if nvidia didn't have the mass of all their bodies the same their results would have looked just as screwy.

anyways i fixed it by just storing that info in "constant memory" instead of the position 4-vector, and per particle type rather than per particle. now you see all the particles, including yellow electrons clearly and they expand together because they're net neutral and coloumb forces pull together any substantial charge discrepancies.

sorry no video yet. not really all that impressive anyways. just multicolored dots expanding. (and i've sped up the framerate about 5x)

now onto the static fields. i posted my bfield code above. got the efield code done too now. i want the math double-checked. the static fields are invisible though - you'll only see them by how the particles move.

the radius i'm talking about IS the wire radius. without it they have zero radius so the particles will never hit them (i'm using lines currents instead of cylinder currents 'cause the math is much simpler and you can approximate cyclinder currents with a bunch of line currents anyways). and if you want that, you can just set the radius to zero, anyways.

happyjack27
Posts: 1439
Joined: Wed Jul 14, 2010 5:27 pm

Post by happyjack27 »

new videos. includes electrons (thanks to the bug fix).

thanks to a little parameter i put in for testing, we can see them start out w/an electrostatic differential:

w/electrons dominant on the inside:

http://www.youtube.com/watch?v=Tjt9A8leMzA

w/electrons dominant on the outside:

http://www.youtube.com/watch?v=RYWlzxugvNM

vernes
Posts: 135
Joined: Tue May 13, 2008 10:22 am
Location: The Netherlands

Post by vernes »

happyjack27 wrote:new videos. includes electrons (thanks to the bug fix).

thanks to a little parameter i put in for testing, we can see them start out w/an electrostatic differential:

w/electrons dominant on the inside:

http://www.youtube.com/watch?v=Tjt9A8leMzA

w/electrons dominant on the outside:

http://www.youtube.com/watch?v=RYWlzxugvNM
Can't wait to get away from this corporate firewall and view it.
In previous video you don't visualize the wires? Will you visualize them?

happyjack27
Posts: 1439
Joined: Wed Jul 14, 2010 5:27 pm

Post by happyjack27 »

i don't even have wires (static currents and voltages) yet. that's what i'm working on now. but no, the actual wires will be invisible. to make them show up i'd have to write OpenGL renderers for them, and frankly, i don't even know how to do that. But if the voltage and current is strong enough i'm sure you'll be able to deduce where they are from where the particles are.

happyjack27
Posts: 1439
Joined: Wed Jul 14, 2010 5:27 pm

Post by happyjack27 »

the preliminary code to calculate the force from the static em-field of a finite straight wire segment on a moving point charge is available here. (the link is not a download, it'll show you it online. and you can download it from there if you really want.) if anyone finds any errors, please let me know. thanks.

chrismb
Posts: 3161
Joined: Sat Dec 13, 2008 6:00 pm

Post by chrismb »

Very pretty. Nice work, that chap!

I look forward to the full WB simulation!

(Do I recall correctly that the second one reminds me of the credits on Buck Rogers?)

krenshala
Posts: 914
Joined: Wed Jul 16, 2008 4:20 pm
Location: Austin, TX, NorAm, Sol III

Post by krenshala »

happyjack27 wrote:
krenshala wrote:Don't use the radius of the wire if it that is the radius the magrid is at, as a number of us would love to see just what electrons do when they move out through cusps -- do they just run off, do they (mostly|somewhat|not at all) recirculate back into the cusp(s), etc.

If you could model double the magrid radius that should, I think, be sufficient. Anything that gets to twice the magrid distance from the center would be considered "lost" to the chamber walls, unless others think a larger distance outside the magrid would be worthwhile to simulate.
the radius i'm talking about IS the wire radius. without it they have zero radius so the particles will never hit them (i'm using lines currents instead of cylinder currents 'cause the math is much simpler and you can approximate cyclinder currents with a bunch of line currents anyways). and if you want that, you can just set the radius to zero, anyways.
Bah ... apparently I was more tired than I thought when I read your post. I understand now.

What I meant to suggest was use two times the distance from center to the wires as another cut off distance to simulate particles lost to the chamber walls, or just far enough out to be "lost" to the system we are interested in.

Post Reply