Intro to Computational Science 125

Week One Lab

  1. Enter and run the Chaos program from Section 1.6. Try it out with various values of input to see that it functions as described in the chapter.

  2. Modify the Chaos program using 2.0 in place of 3.9 as the multiplier in the logistic function.

Your modified line of code should look like this:

x = 2.0 * x * (1 - x)

  1. Run the program for various input values and compare the results to those obtained from the original program.
  2. Create a text file called 'results.txt'
  3. Write a short paragraph in that file describing any differences that you notice in the behavior of the two versions.
  4. Change the loop counter from 10 to 20.
  5. As it stands, the program contains several "Magic Numbers". Modify the code by adding a constant value for the multiplier and the loop count.
  6. Push up to GitHub and create a pull request on the original repository.

Workflow

  1. Fork the repository for the exercise/project (found under github.com/advanced-js).
  2. Clone the repository to your computer.
  3. Open the index.html file in a browser and open the Developer Tools.
  4. Modify the files to complete your solution.
  5. Refresh the index.html page to see the results, and repeat.
  6. Make sure all of your code is committed.
  7. Push/sync up to GitHub.
  8. Create a pull request on the original repository. All assignments are due at the start of the following class, unless otherwise specified.
  9. You can continue to push fixes and improvements until the close date (listed in Classes) – just add a comment in the pull request to let me know it's been updated.