This is a warmup to get you used to using the notebook for calculations.
In this homework, you will get acquainted with the Jupyter Notebook, which we will be using extensively in this class. You will need to sign up on SageMathCloud and pay the fee for this semester to use the tool. If you find yourself stuck, please read the computing tutorial.
from numpy import sin, cos, pi
#this import allows you to use trigonomic functions for this notebook
#example:
sin(0.1) # note that computers expect radians, not degrees
If $\phi$ equals 30 degrees and $a$ equals 10, what is the value of $$ a\sin\phi\cos\phi $$
Hint: this should not be negative.
The computer only understands radians, not degrees so I need to convert 30 degrees before I can do anything. $$ radians = degrees * \frac{pi}{180} $$
degrees = 30
radians = degrees * (pi/180)
radians
phi = 0.52
a = 10
a * sin(phi) * cos(phi)
A1 = 4.31 radians # put your answer here
If $f = 60$, $t= 1$ and $\phi = 0.785$ radians, what is the value of $$ sin(2\pi f t + \phi) $$
sin(2 * 3.14 * 60 * 1 + 0.785)
A2 = 0.56 # put your answer here
If $r_1 = 10$ and $r_2 = 20$ what is the value of $$ \left(\frac{1}{r_1} + \frac{1}{r_2}\right)^{-1} $$
r1 = 10
r2 = 20
A3 = ((1/r1) + (1/r2))**-1
A3
A3 = 6.67 # put your answer here
If $r = 0.02$ and $n = 10$, what is the value of $$ \frac{1}{(1 + r)^n} $$
r = 0.02
n = 10
A4 = 1 / (1 + r)**n
A4
A4 = 0.82 # assign your answer to the variable A1
A4 # write out the contents of the variable A1
Replace the image below with one of your choosing. You will need to upload your own image file, choose a name, and change the link below.
https://github.com/dsoto/computing-tutorial/blob/master/8-images.ipynb
