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

  Calculate the apparent free energy of formation

From the standard Flade potential for iron, calculate the apparent free energy of formation of the passive fi lm per gram - atom of oxygen. Do the same for nickel and chromium.

  Determine the minimum acceptable wall thickness

Determine the minimum acceptable wall thickness using thin cylinder theory and determine the minimum acceptable wall thickness using thick cylinder simulation software.

  Analyze energy and economic performance

Start reading about your Sun Shot homework on the Sun Shot website - Provide a complete as possible analysis of your assigned Sun Shot initiative homework.

  Diameter ratio of the meter

The pressure drop in a venturi meter varies only with the fluid density, pipe approach velocity, and diameter ratio of the meter. A model venturi meter tested in water at 20°C shows a 5-kPa drop when the approach velocity is 4 m/s.

  The similarities and differences between xml and html

What is your current knowledge level of this course topic and what do you hope to learn before the course is over?

  Prepare the irb process

On the Institutional Review Board iGuide site, you will find all of the information you need regarding the IRB process.

  Problem based on simple interest realted issues

Is there a difference in average selling price based on whether the house is on the water front or not?

  Problems based on voip traffic engineering

What access link bandwidth (Kbps from the online calculator) is required to connect the company's location to the Internet?

  Design the appropriate architecture for the project

You are required to design an energy meter based on CPLD (Complex Programmable Logic Device) that will smartly disconnect the supply when sufficient amount of energy units are consumed. The device needs to be programmed using VHDL computing language.

  Speech encoder using the lpc algorithm

1. Write a speech encoder using the LPC algorithm. You must implement your own LPCcode. You must not use any MATLAB toolboxes { use the 'which' command in MATLABto check if a function is built-in or contained in a toolbox. Use the following parame..

  Given an inclined plane

Given an inclined plane, if the length of the inclined plane equals 14 feet and the vertical height equals 5 feet, what is the mechanical advantage?

  Undertake a tunnel blast design for the conditions

Design a coal overburden throw/cast blast for the situation - Undertake a tunnel blast design for the conditions

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