Assignment3&4_ENGR103 (1)

.pdf

School

Oregon State University, Corvallis *

*We aren’t endorsed by this school

Course

103

Subject

Industrial Engineering

Date

May 14, 2024

Type

pdf

Pages

6

Uploaded by CoachLightning14257 on coursehero.com

World power / Hydropower Consumption Calculation ENGR 103 Spring 2024 Assignment #3&4 HW3 (Part 1) Due Thursday, April 25th, 2024, at 11:59 pm HW4 (Part 2) Due Thursday, May 2nd, 2024, at 11:59 pm Assignment Overview and Outcomes The focus of this homework is on how to solve simple problems using programming language asking for user input, loading a data set, creating arrays and lists, and using loops to preform your computations on the dataset. At the end of this project, you will: Develop a program to read data from user input and produce data to the standard output. Develop a program to read in a dataset, translate a given mathematical expression to syntactically correct programming statements, and loop over the dataset to perform the mathematical operations. Write a program that conforms to a programming style specified by the instructor. Be sure to properly document the program. Consult the class Programming Style Guidelines document (provided by the instructor) for style expectations. You can either use a .md block or the ### block to document the attributes of your program. A well-written program is easier to debug, easier to maintain over time, and easier to extend as new requirements arise. Sustainability Motivation The United Nations (UN) has set forth 17 goals for sustainable development . Goal 7 is designed to “Ensure access to affordable, reliable, sustainable and modern energy for all”. Access to energy resources is necessary for quality of life, including jobs, agriculture, and climate-related issues. Energy resources includes electricity as well as access to clean, renewable fuels and the technologies for harnessing and distributing energy. There are a number of renewable, clean energy sources available. In this project, we will consider hydro power as a renewable energy source . Hydropower Technology Background Hydropower, otherwise known as hydroelectric power, offers a number of advantages to the communities that they serve. Hydropower and pumped storage continue to play a crucial role in our fight against climate change by providing essential power, storage, and flexibility services. Hydropower is a renewable source of energy. The energy generated through hydropower relies on the water cycle, which is driven by the sun, making it renewable. Hydropower is fueled by water, making it a clean source of energy. Hydroelectric power is a domestic source of energy, allowing each state to produce its own energy without being reliant on international fuel sources. Hydropower provides benefits beyond electricity generation by providing flood control, irrigation support, and clean drinking water. However, it is important to note that building dams has its tradeoffs it does cut off habitat access and sediment supply through the river system which have implications of coastal erosion and consequences to fish population dynamics. https://www.energy.gov/eere/water/benefits-hydropower Watch this short video about hydropower showing both the benefits and the drawbacks ( link ). Calculate the Energy consumed from hydroelectric power and how it has changed through time around the world:
World power / Hydropower Consumption Calculation ENGR 103 Spring 2024 Program to Write and Expected output: Your program will compute as test cases (but your program should be general, i.e. handle any year or any power type): 1. the total increase in world power generation from year 2000 to 2021. 2. the fraction of total world energy produced from hydroelectric power in any given year, 3. the change in hydroelectric between two years (2000 and 2021). 4. the fraction of total world energy produced from two other power sources of your choice (e.g. solar, wind, bio., nuclear, coal, gas) in the two years, and the change between any two years. You will be given a dataset that has the following for the world from 2000 to 2021, see canvas energy_use_terrawatthours.csv World Year Energy source notes: Clean* vs Fossil** Broken down by energy source: *Clean is composed of total sum of Bioenergy, Hydro, Nuclear, Other Renewable, Solar, Wind **Fossil is composed of total sum of Coal, Gas, Other Fossil Total World Energy = Clean + Fossil Generation in terawatt-hours Instructions: To perform your computation, you will need to think about how to break the dataset down into manageable pieces and what types of things you will need to help the computer to identify in order to perform your computation. You will need to read the dataset into Python. You will need to perform your computation of hydro-power and another power type by asking for the User of your program for input from a list of power type options they can choose from. You will be using if statements - if statements help you to identify one string from another. You will be using a for loop - a for loop will help you to move through the dataset line-by-line and allocate the data into an array . You will print out a statement to the user telling them that total world power consumption in 2000 was ___ terawatt-hours and in 2021 the consumption has increased to ___ terawatt-hours. That means world power generation has increased by ___% over the past 20 years. You will print a statement out to the user telling them that in year 2000 ___% of world energy came from hydropower (or other depending on user input) and in 2021 ___% of world energy came from hydropower (or other depending on user input). Your program should be designed to handle computations for any combination of years. This means that you should not write any of the numbers directly into your print statements (i.e., do not hardcode any numbers in your program output), instead print out the variable where the number is stored. ***Your program should define two functions and call the functions that you write to perform their computations . o You should have a function that finds and returns the power for a given year for any type. You should then call this function to find the power for a given year of any type. o You should have a function that finds and returns the total world power for any given year. You should call this function and use it as needed. Recall, world power = clean + fossil. o You should have a function that computes the fraction of any specific energy source is of the total world power for any given year. So, your function should have inputs: energy type, year, and the energy_use dataset.
World power / Hydropower Consumption Calculation ENGR 103 Spring 2024 Reminders: How to define a function: ( def is a keyword that defines the function) def function_name(input, input, input, …): code return output, output, … How to define a for loop: ( for and in are keywords, x is the index, y is the array, range and len are functions ) for x in range ( len (y)): stuff in loop How to define an if statement: (==, >=, <=, >, <, etc.) if X == Y: then will do something
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help