Strict Standards: Declaration of Doku_Renderer_metadata::table_open() should be compatible with Doku_Renderer::table_open($maxcols = NULL, $numrows = NULL, $pos = NULL) in /home2/cp-wiki/htdocs/inc/parser/metadata.php on line 480

Strict Standards: Declaration of Doku_Renderer_metadata::table_close() should be compatible with Doku_Renderer::table_close($pos = NULL) in /home2/cp-wiki/htdocs/inc/parser/metadata.php on line 480

Lab 4: MatPlotLib and VPython

  • Plot function for vertical percolation in Matplotlib
    • the function is f(p) = 1–(1-p^n)^n
    • plotting multiple figures in different frames code and plotting all graphs in one frame code
  • While loop that loops until something is true.
  • VPython program
    • Modify the given source to generate random grids until one is produced that vertically percolates. Use the same procedure to determine whether a grid percolates as in problem 2 of problem set 2. Assume that the blue squares(0) percolate, and the red squares(1) block. You will need to use a Boolean value in the condition of the while loop to determine whether a grid has been found that percolates.

Sample Solution

  • Here is a solution to the in-lab problem.

Audio project

  • review of project
  • start on equal_scale(freq, amp, dur, sampler=sin_sample); it is an example with a function as a parameter and an optional argument. Use sampler function as the sampler function (they will write sin_sample)
cs190c/lab4.txt · Last modified: 2008/07/24 12:11 by seh
Recent changes RSS feed Creative Commons License Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki