§6.2 Numerical Integration Chabot Mathematics Bruce Mayer, PE

advertisement
Chabot Mathematics
§6.2 Numerical
Integration
Bruce Mayer, PE
Licensed Electrical & Mechanical Engineer
BMayer@ChabotCollege.edu
Chabot College Mathematics
1
Bruce Mayer, PE
BMayer@ChabotCollege.edu • MTH16_Lec-01_sec_6-1_Integration_by_Parts.pptx
Review §
6.1
 Any QUESTIONS About
• §6.1 → Integration by Parts, Use of
Integral Tables
 Any QUESTIONS
About
HomeWork
• §6.1 → HW-01
Chabot College Mathematics
2
Bruce Mayer, PE
BMayer@ChabotCollege.edu • MTH16_Lec-01_sec_6-1_Integration_by_Parts.pptx
§6.2 Learning Goals
 Explore the trapezoidal rule and
Simpson’s rule for numerical integration
 Use error bounds for numerical
integration
 Interpret data using
numerical integration
Chabot College Mathematics
3
Bruce Mayer, PE
BMayer@ChabotCollege.edu • MTH16_Lec-01_sec_6-1_Integration_by_Parts.pptx
Why Numerical Methods?
 Numerical Integration
•
•
Chabot College Mathematics
4
Very often, the function
f(x) to differentiate, or the
integrand to integrate, is
TOO COMPLEX to yield
exact analytical solutions.
In most cases in Real
World testing, the function
f(x) is only available in a
TABULATED form with
values known only at
DISCRETE POINTS
Bruce Mayer, PE
BMayer@ChabotCollege.edu • MTH16_Lec-01_sec_6-1_Integration_by_Parts.pptx
Numerical Integration
 Game Plan: Divide
Unknown Area into
Strips (or boxes),
and Add Up
 To Improve
Accuracy the TOP of
the Strip can Be
• Slanted Lines
– Trapezoidal Rule
• Parabolas
– Simpson’s Rule
• Higher Order
PolyNomials
Chabot College Mathematics
5
Bruce Mayer, PE
BMayer@ChabotCollege.edu • MTH16_Lec-01_sec_6-1_Integration_by_Parts.pptx
Strip-Top Effect
 Trapezoidal Form
 Parabolic
(Simpson’s) Form
• Higher-Order-Polynomial Tops Lead to increased,
but diminishing, accuracy.
Chabot College Mathematics
6
Bruce Mayer, PE
BMayer@ChabotCollege.edu • MTH16_Lec-01_sec_6-1_Integration_by_Parts.pptx
Strip-Count Effect
10 Strips
20 Strips
 Adaptive Integration → INCREASE the stripCount in Regions with Large SLOPES
• More Strips of Constant
Width Tends to work
just as well
Chabot College Mathematics
7
Bruce Mayer, PE
BMayer@ChabotCollege.edu • MTH16_Lec-01_sec_6-1_Integration_by_Parts.pptx
AUC by Flat Tops
 
Aj  Height  Width   f x*j  x
N
N
 
A   Aj   f x*j  x
j 1
j 1
 
f x5*
y  f x 
x
Chabot College Mathematics
8
Bruce Mayer, PE
BMayer@ChabotCollege.edu • MTH16_Lec-01_sec_6-1_Integration_by_Parts.pptx
Trapezoidal Area
 By the Diagram at Right
f x j 1 
• Side Heights:
f x j 
f x j  j 
• Width: x
A
 Now “Stack Up” for 2A
 Then


2 A  f x j   f x j 1   x
 or

f x   f x 
A
x
j 1
j
f x j 
A
f x j 1 
f x j 
x
2
Chabot College Mathematics
9
Bruce Mayer, PE
BMayer@ChabotCollege.edu • MTH16_Lec-01_sec_6-1_Integration_by_Parts.pptx
AUC by Trapezoids
A  Atrap

f x   f x 

x
N 1
A   A j 
j 0
j 1
j
N 1
1

2 j 0

2
f x j   f x j 1  x

y  f x 
Chabot College Mathematics
10
Bruce Mayer, PE
BMayer@ChabotCollege.edu • MTH16_Lec-01_sec_6-1_Integration_by_Parts.pptx
The Trapezoidal Rule
 To Find the APPROXIMATE Area
Under the Curve given by y = f(x), and
divided into vertical strips of equal
width, Δx
AUC  
b
a
11


1
f x dx   f x j   f x j 1  x
2 j 0
• Where:
Chabot College Mathematics
N 1
a  x0
xN  b
Bruce Mayer, PE
BMayer@ChabotCollege.edu • MTH16_Lec-01_sec_6-1_Integration_by_Parts.pptx
Trapezoidal Rule Error
 AUC by the
Trapezoidal
Approximation incurs
error in the amount of
K b  a 
En 
2
12n
3
 Where
• n ≡ the strip count
• K ≡ the maximum
value of |d2y/dx2|
Chabot College Mathematics
12
Bruce Mayer, PE
BMayer@ChabotCollege.edu • MTH16_Lec-01_sec_6-1_Integration_by_Parts.pptx
Trapezoidal Rule Error Example
 The Function does NOT have a Closed
Form, Analytical Solution
e
y  f x  
x
x
e
  dx  ???
x
 Calculate the Area
Under the Curve for
this function between
x=1 & x=3 using a
10-strip Trapezoidal
Calculation
Chabot College Mathematics
13
MTH16 • Bruce Mayer, PE
7
6
5
y = ex/x
x
4
3
2
1
0
MTH15 Quick Plot BlueGreenBkGnd 130911.m
1
1.5
2
2.5
Bruce
x Mayer, PE
BMayer@ChabotCollege.edu • MTH16_Lec-01_sec_6-1_Integration_by_Parts.pptx
3
Trapezoidal Rule Error Example
 Calculate x  b  a  3  1  2  0.2
Δx
n
10 10
 Then make Fcn T-Table using
x j 1  x j  x e.g; j  7  x8  2.2  .02  2.4
 Then
The
TTable
Chabot College Mathematics
14
f(xj) = ex/x ΔA = [½][f(xj)+f(xj+1)]•Δx
j
x
1
1.0
2.718282
0.548504593
2
1.2
2.766764
0.566333551
3
1.4
2.896571
0.599221667
4
1.6
3.095645
0.645656052
5
1.8
3.360915
0.705544331
6
2.0
3.694528
0.779680691
7
2.2
4.102279
0.869526902
8
2.4
4.592990
0.977135094
9
2.6
5.178361
1.105144892
10
2.8
5.873088
1.256826711
11
3.0
6.695179
Σtotal =
8.053574484
 Then the
Approximation
x
2e
1 x dx  8.0536
Bruce Mayer, PE
BMayer@ChabotCollege.edu • MTH16_Lec-01_sec_6-1_Integration_by_Parts.pptx
Trapezoidal Rule Error Example
2
 ReCall from
 d f x  

Error Equation K  max 
2
 dx 
 Taking the Derivative Twice
ex
y
x

dy e x e x
  2
dx x x
 Plot d2y/dx2
to EyeBall
Max Value
Chabot College Mathematics
15

d 2 y ex
ex
ex
 2 2 2 3
2
dx
x
x
x
 Maximum
at x = 3
Bruce Mayer, PE
BMayer@ChabotCollege.edu • MTH16_Lec-01_sec_6-1_Integration_by_Parts.pptx
Trapezoidal Rule Error Example
 Then
d2y
K 2
dx
x 3
e3
e3
e3
2 2  5 3
3 1
 2 2 2 3 e      e
3
3
3
 3 9 27  27
 Thus, to 5 Sig-Figs: K  3.7195
 Finally the Maximum 10-Strip,
Trapezoidal Error
K b  a  3.71953  1
En 

 0.0248  2.48%
2
2
12n
12 10
3
Chabot College Mathematics
16
3
Bruce Mayer, PE
BMayer@ChabotCollege.edu • MTH16_Lec-01_sec_6-1_Integration_by_Parts.pptx
Simpson’s Rule
 The Simpson Method
tops TWO Strips with
successive
3-pt Curve-Fit
Parabolas
 A Parabola can be
fit EXACTLY to ANY 3 (x,y) points
x1 , y1 
x2 , y2 
x3 , y3 
Chabot College Mathematics
17
ax1  bx1  c  y1 

 ax2  bx2  c  y2 Solve for a, b, c
ax3  bx3  c  y3 

Bruce Mayer, PE
BMayer@ChabotCollege.edu • MTH16_Lec-01_sec_6-1_Integration_by_Parts.pptx
Simpson’s Rule
 Since 3-pts defines 2-strips Simpson’s
Rule requires an EVEN Strip-Count
 Then for an Even Counting Number, n
AUC   f  x dx 
b
a
x
 f x1   4 f x2   2 f x3     2 f xn1   4 f xn   f xn1 
3
• if
M = max(|d4y/dx4|)
then the Error
Chabot College Mathematics
18
M b  a 
En 
4
180n
5
Bruce Mayer, PE
BMayer@ChabotCollege.edu • MTH16_Lec-01_sec_6-1_Integration_by_Parts.pptx
Simpson’s Rule Example
x
e
 Use Simpson’s rule with
AUC 
dx
n = 10 strips to approximate:
1 x
 SOLUTION
 From the Trapezoidal example Δx = 0.2
 Now the SideWays T-Table

3
j
1
2
3
4
5
6
7
8
9
10
11
x
1.0
1.2
1.4
1.6
1.8
2.0
2.2
2.4
2.6
2.8
3.0
f(xj) = ex/x 2.718282 2.766764 2.896571 3.095645 3.360915
1
4
2
4
2
f(xj) CoEff
2.718282
11.067056
5.793143
12.382581
6.721831
f(xj)·CoEff
Σ[f(xj)·CoEff] =
AUC ≈ (Δx/3)·Σ[f(xj)·CoEff] =
Chabot College Mathematics
19
3.694528 4.102279 4.592990
5.178361
5.873088 6.695179
4
2
4
2
4
1
14.778112 8.204558 18.371961 10.356722 23.492353 6.695179
120.5817763
8.038785084
Bruce Mayer, PE
BMayer@ChabotCollege.edu • MTH16_Lec-01_sec_6-1_Integration_by_Parts.pptx
Find Precise Value by MuPAD
 The Integrand Function
• fOFx := E^x/x
 Plot the AREA under the Integrand Curve
• fArea := plot::Function2d(fOFx, x
= 1..3):plot(plot::Hatch(fArea),
fArea)
 The Precise Value
• AUCn = numeric::int(fOFx, x=1..3)
Chabot College Mathematics
20
Bruce Mayer, PE
BMayer@ChabotCollege.edu • MTH16_Lec-01_sec_6-1_Integration_by_Parts.pptx
Simpson’s Error
 Find Fourth Derivative by MuPAD
• d4fdx4 := diff(fOFx, x $ 4)
 Then the 4th Derivative Plot
• plot(d4fdx4, x=1..3, GridVisible
= TRUE)
• Max at x=1
d4 f
 9e  24.4645
4
dx
Chabot College Mathematics
21
Bruce Mayer, PE
BMayer@ChabotCollege.edu • MTH16_Lec-01_sec_6-1_Integration_by_Parts.pptx
Simpson’s Error
 Then the
Error Calc
9e3  1
4
En 
 4.35 10
4
180 10
5
 The Error comparing to MuPAD Value
Calc  Actual
8.038785084  8.038714754
En 

Actual
8.038714754
6
En  8.7488 10
• Thus the TextBook Formula is
Conservative
Chabot College Mathematics
22
Bruce Mayer, PE
BMayer@ChabotCollege.edu • MTH16_Lec-01_sec_6-1_Integration_by_Parts.pptx
NO Equation Functions
 Often in REAL LIFE “functions” disguise
themselves as “Data Tables”
 When I was Research Tech at
Lawrence Berkeley Lab (1978) I made
Ventilation-Duct Volume-Flow
measurements. A typical Data Set
12 inch OD Round Duct FlowSpeed Traverse
r (in) V1 (ft/S) V2 (ft/S) V3 (ft/S) V4 (ft/S) V5 (ft/S) V6 (ft/S) Vavg (ft/S)
Chabot College Mathematics
23
2.15
24.1
24.3
27.6
27.3
25.7
28.1
26.2
4.38
15.1
13.9
13.1
13.9
14.4
14.8
14.2
5.62
3.9
3.8
3.9
3.4
3.6
3.9
3.7
Bruce Mayer, PE
BMayer@ChabotCollege.edu • MTH16_Lec-01_sec_6-1_Integration_by_Parts.pptx
NO-Equation Functions
 I then had to Calculate the Duct Volume
Flow, Q, from the Data Table using the
integration
 Q

 V
avg
 r  r 
 This type of Integration Occurs
Frequently in the Physical,
Life, and Social Sciences, as
well as in the Business world
Chabot College Mathematics
24
Bruce Mayer, PE
BMayer@ChabotCollege.edu • MTH16_Lec-01_sec_6-1_Integration_by_Parts.pptx
NO-Eqn Integration Example
 The Cylindrical Tank
shown at right has a
bottom area of 130 ft2 .
The tank is initially
EMPTY. To Fill the Tank,
Water Flows into the top at varying
rates as given in the Tank-Table below.
Time
0 1
3
5
6
9
11 12 13 15 18
(min)
FlowRate
0 80 130 150 150 160 165 170 160 140 120
(ft3/min)
Chabot College Mathematics
25
Bruce Mayer, PE
BMayer@ChabotCollege.edu • MTH16_Lec-01_sec_6-1_Integration_by_Parts.pptx
NO-Eqn Integration Example
 For this situation determine the water
height ,H, at t = 18 minutes
 SOLUTION
MTH16 • Bruce Mayer, PE
 Use the TRAPEZOIDAL
Rule to Integrate the
WaterFlow to arrive
at the the Total
Water VOLUME
160
140
Q = (ft 3/min))
120
100
80
60
40
• Use the Max No. of
strips permitted by Data
Chabot College Mathematics
26
20
0
MTH15 Quick Plot BlueGreenBkGnd 130911.m
0
2
4
6
8
10
(min) PE
Brucet Mayer,
BMayer@ChabotCollege.edu • MTH16_Lec-01_sec_6-1_Integration_by_Parts.pptx
12
14
16
18
NO-Eqn Integration Example
 Make ΔV Calcs
for the 10 strips
 Then by GeoMetry
t (min) Q (cfm) Qavg (cfm) ΔV= Qavg•Δt
0
1
3
5
6
9
11
12
13
15
18
Vwtr  Atnk  H
or
H  Vwtr Atnk
 So Finally

H  2492.5 ft
Chabot College Mathematics
27
3
0
80
130
150
150
160
165
170
160
140
120
40.0
105.0
140.0
150.0
155.0
162.5
167.5
165.0
150.0
130.0
Σtotal =
 130 ft 
2
40.0
210.0
280.0
150.0
465.0
325.0
167.5
165.0
300.0
390.0
2492.5
997

ft  19.17 ft
52
Bruce Mayer, PE
BMayer@ChabotCollege.edu • MTH16_Lec-01_sec_6-1_Integration_by_Parts.pptx
NO-Eqn Integration Example
MTH16 • Bruce Mayer, PE
 Note that in
this case Δx is
NON-constant
 Thus
SIMPSON’s
Rule Can NOT
be Used
140
120
Q = (ft 3/min))
• 10 Strips of
Varying Width
160
100
80
60
40
20
0
MTH15 Quick Plot BlueGreenBkGnd 130911.m
0
• Simpson’s Rule
Requires constant Δx
Chabot College Mathematics
28
2
4
6
8
10
12
t (min)
Bruce Mayer, PE
BMayer@ChabotCollege.edu • MTH16_Lec-01_sec_6-1_Integration_by_Parts.pptx
14
16
18
Chabot College Mathematics
29
Bruce Mayer, PE
BMayer@ChabotCollege.edu • MTH16_Lec-01_sec_6-1_Integration_by_Parts.pptx
MatLab Code
% Bruce Mayer, PE
% MTH-15 • 01Aug13 • Rev 11Sep13
% MTH15_Quick_Plot_BlueGreenBkGnd_130911.m
%
clear; clc; clf; % clf clears figure window
%
% The Domain Limits
xmin = -6; xmax = 6;
% The FUNCTION **************************************
x = [0 1
3
5
6
9
11 12 13 15 18];
y = [0 80 130 150 150 160 165 170 160 140 120];
% ***************************************************
% the Plotting Range = 1.05*FcnRange
ymin = min(y); ymax = max(y); % the Range Limits
xmin = min(x); xmax = max(x); % the Range Limits
R = ymax - ymin; ymid = (ymax + ymin)/2;
ypmin = ymid - 1.025*R/2; ypmax = ymid + 1.025*R/2
%
% The ZERO Lines
zxh = [xmin xmax]; zyh = [0 0]; zxv = [0 0]; zyv = [ypmin*1.05 ypmax*1.05];
%
% the 6x6 Plot
axes; set(gca,'FontSize',12);
whitebg([0.8 1 1]); % Chg Plot BackGround to Blue-Green
plot(x,y, '-d', 'LineWidth', 4),grid, axis([xmin xmax ypmin ypmax]),...
xlabel('\fontsize{14}t (min)'), ylabel('\fontsize{14}Q = (ft^3/min)'),...
title(['\fontsize{16}MTH16 • Bruce Mayer, PE',]),...
annotation('textbox',[.53 .05 .0 .1], 'FitBoxToText', 'on', 'EdgeColor',
'none', 'String', 'MTH15 Quick Plot BlueGreenBkGnd 130911.m','FontSize',7)
hold on
plot(zxv,zyv, 'k', zxh,zyh, 'k', 'LineWidth', 2)
stem(x,y, '-r.', 'LineWidth', 2)
hold off
WhiteBoard Work
 Problems From §6.2
• P40 → Consumer’s Surplus
Chabot College Mathematics
30
Bruce Mayer, PE
BMayer@ChabotCollege.edu • MTH16_Lec-01_sec_6-1_Integration_by_Parts.pptx
All Done for Today
Tracking
Trapezoids
Chabot College Mathematics
31
Bruce Mayer, PE
BMayer@ChabotCollege.edu • MTH16_Lec-01_sec_6-1_Integration_by_Parts.pptx
Chabot Mathematics
Appendix
r  s  r  s r  s 
2
2
Bruce Mayer, PE
Licensed Electrical & Mechanical Engineer
BMayer@ChabotCollege.edu
–
Chabot College Mathematics
32
Bruce Mayer, PE
BMayer@ChabotCollege.edu • MTH16_Lec-01_sec_6-1_Integration_by_Parts.pptx
Chabot College Mathematics
33
Bruce Mayer, PE
BMayer@ChabotCollege.edu • MTH16_Lec-01_sec_6-1_Integration_by_Parts.pptx
Chabot College Mathematics
34
Bruce Mayer, PE
BMayer@ChabotCollege.edu • MTH16_Lec-01_sec_6-1_Integration_by_Parts.pptx
P6.2-40 MatLAB Code
% Bruce Mayer, PE
% MTH-16 • 11Jan14
x =
[0
4
8
12
% MTH15_Quick_Plot_BlueGreenBkGnd_130911.m
16
20
24]
%
y =
[49.1200
42.9000
clear; clc; clf; % clf clears figure window
31.3200
19.8300
%
13.8700
10.5800
% The FUNCTION **************************************
7.2500]
x = [0:4:24];
ps = y-ymin
y = [49.12 42.9
31.32
19.83
13.87
10.58
7.25];
M = [1 4 2 4 2 4 1]
% ***************************************************
CS1 = ps.*M
% the Plotting Range = 1.05*FcnRange
CS2 = (4/3)*CS1
ymin = min(y); ymax = max(y); % the Range Limits
xmin = min(x); xmax = max(x); % the Range Limits
CS3 = sum(CS2)
R = ymax - ymin; ymid = (ymax + ymin)/2;
CS4 = sum(CS1)
ypmin = ymid - 1.025*R/2; ypmax = ymid + 1.025*R/2
CStot = (4/3)*CS4
ypmin =0
%
% The ZERO Lines
zxh = [xmin xmax]; zyh = [0 0]; zxv = [0 0]; zyv = [ypmin*1.05 ypmax*1.05];
%
% the 6x6 Plot
axes; set(gca,'FontSize',12);
whitebg([1 1 1]); % Chg Plot BackGround to Blue-Green
plot(x,y, '-d', 'LineWidth', 4),grid, axis([xmin xmax ypmin ypmax]),...
xlabel('\fontsize{14}q (kUnits)'), ylabel('\fontsize{14}p ($/Unit)'),...
title(['\fontsize{16}MTH16 • Bruce Mayer, PE',]),...
annotation('textbox',[.53 .05 .0 .1], 'FitBoxToText', 'on', 'EdgeColor',
'none', 'String', 'MTH15 Quick Plot BlueGreenBkGnd 130911.m','FontSize',7)
hold on
plot(zxv,zyv, 'k', zxh,zyh, 'k', 'LineWidth', 2)
stem(x,y, '-r.', 'LineWidth', 2)
plot([xmin, xmax], [7.25 7.25], '-.m', 'LineWidth', 3)
Bruce Mayer, PE
Chabot College Mathematics
hold off
35
BMayer@ChabotCollege.edu • MTH16_Lec-01_sec_6-1_Integration_by_Parts.pptx
Example  NONconstant ∆x
 Pacific Steel Casting Company (PSC) in
Berkeley CA, uses huge amounts of
electricity during the metal-melting process.
 The PSC Materials
Engineer measures the
power, P, of a certain
melting furnace over
340 minutes as shown
in the table at right.
See Data Plot at Right.
Furnace Power Consumption
250
Power Consumption, P (kW)
200
150
100
50
0
Chabot College Mathematics
36
0
50
100
150
200
time, t (min)
250
Bruce Mayer, PE
BMayer@ChabotCollege.edu • MTH16_Lec-01_sec_6-1_Integration_by_Parts.pptx
300
350
Example  NONconstant ∆x
 The T-table at Right displays
the Data Collected by the
PSC Materials Enginer
 Recall from Physics that Energy
(or Heat), Q, is the time-integral
of the Power.
 Use Strip-Integration to find the
Total Energy in MJ expended by
The Furnace during this process
run
Chabot College Mathematics
37
Time
(min)
0
24
45
74
90
118
134
169
180
218
229
265
287
340
Bruce Mayer, PE
BMayer@ChabotCollege.edu • MTH16_Lec-01_sec_6-1_Integration_by_Parts.pptx
Power
(kW)
47
107
104
146
126
178
147
211
151
233
184
222
180
247
Example  NONconstant ∆x
 GamePlan for Strip Integration
 Use a Forward Difference
approach
• ∆tn = tn+1 − tn
– Example: ∆t6 = t7 − t6 = 134 − 118 =
16min → 16min·(60sec/min) = 960sec
• Over this ∆t assume the P(t) is
constant at Pavg,n =(Pn+1 − Pn )
– Example: Pavg,6 = (P7 − P6)/2 =
(147+178)/2 = 162.5 kW = 162.5 kJ/sec
Chabot College Mathematics
38
Time
(min)
0
24
45
74
90
118
134
169
180
218
229
265
287
340
Bruce Mayer, PE
BMayer@ChabotCollege.edu • MTH16_Lec-01_sec_6-1_Integration_by_Parts.pptx
Power
(kW)
47
107
104
146
126
178
147
211
151
233
184
222
180
247
Example  NONconstant ∆x
 The
GamePlan
Graphically
225
x 9
Bruce May er, PE • 25Jul13
200
175
x4
150
P (kW)
• Note the
Variable
Width, ∆x,
of the Strip
Tops
MTH15 • Variable-Width Strip-Integration
125
100
75
50
25
0
0
50
100
150
200
250
t (minutes)
Chabot College Mathematics
39
Bruce Mayer, PE
BMayer@ChabotCollege.edu • MTH16_Lec-01_sec_6-1_Integration_by_Parts.pptx
300
350
Chabot College Mathematics
40
Bruce Mayer, PE
BMayer@ChabotCollege.edu • MTH16_Lec-01_sec_6-1_Integration_by_Parts.pptx
MATLAB Code
% Bruce Mayer, PE
% MTH-15 • 25Jul13
% XY_Area_fcn_Graph_6x6_BlueGreen_BkGnd_Template_1306.m
%
clear; clc; clf; % clf is clear figure
%
% The FUNCTION
xmin = 0; xmax = 350; ymin = 0; ymax = 225;
x = [0 24 24 45 45 74 74 90 90 118 118 134 134 169 169 180 180 218
218 229 229 265 265 287 287 340]
y = [77 77 105.5
105.5
125 125 136 136 152 152 162.5
162.5
179 179
181 181 192 192 208.5
208.5
203 203 201 201 213.5
213.5]
%
% The ZERO Lines
zxh = [xmin xmax]; zyh = [0 0]; zxv = [0 0]; zyv = [ymin ymax];
%
% the 6x6 Plot
axes; set(gca,'FontSize',12);
whitebg([0.8 1 1]); % Chg Plot BackGround to Blue-Green
% Now make AREA Plot
area(x,y,'FaceColor',[1 0.6 1],'LineWidth', 3),axis([xmin xmax ymin
ymax]),...
grid, xlabel('\fontsize{14}t (minutes)'), ylabel('\fontsize{14}P
(kW)'),...
title(['\fontsize{16}MTH15 • Variable-Width Strip-Integration',]),...
annotation('textbox',[.15 .82 .0 .1], 'FitBoxToText', 'on', 'EdgeColor',
'none', 'String', 'Bruce Mayer, PE • 25Jul13','FontSize',7)
set(gca,'XTick',[xmin:50:xmax]); set(gca,'YTick',[ymin:25:ymax])
set(gca,'Layer','top')
Example  NONconstant ∆x
n Time, t Power ∆t = 60*(tn+1-tn) Pavg=(Pn+1−Pn)/2 ∆Q= Pavg*∆t
(cnt) (min) (kW)
(Sec)
(kW)
(kJ)
1
1
2
2
3
3
4
4
5
5
6
6
7
7
8
8
9
9
10
10
11
11
12
12
13
13
14
0
47
24
107
45
74
110880
1260
105.5
132930
1740
125
217500
960
136
130560
1680
152
255360
960
162.5
156000
2100
179
375900
660
181
119460
2280
192
437760
660
208.5
137610
2160
203
438480
1320
201
265320
3180
213.5
678930
146
126
118
178
134
147
169
211
218
77
104
90
180
1440
151
233
229
184
265
222
287
180
340
247
Total Energy in MJ = (∑∆Q)/1000 =
Chabot College Mathematics
41
 The NONconstant
Strip-Width Integration
is conveniently done
in an Excel
SpreadSheet
 The 13 ∆Q strips Add
up to 3456.69
MegaJoules of Total
Energy Expended
3456.69
Bruce Mayer, PE
BMayer@ChabotCollege.edu • MTH16_Lec-01_sec_6-1_Integration_by_Parts.pptx
Download