Comparison with analytic solution The analytic solution for free-fall with v²-dependent air drag is: 2m DpA Yanalyt (t) = yo + In cosh ( Vanalyt (t) = In [ ]: # Analytic solution 2mg DpA tanh Dp Ag 2m DpAg 2m t Exercise 2: Write code for the analytic velocity solution In the code cell below, we already implemented the equation for y_analyt. Add the equation for the velocity, storing the result in v_analyt. The hyperbolic tangent function is available as np. tanh. For the time t, use the vector time that we populated in the loop above. Note: If your code generates any error message (in red), you need to fix this error before continuing. Get help from your instructor or classmates if needed. You will need to use some parentheses () for the trigonometric and square root functions, and to enforce the order of operations. However, use them only where necessary; an excessive number of parentheses makes it harder to debug your code. y_analyt = y0 + 2*m/(D*rho*A) * np.log(np.cosh (np.sqrt (D*rho*A*g/(2*m))*time)) # YOUR CODE HERE raise NotImplementedError()
Comparison with analytic solution The analytic solution for free-fall with v²-dependent air drag is: 2m DpA Yanalyt (t) = yo + In cosh ( Vanalyt (t) = In [ ]: # Analytic solution 2mg DpA tanh Dp Ag 2m DpAg 2m t Exercise 2: Write code for the analytic velocity solution In the code cell below, we already implemented the equation for y_analyt. Add the equation for the velocity, storing the result in v_analyt. The hyperbolic tangent function is available as np. tanh. For the time t, use the vector time that we populated in the loop above. Note: If your code generates any error message (in red), you need to fix this error before continuing. Get help from your instructor or classmates if needed. You will need to use some parentheses () for the trigonometric and square root functions, and to enforce the order of operations. However, use them only where necessary; an excessive number of parentheses makes it harder to debug your code. y_analyt = y0 + 2*m/(D*rho*A) * np.log(np.cosh (np.sqrt (D*rho*A*g/(2*m))*time)) # YOUR CODE HERE raise NotImplementedError()
Related questions
Question
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution!
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 2 images