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

  Characterization technology for nanomaterials

Calculate the reciprocal lattice of the body-centred cubic and Show that the reciprocal of the face-centred cubic (fcc) structure is itself a bcc structure.

  Calculate the gasoline savings

How much gasoline do vehicles with the following fuel efficiencies consume in one year? Calculate the gasoline savings, in gallons per year, created by the following two options. Show all your work, and draw boxes around your answers.

  Design and modelling of adsorption chromatography

Design and modelling of adsorption chromatography based on isotherm data

  Application of mechatronics engineering

Write an essay on Application of Mechatronics Engineering

  Growth chracteristics of the organism

To examine the relationship between fermenter design and operating conditions, oxygen transfer capability and microbial growth.

  Block diagram, system performance and responses

Questions based on Block Diagram, System Performance and Responses.

  Explain the difference in a technical performance measure

good understanding of Mil-Std-499 and Mil-Std-499A

  Electrode impedances

How did this procedure affect the signal observed from the electrode and the electrode impedances?

  Write a report on environmental companies

Write a report on environmental companies

  Scanning electron microscopy

Prepare a schematic diagram below of the major parts of the SEM

  Design a pumping and piping system

creating the pumping and piping system to supply cool water to the condenser

  A repulsive potential energy should be a positive one

Using the data provided on the webvista site in the file marked vdw.txt, try to develop a mathematical equation for the vdW potential we discussed in class, U(x), that best fits the data

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