Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Backirrownd There is an excel spreadsheet on Moodle called ELA Dec 2022 Data v2-MNTttlst. This spreadsheet shows real generation data for NorthWestern's balancing authority area

image text in transcribed
image text in transcribed
image text in transcribed
Backirrownd There is an excel spreadsheet on Moodle called ELA Dec 2022 Data v2-MNTttlst. This spreadsheet shows real generation data for NorthWestern's balancing authority area during December 2022. The data includes hourly generation values in megawatts for fuel types of coal, natural gas, oil (which is really petroleum coke), solar, hydro, and wind. Check out the graph included in the spreadsheet. The x axis is time and the y axis is megawatts (MW, a unit of power). This data is publicly available on the US Energy Information Administration's website. The same data in the spreadsheet has been saved for you in a Matlab file as December 2022 NWMT Energy by Fuel.mat. This Matlab data file contain six column vectors for each of the six fuel types. For each fuel type there are 744 rows, one row for every hour in the month of December ( 24 hours per day * 31 days =744 hours in December). Each row is the generation value of that foel type for that hour. For example: - Row I of Coal is the MW value of power generated by NorthWestern's coal power plants in the first hour of day one. - Row 25 of Solar is the MW value of power generated by NorthWestem's solar farms in the first hour of day two. - Row 48 of Hydro is the MW value of power generated by NorthWestem's hydro dams in the last hour of day two; ete. Coding Fask Edit the skeleton script from Moodle for this exercise. 1. Load the December 2022 NWMT Energy by Fuel.mat data using Matlab's load command. You should have six variables of dimensions 744x1 for each fuel type in your Workspace. 2. Reshape the fuel data so that there will be 24 rows for each hour of the day and 31 columns for cach day of the month of December, Each fucl variable will be configured as a 2431 array. Overwrite the original variable natnes with your reshaped data. At this point, you should have six variables of dimensions 2431 for each fuel type in your Workspace. 3. Write a function call CalcStats. This function will calculate statistics for a given fuel type. The function should take one input Fuel and return four outputs AvgD, StanDevD, Rng,D atid AvglH. The CaleStats function should do the following: a. For a given variable Fuel, calculate the average generation by day AvgD. Is this a column or row averige calculation? Refer to Exercise 3.1. b. For a given variable Fuel, calculate the standard deviation of generation by day StanDevD. c. For a given variable Fuel, calculate the range of generation by day RngD. d. For a given variable Fuel, calculate the average generation by hour AvgH. Is this a column or row average calculation? Refer to Exercise 3.1. The function definition in your code should take the form below. [AvgD, StandevD, RngD, AvgH] = Calestats (Euel) The CalcStats function should do the following: a. For a given variable Fuel, calculate the average generation by day AvgD. Is this a column or row average calculation? Refer to Exercise 3.1. b. For a given variable Fuel, calculate the standard deviation of generation by day StanDevD. c. For a given variable Fuel, calculate the range of generation by day RngD. d. For a given variable Fuel, calculate the average generation by hour AvgH. Is this a column or row average calculation? Refer to Exercise 3.1. The function definition in your code should take the form below. [AvgD, StanDevD, RngD, AvgH] = Calcstats (Fuel) If you want to test your CaleStats function, call the function with the B variable from Exercise 3.1 to see if you get the same answers. 4. Call the function CaleStats in the main body of your code once for every fuel type. This means that you will have four output variables per fuel type. See the examples below. The function call for Coal should look like [C_MW_AvgD, C_MW_StanDevD, C_MW_RngD, C_MW_AvgH] = CalcStats ( Coal); The function call for Hydro should look like [H_MW_AvgD, H_MW_StanDevD, H_MW_RngD, H_MW_AvgH] = CalcStats (Hydro); The function call for NatGas should look like [N_MW_AvgD, N_MW_StanDevD, N_MW_RngD, Note how the first letter of each output variable is changed to distinguish its fuel type, e.g. C for Coal, H for Hydro, and N for NatGas. Use P for PetroCoke, S for Solar, and W for Wind. Make sure your output variables mateh the naming convention above! This is how you will be graded. After you have called the CalcStats function for each fuel type, you should have an additional 24 variables in your Workspace ( 4 outputs 6 fuel types =24 new variables). Each of these 24 variables describe generation statistics for each fuel type in units of megawatts (MW). 5. After completing Exercise 3.2 turn in the regular script Lab03_Ex3_2_LastnameFirstname.mlx with your first and last name to Moodle. We will use Exercise 3.2 in the next lab when we plot this data! 6. This step is optional! This next step will be included in your next lab. You can complete it now, if you want. It should be pretty simple... Famous last words... The CalcStats function calculated generation statistics in units of MW. What if we wanted the statistics based on percentages of full capability? For example, what percentage of wind is 300MW ? Is that 20%,50%,99% ? To calculate a percentage, we can nommalize the generation data based on the maximum generation amount. Create a function called Normalize that uses the absolute maximum generation of the entire month of input Fuel to nomalize the variables below. You will note that these variables are outputs of CaleStats. a. average generation by day AvgD b. the standard deviation of generation by day StanDevD c. the range of generation by day RngD d. and average generation by hour AvgH. The Normalize function will take five inputs, Fucl, AvgD. StanDevD, RngD, and AvgH, and return four normalized outputs, AvgDN, StanDevDN, RngDN, and AvgHN. The normalized outputs will be calculated by simply dividing the inputs by the Fuel's maximum value (this will just be one number, a sealar, not a vector). The function definition in your code should take the form below. [AvgDN, StanDevDN, RngDN, AvgHN] = Normalize (Euel, AvgD, StanDevD, RngD, Avg H) Call the function Normalize in the main body of your code once for every fuel type as you did in Step 4. The Normalize function will have to be called after the CaleStats function because the outputs of CaleStats are inputs to Normalize. The function call for Coal should look like [C_Norm_AvgD, C_Norm_StanDevD, C_Norm_RngD, C_Norm_AvgH] = Normalize (Coal, C MW_AvgD, C_MW_StanDev D, C_N_RngD,C_MW_Avg) ; The function call for Hydro should look like [H_Norm_AvgD, H_Norm_StanDevD, H_NoIm_RngD, H_Norm_AvgH\} = Normalize (Hydro, H_MW_AvgD, H_MW_StanDe VD, H_MN_RngD, H_MW_Avg); The function call for NatGas should look like [N_Norm_AvgD, N_Norm_StanDevD, N_Norm_RngD, N_Norm_AvgH] = Normalize (NatGas, N_MW_AvgD,N_NW_StanD evD, N_MN_RngD, N_MW_Avg); Note how the first letter of each output variable is changed to distinguish its fuel type, c.g. C for Coal, H for Hydro, and N for NatGas. Use P for PetroCoke, S for Solar, and W for Wind

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Introduction To Constraint Databases

Authors: Peter Revesz

1st Edition

1441931554, 978-1441931559

More Books

Students also viewed these Databases questions

Question

Describe the various sources of export assistance.

Answered: 1 week ago