CS404 Projects:

 

Project #1 (Double Missile Problem): Modify the missile-attack program to include a second missile, as specified in Barrodale, problem 2, page 68. This is an example of a system with constant speeds but varying directions. Print the time of explosion and which object exploded. Also, print a character mode graph of the trajectories up to the time of explosion. Hand in source code and the two outputs it produces.

Project # 2 (Baseball): Program a specific constant acceleration model, the baseball problem on page 75, problem 9 in Barrodale. Print the time and position of the ball hitting the ground. Also, print a character mode graph of the trajectories. Hand in source code and the two outputs it produces.

Project # 3 (Rocket): Program a specific non-constant acceleration model, the rocket problem in Barrodale. Print the time and position of the explosion. Also, print a character mode graph of the trajectories up to the time of explosion. Hand in source code and the two outputs it produces.

Project # 4 (Two Pump Gas Station): Program a specific probabilistic simulation model, the 2-pump gas station problem in Barrodale. Cars arrive at a rate of 20 per hour to a gas station with two pumps & a single queue. If both pumps are busy, put the car in the queue. Service time = 5 minutes per car. Run the simulation for 10,000,000 hours. Determine and print as output: average queue length, the average waiting time for a car, the percent of the time the pumps are busy (both pumps, one pump, or idle time). Hand in source code and the output it produces. Modify the code to be event-oriented and compare. Hand in source code and the output it produces for the event-oriented case too.

Project # 5 Neutron Diffusion (Probabilistic Sim):

Phase1: (This is only a preliminary phase)
First code and debug (repeat DEBUG) the following random number generator:
       long int RANDNUM =  37199;   /* This is PL/I Code */ ;
       X  =  RANDY( RANDNUM );
where
       double RANDY( long int RANDNUM )  
	   { long int RANDNUM  ;
	     RANDNUM := ( (23789 * RANDNUM + 68927)  % 95187251);
   	      return( RANDNUM / 87251 ) ; /* scale to 0 - 1 */
		   }       /* END RANDY */
Or you may use:
     /* SEED (INITIAL VAL.) FOR UNIFORM RANDOM NUMBER GENERATION */
     long int  IY = 100000001 ,    IX = 100000001  ; 
     double YFL ;
     /* THE FOLLOWING COMPUTES NEW PSEUDO RANDOM NUMBERS */
     IY = IX * 1220703125  ;
     if (IY < 0)  IY = IY + 2147483647+1 ;
     YFL = IY ;
     YFL = YFL * 0.4656613E-9  ;
     IX = IY                   ;
     /*  U1 IS NOW A UNIFORMLY DIST. 0-1 RANDOM NUMBER */
     U1 = YFL
Or use the C code downloaded from the INTERNET.
	Convince yourself it works by cranking-out 100 random numbers.
	Then, use the above to compute random numbers in phase 2 (below).
Now for the project description:
Phase 2:
  "Radiation flux density too high; put up more lead shielding. No, not
   behind us,"	     "in front of the reactor plates. Still the
   particle decay is accelerating"   "This room is too
   contaminated for even our protective suits." 
   "Close the steel doors and put up more lead shielding... We need more
   time, more time to solve the problem... mass near critical, matter
   bursting, scintillating in its own destruction"
     -- text based on (but not from (due to copyright))  "Decay and
	Production of Strange Particles" episode of "The Outer Limits"
Whether in the supreme Sci Fi series (above), a 3-Mile Island type
small-scale incident, or a major catastrophe of poor design like
Chernobyl, atomic radiation is a necessary (and often beneficial)
reality.  A nuclear reactor is too large and costly to model physically
and too risky to model purely analytically even if all problems are
analytically describable (let alone analytically solvable.)
    Write a program which simulates the diffusion process of neutrons
through lead shielding.  Compute the fraction of neutrons produced
which:  a. penetrate through the wall.
	b. are absorbed within the wall.
	c. return inside the reactor core.
Compute this for 1,000,000, then 10,000,000, and 1,000,000,000 neutrons.
Use "long double" in C or extended precision in TURBO-PASCAL with
full length numerical print-outs.  Roost on PC's (interactively)
or relax with UNIX (in batch-oriented modes).  Print a histogram 
of wall thickness and % of neutrons that end-up at that layer of 
the wall, using increments of .

Project # 6 Computer System (Probabilistic Sim):

Write a program which simulates a computer system described in chapter
Five (Barrodale handout), pages 87-88.  Your code must be event oriented.
Compute the:   a. average queue length.
	       b. average wait time at queue.
	       c. average processing time of a single job submitted.
	       d. percent idle time of the computer (ie. no job
		  running at the time.)
	       e. final time (at end of simulation) and total number
		  of jobs submitted.
Print these 5 statistical measures at the end of each hour.
Run the simulation for  20 hours.  The time loop should count in
in seconds.  All printouts should have numerical answers and units.
Note: all times should be in seconds, not hours. Use double precision.

 

More to come soon.