Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

A ball is launched in the air with initial velocity u, from an initial position of coordinates (xo, yo) as illustrated below: y Vo

A ball is launched in the air with initial velocity u, from an initial position of coordinates (xo, yo) as  Write a function named proj_time() that calculates the time at which the ball reaches the ground. Note that Question 3.1: Write a function named proj_distance () that calculates the horizontal distance traveled by the

A ball is launched in the air with initial velocity u, from an initial position of coordinates (xo, yo) as illustrated below: y Vo 0 X Figure 1: Ball launching at angle from the x-axis with inital velocity vo The ball is launched at an angle 0 (expressed in degrees) from the x-axis. The equations describing the motion (i.e. the position of the ball (x(t), y(t)) as a function of time t) of the ball are: x(t) = xo + vot cos(0) 1 y(t) = yo + vot sin(0) -- 812 stivatesindows where g is the gravitational acceleration (g = 9.81 m/s}). Since is given in degrees, you will want to convert it first into radians before using the sine cosine functions. Go to Settings to activate Write a function named proj_time() that calculates the time at which the ball reaches the ground. Note that when the ball hits the ground, y = 0. So, to find the time at which the ball reaches the ground you have to solve the quadratic equation: y0, which is the initial y position v0, which is the initial velocity theta, which is the launching angle in degrees . You should have already defined a function that solves a quadratic equation (function solve_quadratic (), refer to Question 1). So, your new function proj_time() should have the following input arguments (use the same argument names): 81 + Uot sin(0) + yo = 0 Inside proj_time(), call the function solve_quadratic () with the correct inputs based on the quadratic equation above. Recall that solve_quadratic () returns two elements. The correct solution for the time at which the ball reaches the ground is the second element, elem_2, for which the root is computed by setting the to. Your function proj_time() should only return one solution, the correct one. #ANSWER CELL #run this cell to create a global variable g, but make sure you don't have any other global variables also named g g = 9.81 Try out your new proj_time() function in the cell below. Try using y0 = 0 meters, v0 = 15 m/s, and theta = 40 degrees. Feel free to try it for other input values. You do not need to store any outputs from the cell below. This is just to allow you to test your function. Activate Windows Go to Settings to activate Question 3.1: Write a function named proj_distance () that calculates the horizontal distance traveled by the ball from its initial horizontal position, xo, before it reaches the ground. Your function should take as input arguments y0, v0, and theta. You can first solve for the time when the ball hits the ground using the function above, proj_time(), and then use this time in the following equation to get the distance traveled: x(t) = xo + vot cos(0) # ANSWER CELL Try out your new proj_distance () function in the cell below. Try using y0 = 0 meters, v0 = 15 m/s, and theta = 40 degrees. Feel free to try it for other input values. You do not need to store any outputs from the cell below. This is just to allow you to test your function. grader.check ("q3.1") Question 3.2: Calculate the horizontal distance traveled by a ball starting at 5 m above the ground, with a velocity of 1 m/s at an angle of 30 degrees above horizontal. Store the value as q3_2.

Step by Step Solution

3.56 Rating (156 Votes )

There are 3 Steps involved in it

Step: 1

The function projtime to calculate the time at which the ball reaches the ground import math def sol... blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Applied Numerical Methods With MATLAB For Engineers And Scientists

Authors: Steven C. Chapra

3rd Edition

1259027430, 978-1259027437

More Books

Students also viewed these Programming questions

Question

Briefly summarize the elements of ISO 9001.

Answered: 1 week ago