Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Now half of python code is given, and i have to expand that code, according to the questions requirement. Python code is in picture below

image text in transcribed

Now half of python code is given, and i have to expand that code, according to the questions requirement. Python code is in picture below

image text in transcribed

3. This should be done in python. During volcanic eruptions, rocks and other material are thrown out. We should imagine that a stone is thrown out. We should calculates and plot the position (horizontally and vertically) of this rock through the hover when we neglect air resistance. We can imagine a coordinate system with a x and y axis where positive will be upwards. The point where the stone leaves the vulcno is defined as origo (x=0,y=0), and at the same time have an initial velocity vector given by the components Vx0=25.0m/s and Vy0=80m/s, respectively, horizontal and vertical direction. a) The stone that is thrown out will reach a maximum height that can be calculated by hand. First you must however, extend the Python program by defining a function "find_max_height". This should have the array "yn as input parameter, where "yn contains all calculated heights through hovered. The function should return the largest height found, and this height ("Max_height") is then printed from the main program. The function is finally called in the program (since all the heights are then in "y"). To check the result, compare with the plot generated, as well as compare with what you get when you calculate the maximum height by hand (using the "standard formulas" from physics book). Finally, if you change "n=200" in the code to " n=9 " and run the program again. Why will there then be poorer compliance with hand calculation? Explain briefly. b) In hovering, the velocity vector of the stone will change direction. Define a function "Find_position_given_angle" which finds and prints the x and y coordinates where the stones velocity vector has a desired direction (i.e. angle relative to positive x-axis). In the call on function (at the very bottom of the program) we let this direction here be 20 degrees. Assume that this angle is obtained on the up", ie before the stone reaches its peak. The function should have as input parameters the arrays x and y", the time step "dtw, desired direction on the speed vector requested_anglen, as well as largest acceptable deviation error_limits betweencalculated angle and desired angle (we use 0.4 degrees here, as already set in the call on function). The function should not return any values, but just print x and y the coordinates where the angle is "correct", ie where the calculated angle is between "Requested_angle - error_limit" and "requested_angle + error_limit

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

Machine Learning And Knowledge Discovery In Databases European Conference Ecml Pkdd 2022 Grenoble France September 19 23 2022 Proceedings Part 4 Lnai 13716

Authors: Massih-Reza Amini ,Stephane Canu ,Asja Fischer ,Tias Guns ,Petra Kralj Novak ,Grigorios Tsoumakas

1st Edition

3031264118, 978-3031264115

More Books

Students also viewed these Databases questions

Question

Apply your own composing style to personalize your messages.

Answered: 1 week ago

Question

Format memos and e-mail properly.

Answered: 1 week ago