Virtual Polywell
Some problems are not subtle, they are just bugs! I got a crude way to visualize the data and began to realize I'd have to debug the visualization program to fully understand what was happening. So I'll stick with raw numbers while I debug the electron blob tracking.
Found a couple and fixed them already - stupid book keeping and counting problems were sending pointers out of bounds, so that explains my file dump at the end of the program. Next problem to fix is the particles near the MaGrid - the acceleration is way too big so that in one time step the particles get ejected from the vacuum chamber (the numbers are 10 times the radius in one time step - way past light speed!!)
It's gonna be slow slogging, or at least feel like it. But I think this should be computable in a reasonable time with the hardware I've got. Once I get something that seems to work, I'll post it.
Found a couple and fixed them already - stupid book keeping and counting problems were sending pointers out of bounds, so that explains my file dump at the end of the program. Next problem to fix is the particles near the MaGrid - the acceleration is way too big so that in one time step the particles get ejected from the vacuum chamber (the numbers are 10 times the radius in one time step - way past light speed!!)
It's gonna be slow slogging, or at least feel like it. But I think this should be computable in a reasonable time with the hardware I've got. Once I get something that seems to work, I'll post it.
The irony is, given the relative inefficiency of most malloc implementations, a garbage-collected memory system would probably not perform much worse on average, and would certainly save a lot of programmer headaches. It's just not a big part of the C mindset, unfortunately.MSimon wrote:I always hated C for its opaque handling of pointers.
Very prone to errors or as C people prefer the more benign sounding "memory leaks". Which are not benign at all (unless the memory is not occupied).

I've never had much luck with malloc or it's cousins alloc or calloc. I just create fixed buffers and use indexing or pointers plus indexing. Usually it's my book keeping on indexing that screws me up - I just can't count! Setting aside 100MB at run time for a few variables always works - I seem to be jinxed with malloc.
So instead of memory leaks, I usually clobber the OS and kernel space. Modern MMU's save my butt and core dump the process. It usually doesn't take that long to find the bug, the major advantage is that it is never subtle.
So instead of memory leaks, I usually clobber the OS and kernel space. Modern MMU's save my butt and core dump the process. It usually doesn't take that long to find the bug, the major advantage is that it is never subtle.
I just uploaded a debugging in process version of electron_phase.c where I've fixed a problem with "zone swapping". Since I'm only tracking 1/48 of the total volume, once a particle leaves that volume I've got to put back it's mirror copy from another section.
The major bug I've got to fix next is the velocity change. A blob is going way too far for a nanosecond equivelent time scale. Like 5 times light speed! Hopefully I'll get a chance to figure that out over the next day or so.
The major bug I've got to fix next is the velocity change. A blob is going way too far for a nanosecond equivelent time scale. Like 5 times light speed! Hopefully I'll get a chance to figure that out over the next day or so.
You have invented the Warp Drive. Don't let the guys from New Energy find out. :-)drmike wrote:I just uploaded a debugging in process version of electron_phase.c where I've fixed a problem with "zone swapping". Since I'm only tracking 1/48 of the total volume, once a particle leaves that volume I've got to put back it's mirror copy from another section.
The major bug I've got to fix next is the velocity change. A blob is going way too far for a nanosecond equivelent time scale. Like 5 times light speed! Hopefully I'll get a chance to figure that out over the next day or so.
Engineering is the art of making what you want from what you can get at a profit.
OK - fixed the "light speed" bug - I was multiplying the x component of the E field by a scale factor twice and not the z component at all. So now at least the motion seems ok - except another bug showed up and it looks like some kind of division by zero sending me back to 100 times light speed again. But it's converging! Instead of all the particles zooming off, it's only one....


Found a couple more bugs, and now it behaves "rationally". The more blobs I introduce, the slower I have to run the time steps or it blows up too fast.
I'm a touch confused about the sign of the force from each field - I need to double check that the electron source pushes the blobs away and the grid pulls them in. It looks that way in my crude plots, but my graphics suck big time. I'll try to set up an overnight run some time and see what happens - probably a huge mess!
I'm a touch confused about the sign of the force from each field - I need to double check that the electron source pushes the blobs away and the grid pulls them in. It looks that way in my crude plots, but my graphics suck big time. I'll try to set up an overnight run some time and see what happens - probably a huge mess!
For the last couple of days I've tried to do a quick and dirty analytical model of looking at the electron emitter into a coil as a "tube" problem. Getting the basic fields was easy, and figuring out the max current from either a hot or field emission cathode was easy, but putting it all together is turning into a huge mess. Even the simplest things are really complicated....
Oh well - at least it is fun! Hopefully I will have something to write up before I get dragged off to higher priority stuff (like helping my kids study for finals...)
Oh well - at least it is fun! Hopefully I will have something to write up before I get dragged off to higher priority stuff (like helping my kids study for finals...)
I have not had time to write anything up, so I tried an experiment of putting my notes up directly. Kinda hard to read, but better than nothing. I need to work on centering and focus for picture taking.
But the idea of "quick and dirty" doesn't apply without a lot of assumptions. I think it will actually be easier to do a brute force calculation than to pursue an analytical solution. But I think over the long run both need to be done along with experiments for a full picture to emerge.
With luck in a month or so I'll be able to write this up correctly.
But the idea of "quick and dirty" doesn't apply without a lot of assumptions. I think it will actually be easier to do a brute force calculation than to pursue an analytical solution. But I think over the long run both need to be done along with experiments for a full picture to emerge.
With luck in a month or so I'll be able to write this up correctly.