Question
PLEASE RESPOND WITH COMPLETE PYTHON CODE I WILL RATE AND MAKE SURE THE PYTHON CODE RESULT IS SIMILAR TO THE SAMPLE RUN A hiker needs
PLEASE RESPOND WITH COMPLETE PYTHON CODE I WILL RATE AND MAKE SURE THE PYTHON CODE RESULT IS SIMILAR TO THE SAMPLE RUN
A hiker needs to cross a sandy area in order to get from point A to a camp site at point B. She can do so by crossing the sand perpendicular to the trail and then walking along the trail (red arrow path), or by crossing the sand at an angle up to the trail, and then walking along the trail (blue arrow path). The hiker can walk 3.5 km/h in the sand and 5 km/h on the trail. Determine the time it will take her to reach the camp site for angle from 0 to 60 in 5 increments. Part 1: Write a Python script that fulfills these specifications: Uses a NumPy vector to hold the angle values. Determines the total time t (in hours) needed to hike from point A to point B for each angle . Note: Do not calculate the results by individually plugging in angle values one at a time. Instead, use NumPys built-in element-wise array operators and functions to do this operation efficiently. Displays a table of the calculated values, with the angle in the first column and calculated time t in the second column. The columns should have labels to indicate what they represent. o Do NOT use for or while loops for printing the table. You can simply display an appropriately constructed array. It wont look very nice, but it will be sufficient. o OPTIONAL: If you want to be fancier and have Anaconda or Miniconda installed on your own computer, try the tabulate module. It has to be installed into your environment first by using conda install tabulate at the Anaconda Prompt. Do NOT use pip install! Generates a plot that fulfills these requirements: o Displays the hiking time t (vertical axis) versus the angle (horizontal axis) o Has labeled axes and a descriptive title Save the script using this file name: hw1_p1.py
Problem #1 A hiker needs to cross a sandy area in order to get from point A to a camp site at point B. She can do so by crossing the sand perpendicular to the trail and then walking along the trail (red arrow path), or by crossing the sand at an angle 0 up to the trail, and then walking along the trail (blue arrow path). The hiker can walk 3.5 km/h in the sand and 5 km/h on the trail. Determine the time it will take her to reach the camp site for angle 0 from 0 to 60 in 5 increments. trail area The distances w and u are: w sandy area w = 4.5 km and u = 14 km A Part 1: . . o Write a Python script that fulfills these specifications: Uses a NumPy vector to hold the angle values. Determines the total time t (in hours) needed to hike from point A to point B for each angle 0. Note: Do not calculate the results by individually plugging in angle values one at a time. Instead, use NumPy's built-in element-wise array operators and functions to do this operation efficiently. Displays a table of the calculated values, with the angle 0 in the first column and calculated time t in the second column. The columns should have labels to indicate what they represent. Do NOT use for or while loops for printing the table. You can simply display an appropriately constructed array. It won't look very nice, but it will be sufficient. OPTIONAL: If you want to be fancier and have Anaconda or Miniconda installed on your own computer, try the tabulate module. It has to be installed into your environment first by using conda install tabulate at the Anaconda Prompt. Do NOT use pip install! Generates a plot that fulfills these requirements: o Displays the hiking time 1 (vertical axis) versus the angle 0 (horizontal axis) Has labeled axes and a descriptive title Save the script using this file name: hw1_p1.py O o Sample Run: Theta (deg) Time (hr) 4.08571 5 4.01189 10 3.94685 15 3.88992 20 3.84066 25 3.79895 30 3.765 35 3.73938 40 3.72319 45 3.71827 50 3.72764 55 3.75624 60 3.81258 Time to hike from Point A to camp site at point B 4.10 4.05 4.00 3.95 Timet (hours) 3.90 3.85 3.80 3.75 3.70 0 10 20 40 50 60 30 Angle (degrees)Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started