Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

PYTHON Having a problem with this question. Ive tried it out myself and cant seem to understand it. I have 4 pics the 2 for

PYTHON Having a problem with this question. Ive tried it out myself and cant seem to understand it. I have 4 pics the 2 for instructions and 2 of the functions. The one file phy194 is just read only and a file that I can call to. I can only edit the first picture. image text in transcribed image text in transcribedimage text in transcribedimage text in transcribed

Create a plot of the trajectory y(t) of a vertically thrown ball under gravity (g = 9.81 m.s ) that comes to rest on the ground at y = 0: u(t) = -59t2 + vot + 30 y(t) = u(t)e(u(t)) () here? Why does y(t) correctly Think for a moment what the function y(t) should look like. What is the role of the Heaviside function describe the trajectory of the ball? Code requirements Create a function y_throw(t, vo, yo=2) that calculates y(t) as defined above. (Choose initial position yo = 2 m as default.) Create two plots for two different initial velocities Ovo = 20 m.s-1 (with linewidth 4 points, and solid linestyle) Ovo = 0 m.s-1 (with linewidth 2 points, and dashed linestyle) and add labels to the individual graphs indicating the initial velocities "VO=... m/s" Plot for 100 equally spaced steps 0 $" because of the . Instead, write r" u" to get v. TeX makes use of curly braces {}. Python strings use curly braces for substitutions. If you want to keep curly braces for Tex then you need to double them: in TeX: $e^{\pi i} + 1 = 0$ o as mathtext raw Python string:r"$e^{{\pi i}} + 1 = 0$" o rendered: ei +1=0 (Euler's Formula) Example of the plot with fancy text (do not submit the code that plots the "fancy' image, it will not pass all tests): vertical throw Vo = 20m.5-1 Vo = Om.5-1 -- position y(t) = u(t)e(u(t)) (m) 0 i time t(s) Current file: main.py Load default template... HNMON 1 # plot challenge import matplotlib.pyplot as plt import phy194 as phy 7 # constants 8 g = 9.81 10 # define functions here if 12 13 _name__ == "__main_": # add plotting code File is marked as read only Current file: phy194.py 1 # PHY194 helper module Nmin phy194 6 The phy194 module contains helper functions for working with matplotlib. (Most of it will be superfluous when we start using numpy but for right 9 now it will make our lives a lot easier.) 12 def linspace(a, b, num=50): ***Create a list of "num regular spaced Jalues between 'a' and 'D The endpoints a' and 'b' are included. Parameters a: float first value float last value num: float, optional number of values in the list (default 50) Returns list # sanity checks if a >= b: raise ValueError("For a valid range, set a = 2") dx = (b - a)/(num - 1) X_values = [i*dx + a for i in range (num)] return x_values # add your Heaviside function below 43 def heaviside(x): ***"Heaviside step function Parameters X: float Returns float if x 0: return 1 return 0.5

Step by Step Solution

There are 3 Steps involved in it

Step: 1

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

Database Modeling And Design

Authors: Toby J. Teorey, Sam S. Lightstone, Tom Nadeau, H.V. Jagadish

5th Edition

0123820200, 978-0123820204

More Books

Students also viewed these Databases questions