Moozonian
Web Images Developer News Books Maps Shopping Moo-AI
Showing results for WETS PNG PNG
GitHub Repo https://github.com/Hamida-del/Course-Project-2

Hamida-del/Course-Project-2

Course Data Fine particulate matter (PM2.5) is an ambient air pollutant for which there is strong evidence that it is harmful to human health. In the United States, the Environmental Protection Agency (EPA) is tasked with setting national ambient air quality standards for fine PM and for tracking the emissions of this pollutant into the atmosphere. Approximatly every 3 years, the EPA releases its database on emissions of PM2.5. This database is known as the National Emissions Inventory (NEI). Additional information about the NEI can be found at the EPA National Emissions Inventory web site. The NEI project data was downloaded and loaded into the environment as shown below. exdata_filename <- "exdata-data-NEI_data.zip" if (!file.exists(exdata_filename)) { download_url <- "https://d396qusza40orc.cloudfront.net/exdata%2Fdata%2FNEI_data.zip" download.file(download_url, destfile = exdata_filename) unzip (zipfile = exdata_filename) } if (!exists("NEI")) { # print("Loading NEI Data, please wait.") NEI <- readRDS("summarySCC_PM25.rds") } if (!exists("SCC")) { # print("Loading SCC Data.") SCC <- readRDS("Source_Classification_Code.rds") } PM2.5 Emissions Data (summarySCC_PM25.rds) contains a data frame with all of the PM2.5 emissions data for 1999, 2002, 2005, and 2008. For each year, the table contains number of tons of PM2.5 emitted from a specific type of source for the entire year. Here are the first few rows. head(NEI) ## fips SCC Pollutant Emissions type year ## 4 09001 10100401 PM25-PRI 15.714 POINT 1999 ## 8 09001 10100404 PM25-PRI 234.178 POINT 1999 ## 12 09001 10100501 PM25-PRI 0.128 POINT 1999 ## 16 09001 10200401 PM25-PRI 2.036 POINT 1999 ## 20 09001 10200504 PM25-PRI 0.388 POINT 1999 ## 24 09001 10200602 PM25-PRI 1.490 POINT 1999 The PM2.5 variables are as follows: fips: A five-digit number (represented as a string) indicating the U.S. county SCC: The name of the source as indicated by a digit string (see source code classification table) Pollutant: A string indicating the pollutant Emissions: Amount of PM2.5 emitted, in tons type: The type of source (point, non-point, on-road, or non-road) year: The year of emissions recorded The Source Classification Table (Source_Classification_Code.rds) provides a mapping from the SCC digit strings in the Emissions table to the actual name of the PM2.5 source. head(SCC[,c("SCC", "Short.Name")]) ## SCC ## 1 10100101 ## 2 10100102 ## 3 10100201 ## 4 10100202 ## 5 10100203 ## 6 10100204 ## Short.Name ## 1 Ext Comb /Electric Gen /Anthracite Coal /Pulverized Coal ## 2 Ext Comb /Electric Gen /Anthracite Coal /Traveling Grate (Overfeed) Stoker ## 3 Ext Comb /Electric Gen /Bituminous Coal /Pulverized Coal: Wet Bottom ## 4 Ext Comb /Electric Gen /Bituminous Coal /Pulverized Coal: Dry Bottom ## 5 Ext Comb /Electric Gen /Bituminous Coal /Cyclone Furnace ## 6 Ext Comb /Electric Gen /Bituminous Coal /Spreader Stoker Questions and Answers The project aims to answer the questions listed below. The answers to the questions are illustrated in the plots following each question. Question #1: Have total emissions from PM2.5 decreased in the United States from 1999 to 2008? Using the base plotting system, make a plot showing the total PM2.5 emission from all sources for each of the years 1999, 2002, 2005, and 2008. total_annual_emissions <- aggregate(Emissions ~ year, NEI, FUN = sum) color_range <- 2:(length(total_annual_emissions$year)+1) with(total_annual_emissions, barplot(height=Emissions/1000, names.arg = year, col = color_range, xlab = "Year", ylab = expression('PM'[2.5]*' in Kilotons'), main = expression('Annual Emission PM'[2.5]*' from 1999 to 2008'))) Question #2: Have total emissions from PM2.5 decreased in the Baltimore City, Maryland ( fips == “24510”) from 1999 to 2008? Use the base plotting system to make a plot answering this question. b_total_emissions <- NEI %>% filter(fips == "24510") %>% group_by(year) %>% summarise(Emissions = sum(Emissions)) with(b_total_emissions, barplot(height=Emissions/1000, names.arg = year, col = color_range, xlab = "Year", ylab = expression('PM'[2.5]*' in Kilotons'), main = expression('Baltimore, Maryland Emissions from 1999 to 2008')) ) Question #3: Of the four types of sources indicated by the (point, nonpoint, onroad, nonroad) variable, which of these four sources have seen decreases in emissions from 19992008 for Baltimore City? Which have seen increases in emissions from 19992008? Use the ggplot2 plotting system to make a plot answer this question. b_emissions <- NEI %>% filter(fips == "24510") %>% group_by(year, type) %>% summarise(Emissions=sum(Emissions)) b_em_plot <- ggplot(data = b_emissions, aes(x = factor(year), y = Emissions, fill = type, colore = "black")) + geom_bar(stat = "identity") + facet_grid(. ~ type) + xlab("Year") + ylab(expression('PM'[2.5]*' Emission')) + ggtitle("Baltimore Emissions by Source Type") print(b_em_plot) Question #4: Across the United States, how have emissions from coal combustion-related sources changed from 1999 to 2008? coal_SCC <- SCC[grep("[Cc][Oo][Aa][Ll]", SCC$EI.Sector), "SCC"] coal_NEI <- NEI %>% filter(SCC %in% coal_SCC) coal_summary <- coal_NEI %>% group_by(year) %>% summarise(Emissions = sum(Emissions)) c_plot <- ggplot(coal_summary, aes(x=year, y=round(Emissions/1000,2), label=round(Emissions/1000,2), fill=year)) + geom_bar(stat="identity") + ylab(expression('PM'[2.5]*' Emissions in Kilotons')) + xlab("Year") + geom_label(aes(fill = year),colour = "white", fontface = "bold") + ggtitle("Coal Combustion Emissions, 1999 to 2008.") print(c_plot) Question #5: How have emissions from motor vehicle sources changed from 1999 to 2008 in Baltimore City? scc_vehicles <- SCC[grep("[Vv]ehicle", SCC$EI.Sector), "SCC"] vehicle_emissions <- NEI %>% filter(SCC %in% scc_vehicles & fips == "24510") %>% group_by(year) %>% summarise(Emissions = sum(Emissions)) png("plot5.png", width = 640, height = 480) v_plot <- ggplot(coal_summary, aes(x=year, y=round(Emissions/1000,2), label=round(Emissions/1000,2), fill=year)) + geom_bar(stat="identity") + ylab(expression('PM'[2.5]*' Emissions in Kilotons')) + xlab("Year") + geom_label(aes(fill = year),colour = "white", fontface = "bold") + ggtitle("Baltimore Vehicle Emissions, 1999 to 2008.") print(v_plot) Question #6: Compare emissions from motor vehicle sources in Baltimore City with emissions from motor vehicle sources in Los Angeles County, California ( == “”). Which city has seen greater changes over time in motor vehicle emissions? fips_lookup <- data.frame(fips = c("06037", "24510"), county = c("Los Angeles", "Baltimore")) vehicles_SCC <- SCC[grep("[Vv]ehicle", SCC$EI.Sector), "SCC"] vehicle_emissions <- NEI %>% filter(SCC %in% vehicles_SCC & fips %in% fips_lookup$fips) %>% group_by(fips, year) %>% summarize(Emissions = sum(Emissions)) vehicle_emissions <- merge(vehicle_emissions, fips_lookup) bcv_plot <- ggplot(vehicle_emissions, aes(x = factor(year), y = round(Emissions/1000, 2), label=round(Emissions/1000,2), fill = year)) + geom_bar(stat = "identity") + facet_grid(. ~ county) + ylab(expression('PM'[2.5]*' Emissions in Kilotons')) + xlab("Year") + geom_label(aes(fill = year),colour = "white", fontface = "bold") + ggtitle("Los Angeles vs Baltimore Vehicle Emissions.") print(bcv_plot)
GitHub Repo https://github.com/giocascardo/SIMULATION-OF-CAR-MOVEMENT-IN-RAIN-AND-DRY-WEATHER

giocascardo/SIMULATION-OF-CAR-MOVEMENT-IN-RAIN-AND-DRY-WEATHER

# F1 Rain Braking Simulation MATLAB simulation of an F1 car braking in dry (μ=0.9) and wet (μ=0.6) conditions. Models longitudinal dynamics, outputs speed/distance graphs. Useful for F1 telemetry and race strategy. Scalable for ABS or tire models. [Run `braking_simulation.m` to generate results.](results/speed_plot.png)
GitHub Repo https://github.com/Craig-Venables/Data_sorting

Craig-Venables/Data_sorting

Decide weter the data show is usable or not, if it is, makes a copy of this in a usefull place save the "yes" as png in the correct location too