2 views

Uploaded by roquesa buray

methods based on linear experiment

save

You are on page 1of 6

College of Engineering

Electronics Engineering Department

Experiment 3

Methods Based on Linear Interpolation

Submitted by:

BS Electronics Engineering – 4

Submitted to:

Instructor

I. Introduction

The secant and the false position methods are closely related. Both

methods require two starting estimates of the root, say, x1 and x2. The

function f(x) is assumed to be approximately linear near the root, so

that the improved value x3 of the root can be estimated by linear

interpolation between x1 and x2.

can be shown to converge quadratically, making it faster than either the

secant or the false position method. It is the method to use if the

derivative of f(x) is impossible or difficult to compute.

II. Theory

(x3), where x3 is the midpoint of the bracket:

g(x) = f(x)e(x−x1)Q

where the constant Q is determined by requiring the points (x1, g1), (x2,

g2), and (x3, g3) to lie on a straight line:

root is then obtained by linear interpolation of g(x) rather than f(x).

III. Data & Results

ridder

function root = ridder(func,x1,x2,tol)

% Ridder's method for computing the rooth of f(x) = 0

% USAGE: root = ridder(func,a,b,tol)

% INPUT:

% func = handle of function that returns f(x).

% x1,x2 = limits of the interval containing the root.

% tol = error tolerance (default is 1.0e6*eps).

% OUTPUT:

% root = zero of f(x) (root = NaN if failed to converge).

f1 = func(x1);

if f1 == 0; root = x1; return; end

f2 = func(x2);

if f2 == 0; root = x2; return; end

if f1*f2 > 0

error('Root is not bracketed in (a,b)')

end

for i = 0:30

% Compute improved root from Riddler's formula

x3 = 0.5*(x1 + x2); f3 = func(x3);

if f3 == 0; root = x3; return; end

s = sqrt(f3*2 - f1*f2);

if s == 0; root = NaN; return; end

x4 = x3 + dx; f4 = func(x4);

% Test for convergence

if i > 0;

if abs(x4 - xOld) < tol*max(abs(x4),1,0)

root = x4; return;

end

end

end

xOld = x4;

% Re-bracket the root

if f3*f4 > 0

if f1*f4 < 0; x2 = x4; f2 = f4;

else x1 = x4; f1 = f4;

end

else

x1 = x3; x2 = x4; f1 = f3; f2 = f4;

end

root = NaN;

end

Determine the root of f (x) = x3 − 10x2 + 5 = 0 that lies in (0.6, 0.8) with

Ridder’s method.

% Function used in Example 4.4

end

Example 4.4 Results (Command Window)

>> fplot(@fex4_4,[0.6,0.8])

Warning: Function fails on array inputs. Use element-wise

operators to increase speed.

> In matlab.graphics.function.FunctionLine>getFunction

In matlab.graphics.function.FunctionLine/updateFunction

In matlab.graphics.function.FunctionLine/set.Function_I

In matlab.graphics.function.FunctionLine/set.Function

In matlab.graphics.function.FunctionLine

In fplot>singleFplot (line 223)

In fplot>@(f)singleFplot(cax,{f},limits,extraOpts,args) (line

182)

In fplot>vectorizeFplot (line 182)

In fplot (line 153)

>> grid on

>> grid on

>> ridder(@fex4_4,0.72,0.74)

ans =

0.7346

Compute the zero of the function

% Function used in Example 4.5

- 1/((x - 0.08)^2 + 0.04);

end

Example 4.5 Results (Command Window)

>> fplot(@fex4_5,[-2,3])

Warning: Function fails on array inputs. Use element-wise

operators to increase speed.

> In matlab.graphics.function.FunctionLine>getFunction

In matlab.graphics.function.FunctionLine/updateFunction

In matlab.graphics.function.FunctionLine/set.Function_I

In matlab.graphics.function.FunctionLine/set.Function

In matlab.graphics.function.FunctionLine

In fplot>singleFplot (line 223)

In fplot>@(f)singleFplot(cax,{f},limits,extraOpts,args) (line

182)

In fplot>vectorizeFplot (line 182)

In fplot (line 153)

>> grid on

>> ridder(@fex4_5,0.1,0.2)

ans =

0.1218

IV. Analysis & Conclusion

function using linear interpolation methods on MATLAB®. The method

specifically used was Ridder’s method, which is discussed in the

introduction and the theoretical background of this report.

The ridder function, which implements Ridder’s method, does not exist

in the MATLAB® software by default. Therefore, prior to finding the

roots of the given equations, the experimenter created a file for the

ridder function which will be used further into the experiment.

method. Initially, one must identify at which interval at the x-axis the

root is located prior to using the ridder function. Once such intervals

are identified, the experimenter will then be able to use the ridder

function to find the roots of the given equation. This can be observed in

the data and results as the experimenter finds the roots of the given

examples.

The experiment also gives a glimpse of how one can easily find the

roots of non-linear equations without the need for manual calculations

by using simulation software such as MATLAB® to generate the output

graphs and results.

BSECE - 4

- Matlab 14Uploaded byadnan
- Amalia RoboUploaded byJaved Iqbal Bhat
- Mws Gen Inp Txt LagrangeUploaded byCaesar Adza Mahendra
- Manipulating Multidimensional Arrays - MATLAB & Simulink Example - MathWorks IndiaUploaded byAnonymous lGK9Y6
- Matlab Tutorial 2 HistogramsUploaded byAmrYassin
- MATLAB Manual KEricksonUploaded byKristin Erickson
- MethodsUploaded bydiegoferro90
- MAF Scalling Using RomRaider v2.0Uploaded byaronmarquez
- Matlab r2010aUploaded byjon_paylaga
- Mat Lab TourUploaded bytunlinn
- Math306&307 - Neumerical Analysis - Lec 2 - Regula FalsiUploaded byHamza Ashraf
- MATLAB & Simulink - 2 page introductionUploaded byshreenandanrao
- v5-2059-2066Uploaded bysaji8
- PDF MATLABUploaded byMuhammad Fauzan Azima
- MicroESystems_Mercury1500V_DataSheetUploaded byElectromate
- DE00182FAF4B81E06C9F7C1257CF6003ACB86Uploaded byFreddy Enrique Ordóñez Parra
- MCDS Exercise 4Uploaded byberkanhzrc67
- CCIL-419-31032009Uploaded byShashank Varma
- 1996 - LIFTPACK-- A Software Package for Wavelet Transforms Using LiftingUploaded bytybonescribd
- Methode Des Elements Finis Cours Annexe 04 Element Quadrilatere Q4Uploaded bykaml
- Geostatistics Without TearsUploaded byDaniel Ignacio
- PRJ1_LineParameters_MERR123-2017B.pdfUploaded bynegritilloomar
- IMSL IDL with the IMSL Math Library and Exponet Gra.pdfUploaded byAshoka Vanjare
- Excel Link 3 User GuideUploaded byZeljko Ristic
- TrajectoryUploaded byVashish Ramrecha
- LKF2DyTransitMatrix_v5Uploaded byFarhan
- ReadmeUploaded byShorav Suriyal
- Matseis 1.12 ManualUploaded byOmegaUser
- Hi GuidelinesUploaded byLuis Humberto Martinez Palmeth
- Derivative - CopyUploaded bySauravDutta

- Activity SampleUploaded byroquesa buray
- Coc Forms FinalUploaded byroquesa buray
- Team Pacific vs DazaUploaded byroquesa buray
- MOA Brgy Kibaghot SampleUploaded byroquesa buray
- Marilyn Victorio-Aquino vs. Pacific Plans, Inc. and Mamerto a. Marcelo, Jr DIGESTUploaded byroquesa buray
- Pretrial BriefUploaded byroquesa buray
- Transportation Law XU Portia ReviewerUploaded byroquesa buray
- Advocates for Truth in Lending, Inc. vs. BSP, Et. Al. DigestUploaded byroquesa buray
- The Barangay Budget and the Budget ProcessUploaded byJonathan
- Pre Trial OrderUploaded byroquesa buray
- Psychology ReportUploaded byroquesa buray
- Republic of the Philippines, Represented by the Anti-money Laundering Council v. First Pacific Network Inc. DIGESTUploaded byroquesa buray
- PYANG_GENERAL-BANKING-LAW.docxUploaded byroquesa buray
- Law Handout - ConstiUploaded byroquesa buray
- DoneChapter-1-G3-Research-G12-Abm-2.docxUploaded byroquesa buray
- Bank Secrecy Case DigestsUploaded byroquesa buray
- Promotion Letter SampleUploaded byroquesa buray
- Special Proceedings 1996 2014Uploaded byroquesa buray
- preference of credits case digests.pdfUploaded byroquesa buray
- Position Paper SampleUploaded byroquesa buray
- Position Paper SampleUploaded byroquesa buray
- Information for theft SampleUploaded byroquesa buray
- Civil Procedure Case Digests (Rules 3 & 4)Uploaded byroquesa buray
- Evidence:Opinion Rule, Character evidence, Rule on examinations of child witnessUploaded byroquesa buray
- Evidence:Opinion Rule, Character evidence, Rule on examinations of child witnessUploaded byroquesa buray
- Probative Value of Testimony of an Expert WitnessUploaded byroquesa buray
- Sample Format of Judicial AffidavitUploaded byroquesa buray
- Sample Format of Judicial AffidavitUploaded byroquesa buray
- Marquez vs. DesiertoUploaded byroquesa buray

- Estimation HandoutUploaded byshan
- Reading Comprehension Test 16Uploaded bymouchkilhada
- mechaniclUploaded byPrem Chander
- AN865A_SIA_1Uploaded byfelixsafar3243
- ede492 digital citizenship lesson planUploaded byapi-367355266
- TalendUploaded bywaylead
- Con6975 Sqltuning-Aioug16 FinalUploaded bysanjayid1980
- Full Notes-theory of computerUploaded byJoe Sainathan
- Skills-Assessment-Guidelines-for-Applicants.pdfUploaded bypromila09
- Difference in Web2.0,1.0,3.0Uploaded byanilkumar_krla
- Cadi Software ManualUploaded byLuis A Gil Pantoja
- 06 WCDMA Site SurveyUploaded byChúngNguyễn
- decodersUploaded byRenita Mink
- New automata books linkUploaded byAjay Pandey
- Forgery and the Handwriting ExpertUploaded byAlsomar86
- 20761B-ENU-TrainerHandbook QueryingUploaded byGuillermo Prieto
- ANSYSUploaded byparth daxini
- lotus console commandsUploaded byTanmoy Sen
- Robertson_Force.pdfUploaded byAi Heart Pink
- a0_vertical_template2.pptxUploaded byJasleen Kaur
- gc420Uploaded byarrowheadcorp
- 88103991-Complete-850Uploaded byinthemoney8
- Ab Initio Interview QuestionsUploaded byamitkumar0701
- Chapter10 VerilogUploaded byCris Calitina
- Tv TerminalUploaded byhadi_acasa
- Car Information Computer_webUploaded byTimur Kadyrov
- Security Vulnerabilities in UsingUploaded bySean
- EliminatorSub EdsUploaded byddds
- System Administration for the Oracle Solaris 10 OS Part 2 Practice GuideUploaded byNitin Kanojia
- MEMSFSUploaded byhamid2020