nuclear shielding simulator

justinjames92

New Member
Joined
May 2, 2011
Messages
5
As an illustration, suppose that a slab of material is used to shield a nuclear reactor and that a
particle entering the shield follows a random path by moving forward, backward, left, or right with
equal likelihood, in jumps of one unit. A change of direction is interpreted as a collision with an
atom in this shield. Suppose that after 10 such collisions, the particle's energy is dissipated and that it
dies within the shield, provided that it has not already passed back inside the reactor or outside
through the shield. A program is to be written to simulate particles entering this shield and to
determine what percentage of them gets through it.
Think of the metal wall that is supposed to keep the high-energy particles contained as being
4 units thick and boundless in the horizontal direction. Divide up the cross-sectional view of the wall
as occupying a region 4 rows and, say, 20 columns. Use the coordinates (I, J) for (row, column) with
(0, 0) representing cell Al. Assume each particle starts its random motion into the wall in the top row
(I = 0) and column H (J = 7) of the spreadsheet (the metal wall begins at the second row and extends
to include the fifth row). Make a random number generator which returns one of the integers 1, 2, 3,
or 4, corresponding to down, up, left and right...the four random directions the particle can bounce.
Use Select Case and Offset to move the particle once its random number is generated. Get
another random number and repeat the movement. Continue this in a loop until either 10 numbers
have been generated and the particle decays or it escapes (made it to the 6th row down) whereby an
"out" should be placed in the cell where it left the metal wall. Put this entire process of a loop that
will repeat for 100 particles.
Animate the process by having the cell in which the particle is be colored red. Clear the cell
if the particle decays or if the particle escapes. Call a "delay" subprogram to slow down the action to
be visible but fast. Oftentimes more than one particle escapes the metal at the same column. If this
happens, have the active cell move down one row and then print "out-. Include a counter as to how
many of the 100 particles make it through the shielding wall.



any help???
 

Excel Facts

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.
Sounds interesting and useful and like homework? Sounds like some looping and use of Rnd (2X?) The animation part sounds real cool. Start on it and I'm sure someone will help. Dave
 
Upvote 0
yea its a term project


what i really need help with is how to move the active cell

the first cell must move down into the nuclear shield and after that move randomly based on numbers made from a random number generator

i have it so that it moves down into the active cell but
i dont know how to then select THAT cell and make it the active cell so that vba selects it and moves the value in that cell according to the random number generator
 
Upvote 0
don't use "select". use "activate" instead. Post this code when you're done. Sounds cool
 
Upvote 0
Just to make things more complex... Shouldnt you look at the problem in 3D?

I.E. Assuming particals move in random directions after contact..

Forward
Back
Left
Right
Up
Down.
 
Upvote 0
Mance, what if you take into account Brownian motion? Will your suggestion suffice?!
 
Upvote 0
Why don't we take quantum mechanics into account as well? We could create a new workbook and have the particle show up there for an instant before deleting the workbook again.
 
Upvote 0
Now your entering into maths I have long forgotten!

Degree level mathematics/physics passed from my sphere of practical knowledge as soon as I left university, and had no real world use for it!

:laugh::)
 
Upvote 0
Quantum = Leap. Dr Sam Beckett. Enuf said. Hmmm time travel
 
Upvote 0

Forum statistics

Threads
1,224,606
Messages
6,179,866
Members
452,948
Latest member
UsmanAli786

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top