Calculate the integral with; a) Trapezoidal rule b) Simpson’s rule

Slides:



Advertisements
Similar presentations
Numerical Integration
Advertisements

ES 240: Scientific and Engineering Computation. Chapter 17: Numerical IntegrationIntegration  Definition –Total area within a region –In mathematical.
Problem kN A Pratt roof truss is loaded as shown. Using the method of sections, determine the force in members FH , FI, and GI. 3 kN 3 kN F 3 kN.
Chapter 7 Numerical Differentiation and Integration
Numerical Integration Lecture (II)1
CVEN Exam 1 Review. Matlab Basic commands and syntax Basic commands and syntax Creation of functions and programs Creation of functions and programs.
Numerical integration continued --- Simpson’s rules - We can add more segments OR - We can use a higher order polynomial.
Chapter 7 Differentiation and Integration
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1 ~ Numerical Differentiation and Integration ~ Newton-Cotes.
NUMERICAL DIFFERENTIATION The derivative of f (x) at x 0 is: An approximation to this is: for small values of h. Forward Difference Formula.
Chapter 9 Numerical Integration Numerical Integration Application: Normal Distributions Copyright © The McGraw-Hill Companies, Inc. Permission required.
CISE301_Topic7KFUPM1 SE301: Numerical Methods Topic 7 Numerical Integration Lecture KFUPM Read Chapter 21, Section 1 Read Chapter 22, Sections 2-3.
CISE301_Topic71 SE301: Numerical Methods Topic 7 Numerical Integration Lecture KFUPM (Term 101) Section 04 Read Chapter 21, Section 1 Read Chapter.
Simpson’s 1/3 rd Rule of Integration. What is Integration? Integration The process of measuring the area under a.
Area of a single trapezoid = h
1 Chapter 5 Numerical Integration. 2 A Review of the Definite Integral.
MECN 3500 Inter - Bayamon Lecture Numerical Methods for Engineering MECN 3500 Professor: Dr. Omar E. Meza Castillo
Simulation of Random Walk How do we investigate this numerically? Choose the step length to be a=1 Use a computer to generate random numbers r i uniformly.
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.
1 Numerical Analysis Lecture 12 Numerical Integration Dr. Nader Okasha.
1 Simpson’s 1/3 rd Rule of Integration. 2 What is Integration? Integration The process of measuring the area under a curve. Where: f(x) is the integrand.
Introduction to Numerical Analysis I
Chapters 5 and 6: Numerical Integration
4.6 Numerical Integration Trapezoid and Simpson’s Rules.
CSE 330 : Numerical Methods
Dr. Mubashir Alam King Saud University. Outline Numerical Integration Trapezoidal and Simpson’s Rules (5.1)
1 Numerical Integration Section Why Numerical Integration? Let’s say we want to evaluate the following definite integral:
Simpson Rule For Integration.
From a vibration measurement on a machine, the damping ratio and undamped vibration frequency are calculated as 0.36 and 24 Hz, respectively. Vibration.
Interpolation produces a function that matches the given data exactly. The function then can be utilized to approximate the data values at intermediate.
Trapezoidal Rule of Integration
Simpson’s Rule: Example: Calculate the integral of the given function.
CHAPTER 3 NUMERICAL METHODS
Solutions of system of nonlinear equations: Newton-Raphson Example 4: The kinematic equations for a Four-Bar mechanism can be written as (5th semester,
6. Numerical Integration 6.1 Definition of numerical integration. 6.2 Reasons to use numerical integration. 6.3 Formulas of numerical Integration. 6.4.
Sec 21: Generalizations of the Euler Method Consider a differential equation n = 10 estimate x = 0.5 n = 10 estimate x =50 Initial Value Problem Euler.
The formulae for the roots of a 3rd degree polynomial are given below
3/12/ Trapezoidal Rule of Integration Computer Engineering Majors Authors: Autar Kaw, Charlie Barker
SE301_Topic 6Al-Amer20051 SE301:Numerical Methods Topic 6 Numerical Integration Dr. Samir Al-Amer Term 053.
Quadrature – Concepts (numerical integration) Don Allen.
Trapezoidal Rule of Integration
CHAPTER 3 NUMERICAL METHODS
NUMERICAL DIFFERENTIATION Forward Difference Formula
Chapter 7 Numerical Differentiation and Integration
Approximate Integration
Numerical Analysis Lecture 42.
The formulae for the roots of a 3rd degree polynomial are given below
The formulae for the roots of a 3rd degree polynomial are given below
1. 2 What is Integration? Integration The process of measuring the area under a curve. Where: f(x) is the integrand a= lower limit of integration b=
CHAPTER 3 NUMERICAL METHODS.
Area of a single trapezoid = h
MATH 2140 Numerical Methods
3. LAGRANGE INTERPOLATION METHOD
Chapter Objectives Chapter Outline
Elements of Numerical Integration
Area of a single trapezoid = h
Simpson’s Rule: Example: Calculate the integral of the given function.
INTERPOLASI.
The formulae for the roots of a 3rd degree polynomial are given below
Simpson’s 1/3rd Rule of Integration
Area of a single trapezoid = h
Newton-Raphson Example 4:
Numerical Computation and Optimization
3. LAGRANGE INTERPOLATION METHOD (LAGRANGE POLYNOMIAL):
Find u,w ve z with computer?
3. LAGRANGE INTERPOLATION METHOD
Newton-Raphson Example 4:
The formulae for the roots of a 3rd degree polynomial are given below
Interpolation with unequal intervals
Presentation transcript:

Calculate the integral with; a) Trapezoidal rule b) Simpson’s rule Sample Solutions: Calculate the integral with; a) Trapezoidal rule b) Simpson’s rule c) With computer (Visual Basic), take m=2, n=4. a) Trapezoidal rule: Divide into for equal section between 0.5 and 1. k θ f 0.5 0.6205 1 0.625 0.6411 2 0.75 0.6337 3 0.875 0.5996 4 0.5403

>>I=int('sqrt(tet)*cos(tet)',0.5,1);vpa(I,5) I=0.30796 Sample Solutions: b) Simpson’s rule: with Matlab >>I=int('sqrt(tet)*cos(tet)',0.5,1);vpa(I,5) I=0.30796 Sub simpson_Click () 80 a = .5: b = 1: m = 2 … 85 f = Sqr(x) * Cos(x) End Sub c) With computer (Visual Basic)

a) Lagrange interpolation (manually) with computer Sample Solutions: The pressure values of a fluid flowing in a pipe are given in the table for different locations . Find the pressure value for 5 m. a) Lagrange interpolation (manually) with computer Location (m) 3 8 10 Pressure (atm) 7 6.2 6 a) with Lagrange interpolation b) For computer solution, the file li.txt is arranged as follows and the code Lagr.I is run. li.txt 3 3,7 8,6.2 10,6 5

x=0.6786 y=0.3885 x=0.6786, y=0.3885 Sample Solutions: How do you find x and y values, which satisfy the equations? Sub newtonrn_Click () 40 n = 2 … 41 xb(1) = 1: xb(2) = 1: xh(1) = .001: xh(2) = .001 45 '---- Error equations ----------- a(1, 1) = 2 * Cos(2 * xb(1)) - 3: a(1, 2) = 3 * xb(2) ^ 2 a(2, 1) = 2 * xb(1): a(2, 2) = 2 * xb(2) + 1 b(1) = -(Sin(2 * xb(1)) + xb(2) ^ 3 - 3 * xb(1) + 1) b(2) = -(xb(1) ^ 2 + xb(2) ^ 2 + xb(2) - 1) 46 '-------------------- End Sub x=0.6786 y=0.3885 with Matlab: >>[x,y]=solve('sin(2*x)+y^3=3*x-1','x^2+y=1-y^2') x=0.6786, y=0.3885

Sample Solutions: As a result of the equilibrium conditions, the equations given below are obtained for a truss system. How do you calculate the member forces FJD, FFD, FCD and FFC if FCK=6.157 kN and FCB=-3.888 kN are known? A b F

A b F with Matlab clc;clear Sample Solutions: A b F with Matlab clc;clear A=[-1 -0.707 -0.894 0;0 -0.707 -1 0;3 0 0 2.365;0 0 0.894 1]; b=[-0.466;0;-6.557;4.353]; F=inv(A)*b FJD= 1.5429 kN FFD= -14.3701 kN FCD= 10.1596 kN FFC= -4.7297 kN

Find the roots of the polynomial. Sample Solutions: Find the roots of the polynomial. with Matlab >> p=[3 0 5 6 -20] >> roots(p) ans = -1.5495 0.1829 + 1.8977i 0.1829 - 1.8977i 1.1838 >>ezplot('3*t^4+5*t^2+6*t-20',-2,2)