I'm writing a program that simulates kinetic growth. You start off with a single "seed" in a grid and you add particles with random walks from the grid edge and if they collide, they add to it. Each time a particle collides and joins with the whole blob, another particle is emitted. Result is a pretty fractal type picture.
I've got that bit done, it gives nice pretty pictures when the output file is put into graphing software. You note i don't say Excel explicitly because i had problems with it hanging when it tried to make a scatter graph with 10000 data points. I had much better luck in Origin and the result is below:
Parameters are grid size 501 with i think 20000 iterations.
I'm reluctant to post the source code because this is an active project for uni (there are three optional projects for the module, so there'll be lots of people solving this same problem) and i don't want to get plagiarised - it's not due in until the end of Jan. So on the off chance that someone googles and finds this pageHowever, hopefully this can be solved without need for too much code.
Aaaaaannnyyway...
There are some more requirements for the code spec, like working out the fractal dimension of the image. This is fine, i know how to do it and i know how i want to code it.
At the moment, i've calculated the centre of mass of the "blob" and it prints in the terminal window so i can keep track of it (what we physicists would call a sanity check). Trouble is, as soon as I declare another variable, be it called k, dist, fgkafklfsak - whatever. The values for the centre of mass change massively (normally to some huge number in the tens, hundreds of thousands).
Example:
Vanilla -
With an added variable -
The variable name, as I said, makes no difference. Nothing happens besides the variable being declared.
Any idea what could cause it?


LinkBack URL
About LinkBacks
However, hopefully this can be solved without need for too much code.

Reply With Quote

I'm still not understanding why you're doing:


