Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

I NEED THE ANSWER TO PART A DOESNT MATTER HOW I GET IT BUT IT SAYS TO USE MATLAB

ID: 3575430 • Letter: I

Question

I NEED THE ANSWER TO PART A DOESNT MATTER HOW I GET IT BUT IT SAYS TO USE MATLAB WHICH MAY BE ONLY WAY TO SOLVE IT.

The power company tracks its power output (Watts) every 12 minutes, resulting in the data below for one day (from 0 to 1440 minutes).

P=[ 1806 1001 2080 336 152 211 410 811 755 630 1350 239 367 1578 2149 2436 1428 2493 1384 1289 827 1076 1230 178 2220 162 1091 2067 987 1534 7368 7977 8381 1718 2328 8081 5341 4535 5516 7375 4788 1819 4086 3852 8695 2481 2782 2881 1388 2068 2227 626 2249 2780 1706 3346 2926 1441 1817 1546 3103 2938 1722 2776 3781 3137 2823 438 1560 2364 1838 2020 915 3337 9630 8638 7810 6691 5003 2180 5717 1222 6712 5996 5600 5640 7526 8970 4352 8323 6174 5202 8639 9770 9081 1081 5170 1432 5594 4688 7667 8488 9169 9870 5052 1358 504 2540 2929 3815 415 1308 1585 856 1693 2953 2204 1710 1280 2260 1199];

The relationship between energy (Joules) and power (Watts) is that energy is the integral of power with respect to time:

E=Pdt

USE CUMTRAPZ

A. Use numerical integration to determine how much energy (Joules) was consumed by the community over the course of the day. Make sure the time interval is in seconds and enter all significant digits.

Explanation / Answer

Below is the matlab code:

clear all;
close all;
P=[1806 1001 2080 336 152 211 410 811 755 630 1350 239 367 1578 2149 2436 1428 2493 1384 1289 827 1076 1230 178 2220 162 1091 2067 987 1534 7368 7977 8381 1718 2328 8081 5341 4535 5516 7375 4788 1819 4086 3852 8695 2481 2782 2881 1388 2068 2227 626 2249 2780 1706 3346 2926 1441 1817 1546 3103 2938 1722 2776 3781 3137 2823 438 1560 2364 1838 2020 915 3337 9630 8638 7810 6691 5003 2180 5717 1222 6712 5996 5600 5640 7526 8970 4352 8323 6174 5202 8639 9770 9081 1081 5170 1432 5594 4688 7667 8488 9169 9870 5052 1358 504 2540 2929 3815 415 1308 1585 856 1693 2953 2204 1710 1280 2260 1199];
% Time value for integral ranges from 0 to 1440(120*12)
%The below code will generate values for time
t = zeros(121,1);
d=0;
for i=1:121
t(i)=d*12;
d=d+1;
end
% This calculates the integral values
data_cumtrap = cumtrapz(P, t);
disp(data_cumtrap);
%Plots the graph
plot(t,data_cumtrap,'ro'); hold;
data = linspace(0, 3000, 200);

Output:

0
-4830
14592
-37728
-45456
-42270
-29136
2142
-2898
-15648
66432
-73554
-55890
125760
218262
268200
80712
291582
58692
37602
-70506
-9252
30480
-253560
322284
-282768
1506
311874
-44526
142548
2207784
2430678
2583390
-15180
230040
2611782
1444542
1091514
1532964
2391822
1165584
-277350
851616
732276
3260322
-57954
106392
161634
-689376
-293616
-199170
-1169376
-166362
168168
-521340
551220
271500
-735330
-475890
-666132
445566
325776
-571632
218868
984678
486222
239418
-1663812
-754992
-94104
-532788
-378816
-1326906
780234
6330660
5443812
4693644
3666402
2096562
-562704
2811594
-1530576
3838644
3129804
2733012
2773572
4708608
6207480
1358580
5575782
3267756
2212164
5985990
7241400
6468342
-2603658
2082336
-2246268
2623272
1552380
5109306
6099432
6928890
7791120
1807164
-2825112
-3906276
-1304268
-802458
351114
-4116486
-2932368
-2561742
-3545892
-2405898
-674658
-1712772
-2403384
-3009684
-1616124
-3137598

Current plot held