Licensed Electrical & Mechanical Engineer

Slides:



Advertisements
Similar presentations
Numerical Integration
Advertisements

ENGR-25_Plot_Model-2.ppt 1 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Bruce Mayer, PE Licensed Electrical.
ENGR-25_Plot_Model-2.ppt 1 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Bruce Mayer, PE Licensed Electrical.
MTH16_Lec-19_sec_10-3_Taylor_Series.pptx 1 Bruce Mayer, PE Chabot College Mathematics Bruce Mayer, PE Licensed Electrical & Mechanical.
Numerical Differentiation and Quadrature (Integration) 1Daniel Baur / Numerical Methods for Chemical Engineers / Numerical Quadrature Daniel Baur ETH Zurich,
Chapter 7 Numerical Differentiation and Integration
2. Numerical differentiation. Approximate a derivative of a given function. Approximate a derivative of a function defined by discrete data at the discrete.
Lecture 18 - Numerical Differentiation
ENGR-43_Lec-06-1_Capacitors.ppt 1 Bruce Mayer, PE Engineering-43: Engineering Circuit Analysis Bruce Mayer, PE Licensed Electrical.
Mech300 Numerical Methods, Hong Kong University of Science and Technology. 1 Part Six Numerical Differentiation and Integration.
Dr. Jie Zou PHY Chapter 7 Numerical Differentiation: 1 Lecture (I) 1 Ref: “Applied Numerical Methods with MATLAB for Engineers and Scientists”, Steven.
ENGR-25_Lec-23_ODEs_Euler_Numerical.pptx 1 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Bruce Mayer, PE.
MTH15_Lec-08_sec_2-3_Higher_Order_Derivatives_.pptx 1 Bruce Mayer, PE Chabot College Mathematics Bruce Mayer, PE Licensed Electrical.
MTH16_Lec-01_sec_6-1_Integration_by_Parts.pptx 1 Bruce Mayer, PE Chabot College Mathematics Bruce Mayer, PE Licensed Electrical.
ENGR-36_Lec-19_Beams-2.pptx 1 Bruce Mayer, PE Engineering-36: Engineering Mechanics - Statics Bruce Mayer, PE Licensed Electrical.
Today’s class Numerical Integration Newton-Cotes Numerical Methods
MECN 3500 Inter - Bayamon Lecture Numerical Methods for Engineering MECN 3500 Professor: Dr. Omar E. Meza Castillo
1 Chapter 7 NUMERICAL INTEGRATION. 2 PRELIMINARIES We use numerical integration when the function f(x) may not be integrable in closed form or even in.
Wicomico High School Mrs. J. A. Austin AP Calculus 1 AB Third Marking Term.
ENGR-25_Arrays-2.ppt 1 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Bruce Mayer, PE Licensed Electrical.
MTH16_Lec-14_sec_10-1_Infinite_Series.pptx 1 Bruce Mayer, PE Chabot College Mathematics Bruce Mayer, PE Licensed Electrical &
ENGR-25_MATLAB_OverView-1.ppt 1 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Bruce Mayer, PE Licensed Electrical.
Chapter 9 Numerical Integration Flow Charts, Loop Structures Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
MTH15_Lec-25_sec_5-4_Definite_Integral_Apps.pptx 1 Bruce Mayer, PE Chabot College Mathematics Bruce Mayer, PE Licensed Electrical.
ENGR-25_Prob_10-25_Catenary_Solution.ppt.ppt 1 Bruce Mayer, PE ENGR/MTH/PHYS25: Computational Methods Bruce Mayer, PE Registered.
MTH55_Lec-62_sec_9-4a_Log_Rules.ppt 1 Bruce Mayer, PE Chabot College Mathematics Bruce Mayer, PE Licensed Electrical & Mechanical.
MTH15_Lec-23_sec_5-2_Integration_Substitution.pptx 1 Bruce Mayer, PE Chabot College Mathematics Bruce Mayer, PE Licensed Electrical.
MTH16_Lec-09_sec_7-6_Double_Integrals.pptx 1 Bruce Mayer, PE Chabot College Mathematics Bruce Mayer, PE Licensed Electrical &
ENGR-25_Programming-4.ppt 1 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods 1 Bruce Mayer, PE Licensed Electrical.
ENGR-25_MATLAB_OverView-1.ppt 1 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Bruce Mayer, PE Licensed Electrical.
ENGR-25_Programming-3.ppt 1 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Bruce Mayer, PE Licensed Electrical.
ENGR-25_EXCEL_Integration_Tutorial-Example.pptx 1 Bruce Mayer, PE ENGR/MTH/PHYS25: Computational Methods Bruce Mayer, PE Registered.
ENGR-43_Lec-04b_2nd_Order_Ckts.pptx 1 Bruce Mayer, PE Engineering-43: Engineering Circuit Analysis Bruce Mayer, PE Registered.
ENGR-25_Plot_Model-4.ppt 1 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Bruce Mayer, PE Registered Electrical.
Numerical Differentiation and Quadrature (Integration)
ENGR-25_Prob_10-25_Catenary_Solution.ppt.ppt 1 Bruce Mayer, PE ENGR/MTH/PHYS25: Computational Methods Bruce Mayer, PE Registered.
ENGR-25_Programming-4.ppt 1 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods 1 Bruce Mayer, PE Licensed Electrical.
ENGR-25_Lec-27_MuPAD_Miscellaneous-n-TYUs.pptx 1 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Bruce Mayer,
ACSL, POSTECH1 MATLAB 입문 CHAPTER 8 Numerical calculus and differential equations.
ENGR-25_Prob_2-24_Solution.ppt 1 Bruce Mayer, PE ENGR/MTH/PHYS25: Computational Methods Bruce Mayer, PE Registered Electrical.
ENGR-25_Programming-1.ppt 1 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Bruce Mayer, PE Registered Electrical.
ENGR-25_HW-01_Solution.ppt 1 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Bruce Mayer, PE Licensed Electrical.
ENGR-44_Lec-06-2_Inductors.ppt 1 Bruce Mayer, PE Engineering-43: Engineering Circuit Analysis Bruce Mayer, PE Licensed Electrical.
ENGR-25_Lec-21_Integ_Diff.ppt 1 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Bruce Mayer, PE Licensed Electrical.
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1 Part 5 Integration and Differentiation.
ENGR-25_Programming-1.ppt 1 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Bruce Mayer, PE Registered Electrical.
ENGR-25_HW-01_Solution.ppt 1 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Bruce Mayer, PE Licensed Electrical.
ENGR-25_HW-01_Solution.ppt 1 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Bruce Mayer, PE Licensed Electrical.
ENGR-25_HW-01_Solution.ppt 1 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Bruce Mayer, PE Licensed Electrical.
© ENGR-43_Prob_14-32_OpAmp_OutPut_Current.pptx 1 Bruce Mayer, PE Engineering-43 Electrical Circuits & Devices Bruce Mayer, PE.
ENGR-43_Lec-04b_2nd_Order_Ckts.pptx 1 Bruce Mayer, PE Engineering-43: Engineering Circuit Analysis Bruce Mayer, PE Registered.
ENGR-25_HW-01_Solution.ppt 1 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Bruce Mayer, PE Licensed Electrical.
ENGR-25_Linear_Regression_Tutorial.ppt 1 Bruce Mayer, PE Engineering-25: Computational Methods Bruce Mayer, PE Licensed Electrical & Mechanical Engineer.
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1 Chapter 21 Numerical Differentiation.
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1 Chapter 20 Numerical Integration of Functions.
CMPSC 200 Fall 2013 Lecture 37 November 18, 2013.
Air Force Admin College, Coimbatore
§6.2 Numerical Integration
NUMERICAL DIFFERENTIATION AND INTEGRATION
Chapter 7 Numerical Differentiation and Integration
MATH 2140 Numerical Methods
Step-by-Step Pulse Response
Lab-23 Chp10 Beam VM Diagrams By Calculus
SKTN 2393 Numerical Methods for Nuclear Engineers
Numerical Computation and Optimization
Licensed Electrical & Mechanical Engineer
Prob 9-28 Solution Tutorial
MATH 2140 Numerical Methods
Air Force Admin College, Coimbatore
Presentation transcript:

Licensed Electrical & Mechanical Engineer BMayer@ChabotCollege.edu Engr/Math/Physics 25 Chp9: Integration & Differentiation Bruce Mayer, PE Licensed Electrical & Mechanical Engineer BMayer@ChabotCollege.edu

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 Newton’s 2nd Law: Heat Flux: Typical derivative are SPATIAL (x), or TEMPORAL (t) => Space or time derivatives Drag on a Parachute: Capacitor Current:

Why Differentiate, Integrate? Integration: Integration is commonplace in Science and Engineering Calculation of Geographic Areas River Channel Cross Section Wind-Force Loading

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: Differentiation Differentiation: rate of change of a dependent variable with respect to an independent variable.

Integral Properties Indefinite Intregral w/ Variable End-Pts Piecewise Property Initial/Final Value Formulations a c b Linearity → for Constants p & q Linearity => Take scaling constants OUTside the integral Term-by-Term integration for addends

Derivative Properties PRODUCT Rule Given QUOTIENT Rule Given Then Then

Alternative Quotient Rule Restate Quotient as rational Exponent, then apply Product rule; to whit: Then Putting 2nd term over common denom

Why Numerical Methods? Numerical Integration 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 To Improve Accuracy the TOP of the Strip can Be Slanted Lines Trapezoidal Rule Parabolas Simpson’s Rule Higher Order PolyNomials

Strip-Top Effect Trapezoidal Form Parabolic (Simpson’s) Form Higher-Order-Polynomial Tops Lead to increased, but diminishing, accuracy.

Strip-Count Effect 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 http://math.fullerton.edu/mathews/a2001/Animations/Quadrature/Trapezoidal/Trapezoidalaa.html

dy/dx by Finite Difference Approx. Derivative at Point-x : y(x) y(x-Δx) y(x+Δx) Forward Difference mbkwd Backward Difference mfwd

dy/dx by Finite Difference Approx. Central Difference = Average of fwd and bkwd Slopes : y(x) y(x-Δx) y(x+Δx) mcent

dy/dx by Discrete-Point Difference From Previous LET The FORWARD Difference Calc

dy/dx by Discrete-Point Difference The BACKWARD Difference Calc The CENTRAL Difference Calc

Finite Difference Example Forward Difference Analytical Note Variable Spacing

Discrete Point dy/dx

Compare Fwd, Bkwd, Cent Diffs

Finite Difference Fence-Post Errors 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) Prob9_17_Soln_1204.m * Also DEMO for diff command => u = primes(37) & delU = diff(u) Time For Live Demo

Cap Voltage – Integrate & Plot i(t) + v(t) - 1.0 mF Similar to 3e text problem 9.11 ** Prob8_14_Plot_i.m

Cap Charging The Current can Be integrated Analytically to find v(t), but it’s Painful Let’s Tackle The Problem Numerically Use the PieceWise Property Class Q => Based on top Eqn, what is v(100 000 s)? => 1 000 003.804 V * v(t) decays to LINE with slope of 10 V/S, and intercept 3.804V

Digression For More Info on See pages 333-335 from

PieceWise Integration

PieceWise Integration Illustrated

Cap Chrg PieceWise 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 Also: Cap_Charge_Anon_Fcn_Soln_1111.m File List Fcn → iOverC_CapCharge.m Calc & Plot → Cap_Charge_Soln_1111.m

File Codes function [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 % 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 File Codes

 Units Analysis Examine the Integrand from The Integrand Units Or 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

Trapezoidal Rule … All Done for Today Use Trapezoids to approximate the area under the curve: Trapezoidal Rule n trapezoids … a b Width, Δx =

Licensed Electrical & Mechanical Engineer BMayer@ChabotCollege.edu Engr/Math/Physics 25 Appendix Time For Live Demo Bruce Mayer, PE Licensed Electrical & Mechanical Engineer BMayer@ChabotCollege.edu

dy/dx example 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