12. Intermediate Calculus with Python
Activity 12.01: Finding the Velocity and Location of a Particle
Solution:
- For the first part, we only have to find where . Let's write functions for dx/dt and dy/dt:
from math import sqrt,sin,cos,e def dx(t): return 1 + 3*sin(t**2) def dy(t): return 15*cos(t**2)*sin(e**t)
- Now, we can loop from 0 to 1.5 and see where dy/dt goes from positive to negative or vice versa:
t = 0.0 while t<=1.5: print(t,dy(t)) t += 0.05
Here's the important part of the output:
1.0000000000000002 3.3291911769931715 1.0500000000000003 1.8966982923409172 1.1000000000000003 0.7254255490661741 1.1500000000000004 -0.06119060343046955 1.2000000000000004 -0.3474047235245454 1.2500000000000004 -0.04252527324380706 1.3000000000000005 0.8982461584089145 1.3500000000000005 2.4516137491656442 1.4000000000000006 4.5062509856573225 1.4500000000000006 6.850332845507693...