Engr/Math/Physics 25
Download
1 / 33

Bruce Mayer, PE Licensed Electrical & Mechanical Engineer [email protected] - PowerPoint PPT Presentation


  • 58 Views
  • Uploaded on

Engr/Math/Physics 25. Chp9: Integration & Differentiation. Bruce Mayer, PE Licensed Electrical & Mechanical Engineer [email protected] Learning Goals. Demonstrate Geometrically the Concepts of Numerical Integ. & Diff. Integrals → Trapezoidal, Simpson’s, and Higher-order rules

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about ' Bruce Mayer, PE Licensed Electrical & Mechanical Engineer [email protected]' - clover


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript

Engr/Math/Physics 25

Chp9: Integration

& Differentiation

Bruce Mayer, PE

Licensed Electrical & Mechanical [email protected]


Learning goals
Learning Goals

  • Demonstrate Geometrically the Concepts of Numerical Integ. & Diff.

    • Integrals → Trapezoidal, Simpson’s, and Higher-order rules

    • Derivative → Finite Difference Methods

  • Use MATLAB to Numerically Evaluate Math/Data Integrals

  • Use MATLAB to Numerically Evaluate Math/Data Derivatives


Why differentiate integrate

We encounter differentiation and integration on a Daily Basis

Differentiation: Many Important Physical processes/phenomena are best Described in Derivative form; Some Examples

Why Differentiate, Integrate?

  • Newton’s 2nd Law:

  • Heat Flux:

  • Drag on a Parachute:

  • Capacitor Current:


Why differentiate integrate1

Integration: Integration is commonplace in Science and Engineering

Why Differentiate, Integrate?

Calculation of Geographic Areas

River ChannelCross Section

Wind-ForceLoading


Review integration

Integration: the area under the curve described by the function f(x) with respect to the independent variable x, evaluated between the limits x = a to x = b.

Review: Integration


Review differentiation

Differentiation: function rate of change of a dependent variable with respect to an independent variable.

Review: Differentiation


Integral properties

Indefinite Intregral w/ Variable End-Pts function

Integral Properties

  • Piecewise Property

  • Initial/Final Value Formulations

a

c

b

  • Linearity → for Constants p & q


Derivative properties

PRODUCT Rule function

Given

Derivative Properties

  • QUOTIENT Rule

    • Given

  • Then

  • Then


Alternative quotient rule
Alternative Quotient Rule function

  • Restate Quotient as rational Exponent, then apply Product rule; to whit:

  • Then

  • Putting 2nd term over common denom


Why numerical methods

Numerical Integration function

Why Numerical Methods?

  • 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 engineering testing, the function f(x) is only available in a TABULATED form with values known only at DISCRETE POINTS


Numerical integration

Game Plan: Divide Unknown Area into Strips (or boxes), and Add Up

Numerical Integration

  • To Improve Accuracy the TOP of the Strip can Be

    • Slanted Lines

      • Trapezoidal Rule

    • Parabolas

      • Simpson’s Rule

    • Higher Order PolyNomials


Strip top effect
Strip-Top Effect Add Up

  • Trapezoidal Form

  • Parabolic (Simpson’s) Form

  • Higher-Order-Polynomial Tops Lead to increased, but diminishing, accuracy.


Strip count effect
Strip-Count Effect Add Up

10 Strips

20 Strips

  • Adaptive Integration → INCREASE the strip-Count in Regions with Large SLOPES

    • More Strips of Constant Width Tends to work just as well


Dy dx by finite difference approx

y(x) Add Up

y(x-Δx)

y(x)

y(x)

y(x+Δx)

dy/dx by Finite Difference Approx.

  • Derivative at Point-x :

  • Forward Difference

mbkwd

  • Backward Difference

mfwd


Dy dx by finite difference approx1

y(x) Add Up

y(x-Δx)

y(x)

y(x)

y(x+Δx)

dy/dx by Finite Difference Approx.

  • Central Difference = Average of fwd and bkwd Slopes :

mcent


Dy dx by discrete point difference
dy/dx by Discrete-Point Difference Add Up

  • From Previous LET

  • The FORWARD Difference Calc


Dy dx by discrete point difference1
dy/dx by Discrete-Point Difference Add Up

  • The BACKWARD Difference Calc

  • The CENTRAL Difference Calc


Finite difference example
Finite Difference Example Add Up

ForwardDifference

Analytical




Finite difference fence post errors
Finite Difference Fence-Post Errors Add Up

  • If we have data vectors for x & f(x) we can calc m = df(x)/dx by the Fwd, Bkwd or Central Difference methods

  • If there are 1 to n Data points then can NOT calc

    • mfwd for pt-n (cannot extend fwd beyond n-1)

    • mbk for pt-1 (cannot extend bkwd beyond 1)

    • mcnt for pt-1 and pt-n (cannot extend bk beyond 1, cannot extend fwd beyond n)

Time For

Live Demo


Cap voltage integrate plot

1.0 mF Add Up

+ v(t) -

i(t)

Cap Voltage – Integrate & Plot


Cap charging
Cap Charging Add Up

  • The Current can Be integrated Analytically to find v(t), but it’s Painful

  • Let’s Tackle The Problem Numerically

  • Use the PieceWise Property


Digression
Digression Add Up

  • For More Info on

  • See pages 333-335 from




Cap chrg piecewise integration
Cap Add UpChrgPieceWise Integration

  • Game Plan

    • Make Function for i(t)/C

    • Divide 300 mS interval into 1 mS pieces

    • Use 1-300 FOR Loop to collect

      • Vector for Time-Plot

      • Use ΔV summation to Create a V-Plotting Vector

Time For

Live Demo

  • File List

    • Fcn → iOverC_CapCharge.m

    • Calc& Plot → Cap_Charge_Soln_1111.m


File codes

function Add Up [Cap_Charge] = iOverC_CapCharge(time)

Cap_Charge = (1/0.001)*(10 + 300*exp(-5*time).*sin(25*pi*time))/1000;

% Cap Charge for Prob for Chp9 in COULOMBS

File Codes

% B. Mayer 08Nov11

% Cap Charging: Piecewise Ingegration

% Cap_Charge_Soln_1111.m

%

% use 500 pts using LinSpace

% => Ask user for max time

tmax = input('Enter Max Time in Sec = ')

tmin = 0; n = 500;

t = linspace(tmin,tmax,n); % in Sec

TimePts =length(t) % 2X check number of time points

%

% Initalize the Vminus1 & Plotting Vectors

Vminus1 = 0;

Vplot = 0;

tplot = 0;

%

% Use FOR Loop with Lobratto Integrating quadl function on Cap Charge

% Function

for k = 1:n-1

tplot(k) = t(k);

del_v(k) = quadl('iOverC_CapCharge', t(k), t(k+1));

% The Incremental Area Under the Curve; can be + or -

Vplot(k) = Vminus1 + del_v(k);

Vminus1 = Vplot(k);

end

plot(1000*tplot, del_v), xlabel('time (mS)'), ylabel('DelV (V)'),...

title('Capacitor Voltage PieceWise Integral'), grid

disp('Showing del_v PLOT - hit any key to show V(t) plot')

pause

plot(1000*tplot, Vplot), xlabel('time (mS)'), ylabel('Cap Potential (V)'),...

title('Capacitor Voltage'), grid


Units analysis

Examine the Integrand from Add Up

Units Analysis

  • A → A (a base unit)

  • S → S (a base unit)

  • F → m−2•kg−1•S4•A2

  • V → m2•kg•S−3•A−1

  • The Integrand Units

  • Or

  • Recall From ENGR10 A, S, & F in SI Base Units

  • But


Result
Result Add Up


All done for today
All Done for Today Add Up

Use Trapezoids to approximate the area under the curve:

TrapezoidalRule

n trapezoids

a b

Width, Δx=


Engr/Math/Physics 25 Add Up

Appendix

Time For

Live Demo

Bruce Mayer, PE

Licensed Electrical & Mechanical [email protected]


Dy dx example
dy/dx example Add Up

x = [1.215994, 2.263081, 3.031708, 4.061534, 5.122477, 6.12396, 7.099754, 8.070701, 9.215382, 10.04629, 11.16794, 12.22816, 13.02504, 14.13544, 15.20385, 16.01526]

y = [0.381713355 1.350058777 1.537968679 2.093069052 1.002924647 1.123878013 7.781303297 14.2596343 13.96413795 4.352973409 51.45863097 22.85918559 100.8729773 106.5041434 34.15277499 134.2488143]

plot(x,y),xlabel('x'), ylabel('y'), grid


ad