Go up a level:

While contemplating a design for a solar concentrator, I decided to run my ideas through an open source ray tracing program. Given the geometry of reflective and refractive elements, a ray tracing program will calculate the route rays take through the model; showing effective concentration ratios, behavior under erred tracking and all varieties of visualizations of geometry and ray statistics.

But, in my searching I did not find a program designed to do what needed. Overwhelmingly I found Povray type 3D graphics ray tracers which calculate reflections from half filled glass water vessels superbly. And I found a handful of sequential ray tracers, which assume light hits elements in a specific order, as in a well functioning telescope. But neither of these are suitable for getting statistics from rays in systems with internal reflections or other non-sequential ray paths.

So, I thought to do up something quickly in SciPy, the open source Python MatLab style mathematical computing package. (very comparable to MatLab I might add. Not to mention that Python is AmAzinG and does everything under the sun including and not nearly limited too: document parsing, serial port / modem access, Web bots, digital signal processing, Optical Character Recognition and PDF generation. When I could not find a truly free UnRar utility for windows, I tried typing “PyRar” into google and up it came! I just edited the sample code to the folders I wanted to unrar and ran it. I highly suggest it for any computer related project you may embark on, because it will be there for you regardless of what comes next.)

Fortunately for me, before I began writing my short little SciPy program that would actually have taken months to write and been shoddy and inextensible, I came across something. I found Bryan Cole’s non-sequential ray tracing program, already conveniently written in python. It has still taken months of agonizing tinkering with code; writing new classes and methods to accommodate the geometries and statistics necessary for solar concentrator design. But, most of the intense minutia (the oxymoron that is computer programing) was already skillfully taken care of. Not to mention it came with a three dimensional user interface.

The project is still very alpha. There is much to be wanted in it still, and some ugly hiccups once in a fair while. But I have used it for myself to generate plots of intensity on an absorber and discern the details of the functioning of a concentrator design or two. Of course, the parameters and results of the ray tracing are all open to other python functions, such as plotting data in you’re favorite python plotting program (MatPlotLib, which I use, is very similar to MatLab and Mathematica). Or, if you wanted ray tracing results to control the tracking of your own concentrator, I’m sure python has the tools to do it already.

Link to the Mercurial Repository