Lab2temp 151 22C Jupyter Notebook 9 6 22 1 16 PM MATH 151 Lab 2 Haya Mohammad Jason Tharun Fatima section 580 In from sympy import from sympy plotting import plot plot parametric Question 1 In 4 from sympy import from sympy plotting import plot plot parametric x symbols x f 1 x x 1 x 2 x 3 Values solve f x values i evalf for i in Values print The values of x for which f x 0 are values The values of x for which f x 0 are 2 61803398874989 0 3819 66011250105 1a 1b 1c 1d In 5 print f expand x 4 6 x 3 11 x 2 6 x 1 In 6 print f factor x 2 3 x 1 2 http localhost 8891 notebooks Downloads Lab2temp 151 22C ipynb Page 1 of 4 Lab2temp 151 22C Jupyter Notebook 9 6 22 1 16 PM In 8 plot f x 5 1 print So yes the plot agrees with the values i found in part a and the expression i found in part c So yes the plot agrees with the values i found in part a and the expression i found in part c Question 2 2a 2b In 21 from sympy import from sympy plotting import plot plot parametric t symbols t h 0 5 9 8 t 2 6 Values solve h t values i evalf for i in Values print The time when the object hits the ground will be values 1 The time when the object hits the ground will be 1 10656667034498 s http localhost 8891 notebooks Downloads Lab2temp 151 22C ipynb Page 2 of 4 Lab2temp 151 22C Jupyter Notebook 9 6 22 1 16 PM In 17 from sympy import from sympy plotting import plot plot parametric t symbols t s 2 9 8 t 2 2 9 8 exp t 2 2 2 9 8 6 Values solve s t values i evalf for i in Values print The time when the object hits the ground will be values 1 The time when the object hits the ground will be 1 21873095569557 s 2c In 23 plot h t 0 3 s t 0 3 print Blue is without air resistance and Orange is with air resistance 30 Blue is without air resistance and Orange is with air resistance Question 3 3a http localhost 8891 notebooks Downloads Lab2temp 151 22C ipynb Page 3 of 4 Lab2temp 151 22C Jupyter Notebook 9 6 22 1 16 PM In 43 from sympy import from sympy plotting import plot plot parametric t x y s h p m symbols t x y s h p m xt sin 2 t yt cos t st 3 sin 2 t ht cos t pt sin 3 t mt 2 cos t plot parametric xt yt t 0 4 pi st ht t 0 4 pi pt mt t 0 print a is in blue b in orange and c in green a is in blue b in orange and c in green 3b In 44 print When a increases there is a horizontal stretch print When n increases there is a vertical compression print When b increases there is a vertical stretch When a increases there is a horizontal stretch When n increases there is a vertical compression When b increases there is a vertical stretch http localhost 8891 notebooks Downloads Lab2temp 151 22C ipynb Page 4 of 4
View Full Document