Question: The question to write the python programs Task 1 (of 2) The Perrin numbers are the defined by the linear recurrence equation: P(n) = P(n


The question to write the python programs
Task 1 (of 2) The Perrin numbers are the defined by the linear recurrence equation: P(n) = P(n - 2) + P(n 3) Where the following initial conditions are given: P(0) = 3,P(1) = 0, P(2) = 2 Calculate terms P(3) through P(5) by hand using the recurrence equation and initial conditions given above. Use these as test values for your Python program. Write a Python program that calculates Perrin numbers to the nth term. The program should: Prompt the user for a positive integer value 'n'. Check if the value entered by the user is positive. If not continue to prompt user for a positive integer value. Compute the Perrin sequence to the nth term using the recurrence equation and initial conditions given above. Save the terms in a list. Output the Perrin sequence for the number of terms entered by the user to the IDLE Shell. Save your program as: HW_2p1_Task1_TEAMXXX_6+2.py Task 2 (of 2) A common situation dealt with in engineering and physics is that of projectile motion. The equation for the height of a projectile, y (m), is y=-(-)gt? + V, sin(0)t + y. Acceleration due to gravity: 9.81 m/s Time (seconds) Vo = Initial Velocity of Projectile (m/s) 0 = Launch Angle (degrees) yo = Initial height of the projectile (m) The equation for the horizontal distance traveled by the projectile, x (m), is: x = V. cos(0) Assuming yo is zero, the time at which the projectile impacts the ground is given by: 2. V, sin(0) Timpact = - - assuming yo = 0 Assuming yo is zero, the time at which the projectile reaches the maximum height is given by: V sin(0) - assuming y = 0 Max = Download the text file, Projectile.txt, from the Community Site. The first column in the text file is initial velocity (m/s) and the second column is launch angle (degrees). Write a Python script that will: Read the data from the Projectile.txt file For each initial velocity and launch angle, compute Timpact, Maximum Height, and the Horizontal Distance and save the values in lists. Assume yo = 0 and compute horizontal distance at the impact time. Remember: trig functions are in the math library and use radians Write the results along with the initial velocity and launch angles in a new text file called Projectile Results.txt. The first column should be initial velocity, the second column should be launch angle, the third column should be impact time, the fourth column should be maximum height, and the last column should be distance. The first few lines of your Projectile_Results.txt file should look like this: Projectile_Results.txt - ... File Edit Format View Help 10 15 0.5 0.3 5.1 10 30 1.0 1.3 8.8 10 45 1.4 2.5 10.2 100% Windows (CRLF) Save your program as: HW_2p1_Task2_TEAMXXX_6+2.py
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
