Before you turn this problem in, make sure everything runs as expected. First, restart the kernel (in the menubar, select Kernel\(\rightarrow\)Restart) and then run all cells (in the menubar, select Cell\(\rightarrow\)Run All).

Make sure you fill in any place that says YOUR CODE HERE or “YOUR ANSWER HERE”, as well as your name and collaborators below:

NAME = ""
COLLABORATORS = ""

Introduction assignment#

Insert a Markdown cell below this. In it do these things:

  1. tell me something about yourself,

  2. and put a photograph of yourself in it.

There are two ways to do that, one is to copy an image (e.g. from a screenshot, or right click on an image and copy it), and then paste it in to a Markdown cell. The second way is to drag an image into this folder, say it is called headshot.png, then use a syntax like this (but without the four leading spaces).

![Some description](./headshot.png)

Part 2#

Tell me about your experience with using programming to solve engineering problems.

Python cells#

Fix this code so it prints exactly Hello World

a = "hello world"
print a

Define a function#

Define a function that implements \(f(x) = e^{-0.5 x} \sin(x)\). Show that it works with a single number, and an array of numbers.

Make a plot#

Using the function above, plot it from x=0 to x=\(6\pi\). Make sure to include axis labels.

Getting a PDF can be tricky if you have images, equations, etc. The various exporters work more or less well with those. Try these options to see what works best for your notebook.

When you are done, download a PDF and turn it in on Canvas. I recommend you use:

File -> Save and Export Notebook As... -> Webpdf

this will generate a pdf via LaTeX. You might like the way it looks better.

File -> Save and Export Notebook As... -> PDF

Alternatively, this may work too.

%run ~/s25-06623/s25.py
%pdf
---------------------------------------------------------------------------
OSError                                   Traceback (most recent call last)
File /opt/hostedtoolcache/Python/3.11.11/x64/lib/python3.11/site-packages/IPython/core/magics/execution.py:727, in ExecutionMagics.run(self, parameter_s, runner, file_finder)
    726     fpath = arg_lst[0]
--> 727     filename = file_finder(fpath)
    728 except IndexError as e:

File /opt/hostedtoolcache/Python/3.11.11/x64/lib/python3.11/site-packages/IPython/utils/path.py:90, in get_py_filename(name)
     89         return py_name
---> 90 raise IOError("File `%r` not found." % name)

OSError: File `'/home/runner/s25-06623/s25.py'` not found.

The above exception was the direct cause of the following exception:

Exception                                 Traceback (most recent call last)
Cell In[2], line 1
----> 1 get_ipython().run_line_magic('run', '~/s25-06623/s25.py')
      2 get_ipython().run_line_magic('pdf', '')

File /opt/hostedtoolcache/Python/3.11.11/x64/lib/python3.11/site-packages/IPython/core/interactiveshell.py:2486, in InteractiveShell.run_line_magic(self, magic_name, line, _stack_depth)
   2484     kwargs['local_ns'] = self.get_local_scope(stack_depth)
   2485 with self.builtin_trap:
-> 2486     result = fn(*args, **kwargs)
   2488 # The code below prevents the output from being displayed
   2489 # when using magics with decorator @output_can_be_silenced
   2490 # when the last Python token in the expression is a ';'.
   2491 if getattr(fn, magic.MAGIC_OUTPUT_CAN_BE_SILENCED, False):

File /opt/hostedtoolcache/Python/3.11.11/x64/lib/python3.11/site-packages/IPython/core/magics/execution.py:738, in ExecutionMagics.run(self, parameter_s, runner, file_finder)
    736     if os.name == 'nt' and re.match(r"^'.*'$",fpath):
    737         warn('For Windows, use double quotes to wrap a filename: %run "mypath\\myfile.py"')
--> 738     raise Exception(msg) from e
    739 except TypeError:
    740     if fpath in sys.meta_path:

Exception: File `'/home/runner/s25-06623/s25.py'` not found.