[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Coupling vs secondary voltage chart



Original poster: Jim Lux <jimlux@xxxxxxxxxxxxx>

At 09:00 PM 6/15/2005, you wrote:
Original poster: "Mark Broker" <mbroker@xxxxxxxxxxxxxxxx>

One of the things I've learned about optimizing code are that, quite often, exploding loops will gain some speed. Although not a significant gain in isolated loops, it tends to add up quite significantly in a heart of the number-crunching loops. So basically, nested "for" loops to run through all 36 indexes will take more time to crunch than combining the two loops into one, or even none! Also, unless C compilers have improved significantly in the past ~3 years, a fair improvement in computational speed should be realized if matrix math is "exploded" using pointers instead of arrays. I guess the same goes for the vector math, too. The consequence is that the code isn't quite as compact.

Looks good, Terry!! :)

Mark Broker

If you're doing much matrix math, you're well advised to start using one of the optimized libraries out there. ATLAS is well known, free, etc. They are, to a certain extent, self tuning, in that they have chunks tailored to each kind of processor and it autodetects which version to invoke. FFTW is a similar highly optimized package for doing FFTs.


Trying to hand optimize at the C source code level is a real trap for the unwary. There's so many compiler options, etc., that have many side effects (some of which may undo your hand optimization), as well as idiosyncracies in libraries and compilers, not to mention the effects of various caches, etc. At the very least, you need some detailed microbenchmarking tools or profilers. In general, you're better off finding a better high level algorithm than trying to tune your existing one.


On Wed, 15 Jun 2005 13:56:41 -0500, Tesla list <tesla@xxxxxxxxxx> wrote:

Original poster: Terry Fritz <teslalist@xxxxxxxxxxxxxxxxxxxxxxx>

Hi All,

I set ScanTesla to find out how coupling affects top voltage.

I used the data from my big coil:

http://hot-streamer.com/TeslaCoils/MyCoils/BigCoil/BigCoil.htm

The coupling ran from 0.01 to 0.99 in 0.001 steps.  The load was 3.83pF
calculated from the initial primary cap energy (21kV  28nF) using the Freau
formula.

The primary coil was tuned to maximum top voltage at each coupling level to
within 0.1uH.  I cut the fluff out of a special optimized version of the
program so it could do 1000+ models/second!  441000 calculations (400
seconds - 1,200,000,000,000 machine cycles!) later...  Here is the graph:

http://hot-streamer.com/temp/KvsVtop-BigCoil.gif


Cheers,

        Terry