User Tools

Site Tools


Sidebar

spin:esc201_hs2022

This is an old revision of the document!


Simulations in the Natural Sciences I

ESC201:Fall 2022: Monday Lecture: 13:00-14:00 Exercises: 14:00-17:00 in Y17-J-05

TAs: Stefan Schafroth, Sebastian Schulz (sebastian.schulz@uzh.ch), Thomas Meier (thomas.meier5@uzh.ch)

Lectures

Assignments

Your solutions should be handed in 7 days after each assignment has been given, i.e. Monday night by 21:00 one week after the Monday lecture. Assignments should be individual and should be in python and provide a correct virtual environment! (if you stick to standard libraries like numpy, matplotlib, scipy… you can also just submit your python source code together with the output of your program)

For help getting started with virtual environments, please read carefully Python Virtual Environments for Pip and Python Virtual Environments for Conda.

Please hand in the following in Teams:

  1. The working python source code
  2. The requirements.txt file for your virtual environment (if you used a virtual environment)
  3. A .pdf or .png image or animation of the output of your program

Template: template.zip

Instructions:

Please add the names of the people you work together (if you do) to the comment section of your python scripts.

Create a virtual environment using

Pip

- run virtualenv yourenv_name to create a virtual environment

- run source yourenv_name/bin/activate to activate yourenv_name

- install necessary libraries that you want using pip install package_name

- work in that directory, get your outputs (*.pdf, *.png, *jpeg, *.mp4, etc…)

- run pip freeze > requirements.txt to get your list of libraries

Conda

- run conda create -n yourenvname python=x.x anaconda to create a virtual environment

- run source activate yourenvname to activate yourenv_name

- install necessary libraries that you want using conda install -n yourenv_name package_name

- work in that directory, get your outputs (*.pdf, *.png, *jpeg, *.mp4, etc…)

- run conda list –export > requirements.txt to get your list of libraries

List of assignments

  1. Implement the bisection root finding method presented in the first lecture for a function f of your choice (e.g. xx - 100 = 0 or the quadratic function f(x) = ax² + bx + c, for which you can compare to the analytical result)! (to submit by 26 September 2022, 9pm)
  2. Plot (and/or animate) the elliptical orbit of a planet around the sun by repeatedly solving Kepler's equation with Newton's method (or the bisection method), as explained in the lecture! (to submit by 3 October 2022, 9pm)
  3. Draw a Feigenbaum diagram that results from solving the logistic equation (to submit by 10 October, 2022, 9pm). (Optional: Implement a function that allows you to zoom into the Feigenbaum diagram)
  4. Fractals: Draw some Julia sets with various constants c (you can start with the Mandelbrot set as it was explained in the lecture and the exercise class)! (to submit by 17 October, 2022, 9pm)
  5. Ordinary Differential Equations: Solve the Lotka-Volterra equation using the Euler method and the midpoint Runge-Kutta method (optional: 4th order Runge Kutta method) and compare the results. Make two plots: the time dependence of both populations (mice and foxes), and the phase diagram, using different initial conditions (to submit by 24 October, 2021, 9pm).
spin/esc201_hs2022.1666003126.txt.gz · Last modified: 2022/10/17 12:38 by thomas