# CHEM 1000 - Spring 2022
Prof. Geoffrey Hutchison, University of Pittsburgh

## Graded Homework 1

For this homework, we'll be using Jupyter notebooks for a few problems:
- Plotting functions (this notebook)
- Unit conversions
- Significant figures
---

Before you turn this problem in, make sure everything runs as expected. First, restart the kernel (in the menubar, select Kernel → Restart & Run All) and then check to make sure you don't see any error messages (which will stop the "Run All" command.

Make sure you fill in any place that says YOUR CODE HERE or "YOUR ANSWER HERE", as well as your name and collaborators (i.e., anyone you discussed this with) below:


```python
NAME = ""
COLLABORATORS = ""
```


```python
# First, let's import some modules for plotting functions
# import sympy and start a session
from sympy import init_session
init_session()

# insert any graphs into our notebooks directly
%matplotlib inline
# high resolution plots
%config InlineBackend.figure_format = 'retina'

from sympy.plotting import plot
```

### Part A (2 points)

The [Michaelis-Menten](https://en.wikipedia.org/wiki/Michaelis%E2%80%93Menten_kinetics) equation models the kinetics of enzymatic reactions, e.g.
    
$$
S \rightarrow P
$$

$$
v = \frac{d[P]}{dt} = \frac{V_{max} [S]}{K_m + [S]}
$$

where $v$ is the rate of the reaction, converting substrate S to product, $V_{max}$ is the maximum rate, and thhe constant $K_m$ is the substrate concentration at whhich the reaction rate is at half its maximum value.

Plot $v$ as a function of $[S]$ with $K_m = 0.04 M$ and $V_{max} = 0.1 M/s$.


```python
# use "x" as the variable instead of [S]

## BEGIN SOLUTION

## END SOLUTION

plot(v, xlim=(0.0, 3.0), ylim=(0,0.5))
```

## Part B (3 points)

The [**sinc** function](https://en.wikipedia.org/wiki/Sinc_filter) is used frequently in audio and signal processing, particularly to remove high-frequency noise.

$$
\mathrm{sinc} \; x = \frac{\sin \pi x}{\pi x}
$$

Plot **sinc x** from -4.0 to 4.0:


```python
## BEGIN SOLUTION

## END SOLUTION
```

**Concept** Is the $\mathrm{sinc}$ function an even or odd function? Explain.

YOUR ANSWER HERE:
## BEGIN SOLUTION
## END SOLUTION

## Part C (3 points)

Consider the function:

$$f(x) = \ln\left(\frac{1}{\cos^2 x} \right)$$

Since this will be periodic, we'll need to plot across a wide range, say -20 to +20.

Plot the function:


```python
## BEGIN SOLUTION

## END SOLUTION
```

**Concept:** Explain what happens to the function at $x = \pm \pi$, $\pm 2\pi$, etc. 

YOUR ANSWER HERE:
## BEGIN SOLUTION
## END SOLUTION

### Part D: Significant Figures (3 points)

I know, it's everyone's favorite 😆 topic... 

Make sure to print all three of the following calculations, with rounding to produce the right number of significant figures:


```python
from sigfig import round

# add and subtract some numbers (e.g., masses)
example_1 = 17.13+14.6751+3.123+7.654−8.123

# find the volume of a box:
# length is given as 7.78 m
# width is given as 3.486 m
# and whose height is 1.367 m
volume = 

# find the pressure of a gas with PV = nRT
# V is 0.200 m**3, 
# the temperature T is 298.15 K, 
# and the amount of gas n is 1.000 mol
V = 
T = 
n = 
R = 8.31446261815324 # m**3 • Pa (pascals) / (mol•K)
pressure = n * R * T / V # you can leave the pressure in Pa

## BEGIN SOLUTION
## END SOLUTION
```

### Polar 2D Coordinates (4 points)

As a reminder, we sometimes need to convert between x, y, Cartesian 2D coordinates and polar r, $\theta$ coordinates.

Please interconvert the following x, y coordinates and r, $\theta$ coordinates:


```python
x1 = 2
y1 = 10
r1 = 
theta1 = 

x2 = -2
y2 = -5
r2 = 
theta2 = 

r3 = 1.0
theta3 = 0.52
x3 = 
y3 = 

r4 = 5.0
theta = 5.87
x4 = 
y4 = 
```

**Concept**: What are the ranges of possible r and theta values?

R:
Theta: 


## Spherical Coordinates (5 Points)

Much like in 2D XY coordinates, we sometimes need to interconvert 3D cartesian and spherical coordinates in chemistry.

Please interconvert XYZ to r, $\theta$, $\varphi$ or vice-versa


```python
x = 1.0
y = 2.0
z = 3.0
r = 
theta = 
phi = 

r2 = 1.0
theta2 = 2.5 # radians
phi2 = -1.0 # radians
x2 =
y2 = 
z2 =
```

**Concept**: What are the ranges of possible r, theta, and phi values?

R:

Theta: 

Phi:

4c5483834deedc64d8bc075d4a288e88773d9e8e
ipynb
Jupyter Notebook
homework/ps1/ps1.ipynb
ghutchis/chem1000
07a7eac20cc04ee9a1bdb98339fbd5653a02a38d
CC-BY-4.0
2020-06-23T18:44:37.000Z
2022-03-14T10:13:05.000Z
homework/ps1/ps1.ipynb
ghutchis/chem1000
07a7eac20cc04ee9a1bdb98339fbd5653a02a38d
CC-BY-4.0
homework/ps1/ps1.ipynb
ghutchis/chem1000
07a7eac20cc04ee9a1bdb98339fbd5653a02a38d
CC-BY-4.0
2021-07-29T10:45:23.000Z
2021-10-16T09:51:00.000Z
Qwen/Qwen-72B
1. YES
2. YES