Coding a Physics Problem using Python
The Problem: If the position of a particle is given by x = 20^t - 5t^3, where x is in meters and t is in seconds, when, if ever, is the particle’s velocity zero? (b) When is its acceleration a zero? (c) For what time range (positive or negative) is a negative? (d) Positive? This problem is taken from famous physics book by "Halliday". We obtained velocity by differentiating the expression with respect to time. Similar acceleration is obtained by differentiating the position expression. Coding Coding was done by setting up lambda functions. Setting the velocity expression to Zero, we obtained the time when velocity becomes nil. We used list comprehensions for creating the lists of time, velocities and accelerations. Then results were printed using zip operator. The svg file is displayed below: Code saved as SVG file import math # 1. Kinematic Equations (Strict Python) pos = lambda t: 20 * t - 5 * t**3 vel = lambda t: 20 - 15 * t**2 acc ...