.. _homework1: Homework 1 (Due 6 pm, Friday, Apr 8, 2016) ########################################################################## Please submit your homework to your git repo by **6 pm, Fri, Apr 8 2016**. 1. Setup an account from Bitbucket and clone the course repo from the remote Bitbucket repository to your local machine (see the sections in :ref:`ch01-version-control-systems`). (a) Generate and edit a file named ``bio.txt`` which includes the following information: * name, your major, email * shool year * research interests * advisor's name (if any) * experience in ODEs and PDEs: (1. a lot, 2. somewhat, 3. none) * experience in numerical/computational ODEs and PDEs: (1. a lot, 2. somewhat, 3. none) * experience with MATLAB (1. a lot, 2. somewhat, 3. none) * do you have MATLAB installed on your local machine? (yes/no) * if the previous answer is no, do you have an access to a machine that has MATLAB installed? (yes/no) (b) Check-in (or make a commit) ``bio.txt`` with a comment: "my first check in to my own repo on mm/dd/yy as part of homework 1". (c) After a successful check-in of ``bio.txt``, modify it by adding a new line on your OS and computer: * types of OS and machine for the class (d) Check-in the updated ``bio.txt`` to the repo again. 2. Modify the example MATLAB code in :ref:`EulerMethod` to solve the IVP using the forward Euler's method: .. math:: :nowrap: \begin{equation} \left \{ \begin{array}{lll} && \frac{du}{dt} = \sqrt{u(t)} \nonumber \\ && u(1) = 0.25. \end{array} \right. \end{equation} Note that this has a unique exact solution :math:`u_{exact}(t) = \frac{t^2}{4}` over :math:`[1,\infty]`. Please evolve your numerical solution until the maximum time :math:`t_{max} = 5` is reached using four different time step sizes, :math:`\Delta t = 1, 0.5, 0.25, 0.125`. Your grid discretization of :math:`t^n` over :math:`[1,t_{max}]` will be such that :math:`t^0 = 1`, and :math:`t^n = t^0 + n\Delta t, n=0, \dots, N`. (a) Plot each of the four cases over :math:`[1,t_{max}] = [1, 5]` along with the exact solution. (b) Measure the :math:`L_1` error :math:`||E^N||_1` defined by .. math:: ||E^N||_1 = \Delta t \sum_{n=1}^{N} | u_{exact}(t^n) - U^n|, where :math:`N` is given by :math:`\Delta t = \frac{5 - 1}{N}`. Plot the error convergence rates by plotting :math:`||E^n||_1` versus :math:`N` in log-log scales (use MATLAB's ``loglog`` command).