0 views

Uploaded by কামরান আশরাফ বাবু

- Moment Inertia Integration
- newton Interpolations
- Integrare Numerica - FEM
- Integral Calculus
- appendix
- MA-123_Exam1_sol-1.pdf
- Numerical Integration
- Self Study Information
- 6) C4 Integration
- PAT Syllabus
- Numerical solution of a special type of integro-differential equations
- UTF-8'en'[Open Geosciences] Volume Calculation of Subsurface Structures and Traps in Hydrocarbon Exploration a Comparison Between Numerical Integration and Cell Based Models
- 11301 Venkataraghavan Presentation
- Fundamentals of Calculus II - MATH 020 OL1 - Course Syllabus
- Polynomial Integral Predictor_Corrector
- lecture-static-04_011.pdf
- Improvement of the Resolution of an Instrument by Numerical Solution of an Integral Equation
- Mathematics-1.pdf
- Nltl Emc Fdq
- Journal Paper

You are on page 1of 5

EEE-3102: Numerical Technique Laboratory

University of Dhaka

Department of Electrical and Electronic Engineering

EEE-3102: Numerical Technique Laboratory

Section: B-11

Class Roll: SH-073-027

Name:Mahabub-A-Alahi

Date:18-04-2019

Things to do: Read the theory carefully and answer all the questions from Question 1 to Question8

for the given Matlab code. After practicing the matlab example, perform exercise 1 to exercise 3.

The integral of a function y = 𝑓(𝑥) is denoted as

b

A f ( x)dx

a

For a function 𝑦=𝑓(𝑥), the approximation of the area (A) under the curve can be found by dividing the

area up to a number of rectangles and then summing the contribution from all the rectangles.

n 1

( yi 1 yi )

A ( xi 1 xi ).

i 1 2

This process is known as the trapezoid rule.The integral can be approximated using n trapezoids

formed by using straight line segments between the points (xi-1, yi-1) and (xi, yi) for 1 ≤I ≤ n as shown

in the figure below:

University of Dhaka

Department of Electrical and Electronic Engineering

EEE-3102: Numerical Technique Laboratory

The area of a trapezoid is obtained by adding the area of a rectangle and triangle:

1 (y y )

A y0x ( y1 y0 )x 1 0 x

2 2

Example: Given the function

y x2

The exact integral of the function is

b

b

x3 1 3

A x dx (b a3 )

2

a 3 a 3

The integral from a = 0 to b = 3 is

1

A (33 ) 9

3

University of Dhaka

Department of Electrical and Electronic Engineering

EEE-3102: Numerical Technique Laboratory

Trapezoid rule and diff function in matlab can be used to solve the numerical integral of function y =

x2 from 0 to 3:

clear all; close all; clc;

x=0:1:3;

y=x.^2;

avg_y = y(1:length(x)-1) + diff(y)/2;

A = sum(diff(x).*avg_y)

Ans:9.5000

Question2: Run the above code and find the results for x=0:0.5:3; x=0:0.1:3; and x=0:0.01:3;

Ans(for x=0:0.5:3):9.1250

Ans(for x=0:0.1:3):9.0050

Ans(for x=0:0.01:3):9.0000

Question3: Why the results are different? When the results become more accurate?

Ans:The results are different because the value of the x vector,The result has become more accurate

when the step among the values of x vector has taken very small as x=0:0.01:3.

Matlab built-in function for numerical integration:

1. Integral: MATLAB also has a variety of numerical integrators, of which the standard one is

‘integral’. To compute a numerical approximation of the definite integral, we can use the following

command ‘integral(f,a,b)’

Example: To find the numerical integral offunction y x 2 from 0 to 3, we use the following

command

y=@(x) x.^2;

A=integral(y,0,3)

Question4: What is the value of A obtained after running the above code? Is it accurate?

Ans:9. Yes the value of A obtained after the running the avobe code is accurate.

2. Quadrature: Quadrature is a numerical method used to find the area under the graph of a function,

that is, to compute a definite integral.

University of Dhaka

Department of Electrical and Electronic Engineering

EEE-3102: Numerical Technique Laboratory

function y from a to b within an error of 1e-6 using recursive adaptive Simpson quadrature.

Example:To find the numerical integral of function y x 2 from 0 to 3, we use the following

command:

y=@(x) x.^2;

A=quad(y,0,3)

Question5: What is the value of A obtained after running the above code? Is it accurate?

Ans:9.0000.yes the value is accurate.

to within an error of 10-6 using recursive adaptive Lobatto quadrature.

following command:

y=@(x) x.^2;

A=quadl(y,0,3)

Question6: What is the value of A obtained after running the above code? Is it accurate?

Ans:9.0000.yes the result is accurate.

c) Double integral: A = dblquad(f,xmin,xmax,ymin,ymax) calls the quad function to evaluate

the double integral of function z=f(x,y) over the rectangle xmin≤ x ≤xmax, ymin≤ y ≤ymax.

we use the following command:

z=@(x,y)(x.^2).*y;

A=dblquad(z,0,3,1,2)

Ans:13.5

Question8: What is the result obtained after running the above code?

Ans:13.5000

University of Dhaka

Department of Electrical and Electronic Engineering

EEE-3102: Numerical Technique Laboratory

Exercise

Exercise-1: Find the numerical integration of the following function

5

y

x 2x2 x 3

3

from 0 to 5 using (a) trapezoid rule, (b) ‘integral’ matlab function, (c) ‘quad’ matlab function, and (d)

‘quadl’ matlab function.

Ans(a):2.3634

Ans(b):2.3760

Ans(c):2.3760

Ans(d):2.3760

y sin( x 2 )

from 1 to 2 using (a) trapezoid rule, (b) ‘integral’ matlab function, (c) ‘quad’ matlab function, and (d)

‘quadl’ matlab function.

Ans(a):0.7735

Ans(b):0.4945

Ans(c):0.4945

Ans(d):0.4945

f x cos y y sin x

for π ≤ x ≤ 2π and 0 ≤ y ≤ π, from 1 to 2 using dblquadmatlab function

Ans:-9.8696

- Moment Inertia IntegrationUploaded byTsuki Zombina
- newton InterpolationsUploaded byJennifer Jenkins
- Integrare Numerica - FEMUploaded bysteven_gog
- Integral CalculusUploaded byLiregine Cayme
- appendixUploaded bySaurabh Dixit
- MA-123_Exam1_sol-1.pdfUploaded byAnonymous QiCse1s
- Numerical IntegrationUploaded byMisgun Samuel
- Self Study InformationUploaded byShri.krsna
- 6) C4 IntegrationUploaded byAnonymous ZtkUdjvx
- PAT SyllabusUploaded byRuxandra Constantin
- Numerical solution of a special type of integro-differential equationsUploaded byRashed2010
- UTF-8'en'[Open Geosciences] Volume Calculation of Subsurface Structures and Traps in Hydrocarbon Exploration a Comparison Between Numerical Integration and Cell Based ModelsUploaded byHcene Hcen
- 11301 Venkataraghavan PresentationUploaded byMohamed Balbaa
- Fundamentals of Calculus II - MATH 020 OL1 - Course SyllabusUploaded byContinuing Education at the University of Vermont
- Polynomial Integral Predictor_CorrectorUploaded by440grafix
- lecture-static-04_011.pdfUploaded byAshoka Vanjare
- Improvement of the Resolution of an Instrument by Numerical Solution of an Integral EquationUploaded byNarinder Singh Johal
- Mathematics-1.pdfUploaded byRAJESH KUMAR
- Nltl Emc FdqUploaded byBOUZIANE Amine
- Journal PaperUploaded bysachin.irukula
- High-Order Collocation Methods for Differential Equations With Random InputsUploaded byhjhyh88
- 3semassigjan09-10Uploaded byreasy
- TRB 2016 syllabusUploaded byraj
- PracticeProblems_Math126_Fall2014Uploaded byGerald Aguilar
- 2 Integral DefinidaUploaded byTecni Cleaning
- 00825815 Energy Calculation of a Permanent Magnet System by Surface and Flux Integrals the Flux-mmf MethodUploaded byjames<XIII
- IntegralUploaded bysaunvict
- intsubUploaded byLeomar Acosta Ballesteros
- 01. PrefaceUploaded byvarmavishnu
- 0205063Uploaded bySuperman

- HospitalUploaded bywilda
- Hydraulic Pumps and MotorsUploaded byChumporn Saraphatmarkying
- Homestay DevelopmentUploaded bybangbang63
- A History of Network Synthesis and Filter Theory for Circuits Composed of Resistors, tors And CapacitorsUploaded bydadado98
- Underwater Architecture 1Uploaded byRishi Kalia
- wakefield-safeguarding-children-board-early-help-strategy.pdfUploaded byfgfgfghgh
- Sociolinguistics OverviewUploaded bySandra Streignard
- Brochure Career PlanningUploaded bygoodfela22
- Saya Recognition Dragon ReportUploaded byGautham Padmaraju
- APAME 2017 Invitation Jeong-Wook SEOUploaded byMs. Rachel Samson
- Tuak & OHIPUploaded byblvck29
- Oil SealsUploaded bymrmrva
- Ocular Inspection ReportUploaded byDan Emmanuel R. Ventura
- Tribology of Piston Compression Ring ConUploaded byanon_952931296
- Registered Teacher Criteria CopyUploaded byStephen Snell
- Escape from Tenopia 1 Tenopia Island.pdfUploaded byJUDGE
- Parker Team Player for Grad Students.pptUploaded byRavz Ravnish Wesley
- Group - II Syllabus AppscUploaded byvmktpt
- Project Report on RailwayUploaded bysatishdaksha534
- ipi66915.pdfUploaded byabimana
- unit1_newUploaded byrushanand
- Strategic Management InputUploaded byRaihanah Rahmah
- History of the Hanford Site, by DW HarveyUploaded byOccupyMedia
- Penetration Testing With Selenium-Yiannis Pavlosoglou v2Uploaded bysireeshas
- CV of Mr. Marlon Borromeo Ramirez.docUploaded byThe Clasher
- BE CHPUploaded byAlejandro Cardenas
- Counseling TechniquesUploaded bymschoolofagriculture
- BOETHIUS, De Trinitate & Consolatio PhilosophiaeUploaded byThisisReallyatest
- Calo Robots PrivacyUploaded byUtty F. Seiei
- preparation of methanolUploaded byGopal Agarwal