A sample of the data provided in the Microsoft Excel file EnergyData.xlsx online follows. The file contains energy consumption data by energy source per year in the United States, measured in petaBTUs.
a. Write the MATLAB code necessary to read the Microsoft Excel file and store each column of data into different variables. Create the following:
- Yr: A vector of all of the years in the worksheet.
- FF: A vector of all of the fossil fuels for each year in Yr.
- ENI: A vector of all electric imports for each year in Yr.
- Nuc: A vector of all nuclear energy consumption for each year in Yr.
- Ren: A vector of all renewable energy consumption for each year in Yr.
- Hdr: A cell array of all of the headers in row 1.
You may not hard-code these variables—they should be imported from the Excel file.
b. Create a new variable. Totalconsumption, which contains the sum of the four columns of energy consumption data for each year. In other words, since all five of the
c. Calculate the average fossil fuel consumption in the entire data set. For this code, you may assume that you have correctly defined FF, the variable containing the fossil fuel consumption data, in part (a). Display the result of the calculation in the following format, where the number is shown to two decimal places:
The average fossil fuel consumption is _____ petaBTU.
Want to see the full answer?
Check out a sample textbook solutionChapter 17 Solutions
Thinking Like an Engineer: An Active Learning Approach (4th Edition)
- I need help with a MATLAB code. I need to find two values of n, one that is positive and one that is negative, that will give all negative real roots. Can you help me find them? function [r] = find_roots(n) % Define constants I = 400; J = 150; x = (J/I) - 1; y = n - 1; Q = y + x*(y-1); % Define the coefficients of the quadratic equation coefficients = [1, 0, (3*x+Q^2+1), 0, (3*x*Q+Q^2)]; % Find the roots r = roots(coefficients); endarrow_forwardconvert height to cm File Edit View Insert Format Data Tools 100% % .0 .00 123 D20 fx | A 1 5 feet 2 11 inches 3 cm 4 The preceding image shows a Google Sheet used to convert length in feet and inches to cm. What formula should be entered into A3 so that the correct length is computed in cm (in cell A3)? Your answer must work with any values the user might enter in cells A1 and A2. Choose all that apply a) = A1*12*2.54 + A2*2.54 b) = (5*12 + 11) * 2.54 %3D c) = B1*12*2.54 + B2*2.54 d) A1*12*2.54 + A2*2.54 e) = (A1*12 + A2) * 2.54 f) = A1*12 + A2 * 2.54 %24 田arrow_forwardFor the Following question Graph all 4 : [I just need all 4 graphs and please explain and make clean solution] Position vs time Velocity vs time Acceleration vs time Force vs time [For your convenience, I have solved the numerical solutions for the problem] (Please Look at the picture since it is much cleaner) Question : A 550 kilogram mass initially at rest acted upon by a force of F(t) = 50et Newtons. What are the acceleration, speed, and displacement of the mass at t = 4 second ? a =(50 e^t)/(550 ) [N/kg] v = ∫_0^t▒(50 e^t )dt/(550 )= v_0 +(50 e^t-50)/550=((e^t- 1))/11 x = ∫_0^t▒(e^t- 1)dt/(11 )= x_0 +(e^t- t - 1)/(11 ) a(4s)=(50*54.6)/550= 4.96[m/s^2 ] v(4s)=((e^4-1))/11= 4.87[m/s] x(4s)=((e^4- 4 - 1))/11= 4.51 [m]arrow_forward
- 4:16 Search Expert Q&A Done Please solve question 16-109 below this in the follwoing way: • Please include a kinamatic diagram (one for velocity and one for acceleration). • Please DO NOT solve this using velocity analysis (cartesian vector analysis). I would like it to be solved using scalar method. We dont use 3D in this course. We only use scalar analysis for the relative velocity equation (writing the x and y components of the equation and solving the equations for the unknowns). I have attached a sample question with solution in order to get an idea on how to use the scalar method to solve my question. I would like question 16-109 to be solved in a similar way. Thank you for your understanding. If you can solve it as soon as possible that would be great and I will give you a thumps up and positive feedback :) 16-109. Member AB has the angular motions shown. Determine the angular velocity and angular acceleration of members CB and DC. 100 mm D 60° 450 mm W AB α AB 84 = 2 rad/s = 4…arrow_forwardA member of your team gives you the following MATLAB program. Your job is to create the function used in the program. H = 30; % height [cm] V = 50; % volume [cm^3] % calculates the radius [cm] of a cone R2 = RadiusCone(H,V);arrow_forwardI need a MATLAB code that uses image segmentation to take this photo and single out the weeds in the yard. It also needs to calculate the number of pixels/percentage of the pixels that are in the weeds. Please provide notes in the lines as well so it is easy to follow and understand. Thank you for your help!arrow_forward
- Given: Mass = M, Radius = R, Moment of Inertia = I, Distance = H, Gravity = g, Initial timing = 0 Unknown = How long will the [delta t] process take? (time) Please keep in mind that almost every variable is unknown! We are given no numbers and are instructed to generate a solution using the variables [ "R, M, g, I and H." ] Target = Find an equation that, if we could substitute numbers, would determine how long the process would take. Newton's second law and torque seem to be relevant based on how the problem is written. * Also please show drawing based on what we are calculatingarrow_forwardThe following tools / resources may be useful for you to complete the assignment:a. Chatgpt (You may use it to learn Matlab coding or any other computer language. An example is given here: https://shareg.pt/mXHGne9 ). Please take note that code generated by chatgpt can be directly copied and pasted.b. Matlabi) Useful cheat sheet (https://n.ethz.ch/~marcokre/download/ML-CheatSheet.pdf)ii) Getting started with Matlab (https://matlabacademy.mathworks.com/en/details/gettingstarted )iii) Getting 30-day Matlab trial license (https://www.mathworks.com/campaigns/products/trials.html ) iv) Polyfit (https://www.mathworks.com/help/matlab/ref/polyfit.html )v) Exponential Fit (https://www.mathworks.com/matlabcentral/answers/91159-how-do-i-fit-an-exponential-curve-to-my-data)c. PlotDigitizer (https://plotdigitizer.sourceforge.net/ ) or a free online app that does not requires installation (https://plotdigitizer.com/app )You may use your own engineering judgement to make any assumptions on any…arrow_forwardPlease include a kinamatic diagram (for velocity) Please DO NOT solve this using velocity analysis (cartesian vector analysis). I would like it to be solved using scalar method. We dont use 3D in this course. We only use scalar analysis for the relative velocity equation as requested in the question (writing the x and y components of the equation and solving the equations for the unknowns). Below I have attached a sample question with solution in order to get an idea on how to use the scalar method to solve my question. I would like question this to be solved in a similar way. Thank you for your understanding. If you can solve it as soon as possible that would be great and I will give you a thumps up and positive feedback :)arrow_forward
- For the position-time graph shown, pick the corresponding velocity-time graph. Velocity Position Time (s) Black dot line (right): Red dot line (left); Yellow solid line (right): Cyan dash line (left); Blue solid line (left): Time (s) Velocity Time (s)arrow_forwardPlease provide equations that you are using so I can follow along and learn how to do this and include conversions and units. In Jamestown, NY, a coal power plan consumes coal at a rate of 80 tons/hr. When coal burns, it generates approximately 30,000 kJ for every kg of coal burned. The cooling course for the plant is the nearby Chadakoin River nearby and, by code, the power plant cannot reject more than 13.19 x 109 MJ into the river annually. Determine the maximum average power output of this plant and it's maximum thermal efficiency. To check your work, enter the efficiency, as a decimal, in the box provided.arrow_forwardScenario You are assigned a role as a mechanical engineer for a vehicle design manufacturing company. Your department has a software to perform numerical differentiation and integration. To be able to verify the results of using the software and validate these results, your department manager has asked you to analytically perform some tasks to validate the results generated by the software. Q: is the last two digits of your student Id number. If your number is (20110092) then Q=92. P: is the last digit of your student Id Number. If your number is (20110092) then P=2, If that digit equals zero then use P=1. Example: If your number is (20110040) then P=1. Task 1 Determine the gradient of following functions at the given points: a) x(t) = (2t7 + P t-2)² + (6vi – 5) when t = 1 5s+7 b) v(s) = when s = 3 (s²-P)2 c) i(t) = 5(1 – In(2t – 1) ) when t= 1 sec. d) V(t) =5sin(100nt + 0.2) Volts , find i(t) = 10 × x10-6 dV©) Ampere when t= 1ms. dt e) y(t) = e¬(t-n) sin(Qt + P) when t = n radian f)…arrow_forward
- Elements Of ElectromagneticsMechanical EngineeringISBN:9780190698614Author:Sadiku, Matthew N. O.Publisher:Oxford University PressMechanics of Materials (10th Edition)Mechanical EngineeringISBN:9780134319650Author:Russell C. HibbelerPublisher:PEARSONThermodynamics: An Engineering ApproachMechanical EngineeringISBN:9781259822674Author:Yunus A. Cengel Dr., Michael A. BolesPublisher:McGraw-Hill Education
- Control Systems EngineeringMechanical EngineeringISBN:9781118170519Author:Norman S. NisePublisher:WILEYMechanics of Materials (MindTap Course List)Mechanical EngineeringISBN:9781337093347Author:Barry J. Goodno, James M. GerePublisher:Cengage LearningEngineering Mechanics: StaticsMechanical EngineeringISBN:9781118807330Author:James L. Meriam, L. G. Kraige, J. N. BoltonPublisher:WILEY