Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Investigating Power Usage python You are working on a new electronic device. And for this device, it is critical to understand how much power is

Investigating Power Usage

python

image text in transcribedimage text in transcribed

You are working on a new electronic device. And for this device, it is critical to understand how much power is being consumed by each of the 10 components on it But from your test setup, you can not directly measure how much power consumption each component has Instead you can measure how much energy the entire device uses and the duration that each component was operating (e.g. the device consumed 5 millijoules with the microphone operating for 1 second and the screen for 0.5 seconds). Your goal is to calculate the energy consumed per second by each component on the device. You will do this by setting up a linear system and then solving using numpy. nag. solve You will be given a python dictionary called test_data that contains measurements from 10 different tests. Each test is stored as a python list of tuples. (e.g. I'LED,0.58), 'Screen' 'EnergyConsumed',1.2), ...1). The tuple with first entry equal to 'EnergyConsumed' is the energy consumed by the device on that test. The other tuples tell you how much time each component was running for. 24) You will also be given a python list of the components called components. Using these two inputs, build a linear system Ax - b to solve for the energy per second consumption of each component. You may use numpy.linalg.solve to solve your linear system. Return power_usage with entries corresponding to the same order as they show up in components (i.e. if 'Screen' is the first string in components then the first entry of power_usage should be the amount of energy per second that 'Screen' consumes) The setup code gives the following variables: Name test_data components Type a dictionary containing lists of tuples Description see problem statement contains the names of the components a list Your code snippet should define the following variables: Description contains the amount of energy per second used by the corresponding components Name Type power_usag 1D numpy array user_code.py You are working on a new electronic device. And for this device, it is critical to understand how much power is being consumed by each of the 10 components on it But from your test setup, you can not directly measure how much power consumption each component has Instead you can measure how much energy the entire device uses and the duration that each component was operating (e.g. the device consumed 5 millijoules with the microphone operating for 1 second and the screen for 0.5 seconds). Your goal is to calculate the energy consumed per second by each component on the device. You will do this by setting up a linear system and then solving using numpy. nag. solve You will be given a python dictionary called test_data that contains measurements from 10 different tests. Each test is stored as a python list of tuples. (e.g. I'LED,0.58), 'Screen' 'EnergyConsumed',1.2), ...1). The tuple with first entry equal to 'EnergyConsumed' is the energy consumed by the device on that test. The other tuples tell you how much time each component was running for. 24) You will also be given a python list of the components called components. Using these two inputs, build a linear system Ax - b to solve for the energy per second consumption of each component. You may use numpy.linalg.solve to solve your linear system. Return power_usage with entries corresponding to the same order as they show up in components (i.e. if 'Screen' is the first string in components then the first entry of power_usage should be the amount of energy per second that 'Screen' consumes) The setup code gives the following variables: Name test_data components Type a dictionary containing lists of tuples Description see problem statement contains the names of the components a list Your code snippet should define the following variables: Description contains the amount of energy per second used by the corresponding components Name Type power_usag 1D numpy array user_code.py

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

Step: 3

blur-text-image

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

DATABASE Administrator Make A Difference

Authors: Mohciine Elmourabit

1st Edition

B0CGM7XG75, 978-1722657802

More Books

Students also viewed these Databases questions

Question

3. List your top 10 film mentors.

Answered: 1 week ago