Evaluating the locations of charging stations

Assignment Help Other Engineering
Reference no: EM131031347

Tesla Motors recently announced their new model 3, which is a less expensive version of their model S. The company received over a quarter of a million pre-orders. Since the launch, potential buyers have been evaluating the locations of charging stations before they purchase the model 3. You have been hired by Tesla Motors to create a Python script that would provide information about charging station location and distance for potential buyers.

Data provided by NREL (https://developer.nrel.gov/docs/transportation/alt-fuel-stations-v1/all/) on charging station location can be found on D2L in three different formats:

(1) tesla_locations.csv: contains the longitude and latitude of every Tesla charging stations in the US and this file is the simplest and easiest to work with because the data can be directly loaded into a numpy array using numpy.genfromtxt() with the delimiter set to "," and skip_header set to 1,

(2) testa_cities.csv contains the name of the city where the charging station is located - the cities are listed in the same order as the longitude and latitude data. This data file is optional, and can be imported using numpy.genfromtxt, but you need to set dtype='a50' where ‘a' tells numpy the data is a string and 50 is the character import limit.

(3) tesla_data.csv contains one column with the city name and the next two columns contain the latitude and longitude (i.e., this file combines the previous two). This data file is also optional, and can be imported using numpy.genfromtxt() but you need to set dtype=(‘a50','f8','f8').

After you have imported your data, you should use matplotlib to generate a plot with a point for every charging station. Note that the first column of data is longitude, i.e., the y-values, and the second column is latitude, i.e., the x-values, so you need to plot: (second column, first column). The plot should ‘resemble' the US (especially the coasts) if plotted correctly.

Finally, you need to write two functions:

(1) The first function should be passed a current location (longitude, latitude) and the array with all the locations. Then is should loop through all the locations and find the nearest charging station to the current location. It should return the row number for the nearest charging station and the distance in terms of miles (note: you may assume 60 miles per degree of latitude and longitude). There are multiple ways to write this function, but you might find the numpy.argmin() function helpful - returns the index (i.e., row number) of the smallest entry in a vector (e.g., a vector of distances).

(2) The second function should be passed a current location (longitude, latitude) and return either a list of row numbers or a list of cities that are within 60 miles of the current location (i.e., within a radius of 1.0 in terms of degrees of longitude and latitude). Hint: start by creating an empty list (myList = []) and then append() the row number or city name for every charging station within a radius of 1.0. It is easier to just append a row number, but 5 points of extra credit are available if you can return the list of city names.

All distances should be calculated using a Euclidian distance d = √(Δx2 + Δy2), and not that this is not exactly correct as the earth is a sphere and not a flat plane.

Test both functions by using one of the following ‘current locations':

Bozeman [45.6770,-111.0429]

San Francisco [37.7749, -122.4194]

Hence, the first function would return the closest charging station to Bozeman (or SF) and the second function would return the charging stations within 60 miles of Bozeman (or SF).

Reference no: EM131031347

Questions Cloud

Legitimate finite probability model : (i) Verify that this is a legitimate finite probability model. (ii) Describe the event X (iii) Express the event "lifted weights at least once" in terms of X. What is the probability of this event?
The news article nfl-directv-monopoly : The news article "NFL-DirecTV-Monopoly" discusses a legal challenge to an agreement between the National Football League (NFL) and DirecTV giving DirecTV the exclusive right to broadcast out-of-market games.
Which character do you best relate to in this story : What does the Maze represent to you? Which character do you best relate to in this story, Sniff and Scurry, Hem or Haw?
Facts about percents or proportions : Problem: Overweight? Although the rules of probability are just basic facts about percents or proportions, we need to be able to use the language of events and their probabilities. Choose an American adult at random. Define two events:
Evaluating the locations of charging stations : Tesla Motors recently announced their new model 3, which is a less expensive version of their model S. The company received over a quarter of a million pre-orders. Since the launch, potential buyers have been evaluating the locations of charging s..
Logical grouping of business units to operate efficiently : Departmentalization is the logical grouping of business units to operate efficiently. An organization can split its departments in many ways. Consider a company that develops software. How might this organizational structure change if the software co..
Determining the rule of probability : What percent of those who took the test in 2009-2010 majored in either engineering or science? Which rule of probability did you use to find the answer?
Student live on campus or off campus : (i) Does the student live on campus or off campus? (ii) What is the student's age in years? (iii) Ask how much money in coins (not bills) the student is carrying. (iv) Record the student's letter grade at the end of the course.
What is the equilibrium price of the good before trade : What is the equilibrium price of the good before trade? After trade, how many units of the good will be imported? How much did the consumer surplus grow with trade? How much did the total surplus grow with trade?

Reviews

Write a Review

Other Engineering Questions & Answers

  Paper on new trends in ic packaging

Write a two page report based on the paper on New Trends in IC Packaging - the subject is Microelectronics Fabrication.

  The importance of impedance, rise-time and bandwidth

Discuss the connection between rise-time and bandwidth in amplifier circuits.

  How many grams of lead shot of density

A tin can has a total volume of 1300cm3 and a mass of 160 g. How many grams of lead shot of density 11.4 g/cm3 couldit carry without sinking in water?

  Assignment on ttp1 for assign the experts

This plan must include each of the seven Integrated Team Projects and the TPP-2, including individual assignments, with leadership assigned to each assignment and working assignments for each team member.

  Find low-frequency value of overall differential gain

The amplifier is fed in a symmetrical fashion with a source resistance of 10 kΩ in series with each of the two input terminals. Sketch the differential half-circuit and its high-frequency equivalent circuit.

  Determine the largest number of crates

The 3-Mg rear-wheel-drive skid loader has a center of mass at G. Determine the largest number of crates that can be pushed by the loader if each crate has a mass of 500 kg.

  Describe how data is transmitted using amplitude modulation

Describe how data is transmitted using Amplitude Modulation and Describe how data is transmitted using Frequency Modulation

  Compare performances of above mentioned configurations

Compare the performances of the above mentioned configurations. Identify the best configurations which functions as a diode with suitable justification.

  Determine the ratio uo-umax

Water flows steadily through the round pipe in the figure. The entrance velocity is Vo. The exit velocity approximates turbulent flow, u = umax(1 - r/R) 1/7. Determine the ratio Uo/umax for this incompressible flow.

  Effects of heat and acid on bone

As you have learned, bones are a key component in the strength and support of the body. Remarkably, bones are fairly light weight but can resist large amounts of stress. Within the bone, collagen fibers provide the strength and flexibility that bones..

  How rayleigh scattering occurs in optical fiber cable

how rayleigh scattering occurs in optical fiber cable? explain

  What type of loading arrangements found on a roadheader

Design a suitable ore pass to transport ore a vertical distance of 200m from  the extraction level to the transport level of a block caving mining operation.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd