This shows you the differences between two versions of the page.

Both sides previous revision Previous revision Next revision | Previous revision | ||

cs190c:project3_09 [2009/03/24 16:25] seh |
cs190c:project3_09 [2009/03/24 16:29] (current) |
||
---|---|---|---|

Line 74: | Line 74: | ||

* The demon and system energies must be updated to use in the next trial. However, since we must generate visuals for the next part of the project, we need to record these values in a list to keep track of the value at each iteration (not trial). | * The demon and system energies must be updated to use in the next trial. However, since we must generate visuals for the next part of the project, we need to record these values in a list to keep track of the value at each iteration (not trial). | ||

- Calculate the average system energy and return it. | - Calculate the average system energy and return it. | ||

+ | |||

Line 91: | Line 92: | ||

* The ''ideal_gas'' function should generate two histograms and one graph. Whether and when these plots are generated is determined by the fifth parameter (''visuals'') of ideal_gas. For example, ''ideal_gas(N, 500, 3000, 2, N==500)'' will generate plots only when N=500 and start in initial state 2. Note that omitting the 5th argument will plot every time ideal_gas is called. | * The ''ideal_gas'' function should generate two histograms and one graph. Whether and when these plots are generated is determined by the fifth parameter (''visuals'') of ideal_gas. For example, ''ideal_gas(N, 500, 3000, 2, N==500)'' will generate plots only when N=500 and start in initial state 2. Note that omitting the 5th argument will plot every time ideal_gas is called. | ||

* Histogram **Final_Molecule_Velocity** uses the values of the N molecule velocities after //steps// iterations of ideal_gas (i.e., the values just before ideal_gas returns). Plot the velocities on x-axis and their frequencies on y-axis. You should use the signed velocities and 0 is thus in the center of the x-axis. You should experiment with the most appropriate number of bins. Here is an example plot. [[cs190c:velocitydistr1.png]] | * Histogram **Final_Molecule_Velocity** uses the values of the N molecule velocities after //steps// iterations of ideal_gas (i.e., the values just before ideal_gas returns). Plot the velocities on x-axis and their frequencies on y-axis. You should use the signed velocities and 0 is thus in the center of the x-axis. You should experiment with the most appropriate number of bins. Here is an example plot. [[cs190c:velocitydistr1.png]] | ||

- | * Histogram **Demon_Energy** generates a histogram of the observed demon energy. The plot is generated after the //steps// steps of ideal_gas are completed. The demon energy is recorded a{{cs190c:velocitydistr1.png|}}fter each simulation step (using a list or array of size ''step''). Show the demon energies on the x-axis and their frequencies on the y-axis. Again, select an appropriate number of bins. Here is an example plot. [[cs190c:demonenergy1.png]] | + | * Histogram **Demon_Energy** generates a histogram of the observed demon energy. The plot is generated after the //steps// steps of ideal_gas are completed. The demon energy is recorded after each simulation step (using a list or array of size ''step''). Show the demon energies on the x-axis and their frequencies on the y-axis. Again, select an appropriate number of bins. Here is an example plot. [[cs190c:demonenergy1.png]] |

* Graph **Demon_Energy_Time** shows the ''steps'' demon energies over time. The graph has values from 1 to ''steps'' on the x-axis and the corresponding demon energies on the y-axis. Make sure to show these 3000 steps in an effective way. | * Graph **Demon_Energy_Time** shows the ''steps'' demon energies over time. The graph has values from 1 to ''steps'' on the x-axis and the corresponding demon energies on the y-axis. Make sure to show these 3000 steps in an effective way. | ||