SlideShare una empresa de Scribd logo
1 de 4
Assignment (3)


Q1. Solve the integral                          using paper and pen or calculator, and
then compare the answer to the computational method using the Romberg method.

Solution



= [x6 /6 + x5 /5 + x4/ 4 + ex]

={ [1/6 (4)6 + 1/5 (4)5 + 1/4(4)4 + e4] –[1/6 (0.5)6 + 1/5 (0.5)5 + 1/4(0.5)4 + e5] }

= (1006.06) –(1.752865) = 1004.3071



function [q,ea,iter]=romberg(func,a,b,es,maxit,varargin)
% if nargin<3,error('at least 3arguments required'),end
if nargin<4||isempty(es),es=0.000001;end
if nargin<5||isempty(maxit),maxit=50;end
n=1;
r(1,1) = trap(func,a,b,n,varargin{:});
iter=0;
while iter<maxit
   iter=iter+1;
   n=2^iter;
   I(iter+1,1)=trap(func,a,b,n,varargin{:});
   for k=2:iter+1
      j=2+iter-k;
      I(j,k)=(4^(k-1)*I(j+1,k-1)-I(j,k-1))/(4^(k-1)-1);
   end
   ea=abs((I(1,iter+1)-I(2,iter))/I(1,iter+1))*100;
   if ea<=es, break; end
end
q=I(1,iter+1);



function I=trap(func,a,b,n,varargin)
if(nargin<3)
   error('at least 3 input arguments required');
end
if ~(b>a),error('upper bound must be greater than lower'),end
if nargin<4||isempty(n),n=100;end

  x=a; h=(b-a)/n;

    s=func(a,varargin{:});
      for i=1:n-1
        x=x+h;
     s=s+2*func(x,varargin{:});
   end
  s=s+func(b,varargin{:});
  I=(b-a)*s/(2*n);


>> f=@(x) x^5+x^4+x^3+exp(x);



>> romberg(f,0.5,4)



ans =



 1.0044e+003
Q2. Calculate the integral                    dt. The exact answer to this integral is
15.41260804810169. Solve the integral using the Romberg method



Solution


function [q,ea,iter]=romberg(func,a,b,es,maxit,varargin)
% if nargin<3,error('at least 3arguments required'),end
if nargin<4||isempty(es),es=0.000001;end
if nargin<5||isempty(maxit),maxit=50;end
n=1;
r(1,1) = trap(func,a,b,n,varargin{:});
iter=0;
while iter<maxit
   iter=iter+1;
   n=2^iter;
   I(iter+1,1)=trap(func,a,b,n,varargin{:});
   for k=2:iter+1



     j=2+iter-k;
     I(j,k)=(4^(k-1)*I(j+1,k-1)-I(j,k-1))/(4^(k-1)-1);
  end
  ea=abs((I(1,iter+1)-I(2,iter))/I(1,iter+1))*100;
  if ea<=es, break; end
end
q=I(1,iter+1);

function I=trap(func,a,b,n,varargin)
if(nargin<3)
   error('at least 3 input arguments required');
end
if ~(b>a),error('upper bound must be greater than lower'),end
if nargin<4||isempty(n),n=100;end
   x=a; h=(b-a)/n;
   s=func(a,varargin{:});
   for i=1:n-1
      x=x+h;
      s=s+2*func(x,varargin{:});
   end
   s=s+func(b,varargin{:});
   I=(b-a)*s/(2*n);
>> f=@(t) (10*exp(-t)*sin(2*pi*t))^2


>> romberg (f,0,0.5)


ans =


 15.4126

Más contenido relacionado

La actualidad más candente

Jan. 6 Inverse Functions
Jan. 6 Inverse FunctionsJan. 6 Inverse Functions
Jan. 6 Inverse FunctionsRyanWatt
 
Laplace periodic function
Laplace periodic functionLaplace periodic function
Laplace periodic functionKaushal Surti
 
The Moore-Spiegel Oscillator
The Moore-Spiegel OscillatorThe Moore-Spiegel Oscillator
The Moore-Spiegel OscillatorAbhranil Das
 
Application of derivatives
Application of derivativesApplication of derivatives
Application of derivativesindu thakur
 
Application of differentiation
Application of differentiationApplication of differentiation
Application of differentiationLily Maryati
 
APPLICATION OF PARTIAL DIFFERENTIATION
APPLICATION OF PARTIAL DIFFERENTIATIONAPPLICATION OF PARTIAL DIFFERENTIATION
APPLICATION OF PARTIAL DIFFERENTIATIONDhrupal Patel
 
Newton cotes integration method
Newton cotes integration  methodNewton cotes integration  method
Newton cotes integration methodshashikant pabari
 
application of partial differentiation
application of partial differentiationapplication of partial differentiation
application of partial differentiationeteaching
 
Math - Operations on Functions, Kinds of Functions
Math - Operations on Functions, Kinds of FunctionsMath - Operations on Functions, Kinds of Functions
Math - Operations on Functions, Kinds of FunctionsChuckie Balbuena
 
Lecture 18 antiderivatives - section 4.8
Lecture 18   antiderivatives - section 4.8Lecture 18   antiderivatives - section 4.8
Lecture 18 antiderivatives - section 4.8njit-ronbrown
 
5.7 rolle's thrm & mv theorem
5.7 rolle's thrm & mv theorem5.7 rolle's thrm & mv theorem
5.7 rolle's thrm & mv theoremdicosmo178
 
Inverse Functions
Inverse FunctionsInverse Functions
Inverse Functionsswartzje
 
Polynomial And Rational Funciotns 0921
Polynomial And Rational Funciotns 0921Polynomial And Rational Funciotns 0921
Polynomial And Rational Funciotns 0921ingroy
 

La actualidad más candente (20)

Jan. 6 Inverse Functions
Jan. 6 Inverse FunctionsJan. 6 Inverse Functions
Jan. 6 Inverse Functions
 
Laplace periodic function
Laplace periodic functionLaplace periodic function
Laplace periodic function
 
The Moore-Spiegel Oscillator
The Moore-Spiegel OscillatorThe Moore-Spiegel Oscillator
The Moore-Spiegel Oscillator
 
Application of derivatives
Application of derivativesApplication of derivatives
Application of derivatives
 
Application of differentiation
Application of differentiationApplication of differentiation
Application of differentiation
 
Es272 ch6
Es272 ch6Es272 ch6
Es272 ch6
 
APPLICATION OF PARTIAL DIFFERENTIATION
APPLICATION OF PARTIAL DIFFERENTIATIONAPPLICATION OF PARTIAL DIFFERENTIATION
APPLICATION OF PARTIAL DIFFERENTIATION
 
Newton cotes integration method
Newton cotes integration  methodNewton cotes integration  method
Newton cotes integration method
 
residue
residueresidue
residue
 
Taylor series
Taylor seriesTaylor series
Taylor series
 
application of partial differentiation
application of partial differentiationapplication of partial differentiation
application of partial differentiation
 
Math - Operations on Functions, Kinds of Functions
Math - Operations on Functions, Kinds of FunctionsMath - Operations on Functions, Kinds of Functions
Math - Operations on Functions, Kinds of Functions
 
Lecture 18 antiderivatives - section 4.8
Lecture 18   antiderivatives - section 4.8Lecture 18   antiderivatives - section 4.8
Lecture 18 antiderivatives - section 4.8
 
5.7 rolle's thrm & mv theorem
5.7 rolle's thrm & mv theorem5.7 rolle's thrm & mv theorem
5.7 rolle's thrm & mv theorem
 
Inverse Functions
Inverse FunctionsInverse Functions
Inverse Functions
 
Inverse functions
Inverse functionsInverse functions
Inverse functions
 
Polynomial And Rational Funciotns 0921
Polynomial And Rational Funciotns 0921Polynomial And Rational Funciotns 0921
Polynomial And Rational Funciotns 0921
 
Fourier series
Fourier series Fourier series
Fourier series
 
Lecture6
Lecture6Lecture6
Lecture6
 
Inverse Functions
Inverse FunctionsInverse Functions
Inverse Functions
 

Destacado

Are you paying attention presentation assignment #2-a crash course in creativ...
Are you paying attention presentation assignment #2-a crash course in creativ...Are you paying attention presentation assignment #2-a crash course in creativ...
Are you paying attention presentation assignment #2-a crash course in creativ...Seth Schalet
 
1.2. pruebas de hipótesis de una muestra parte 2
1.2. pruebas de hipótesis de una muestra parte 21.2. pruebas de hipótesis de una muestra parte 2
1.2. pruebas de hipótesis de una muestra parte 2alexis cañez
 
сетевые информационные технологии
сетевые информационные технологиисетевые информационные технологии
сетевые информационные технологииLazzerChel
 
Demmons creative 2011_small
Demmons creative 2011_smallDemmons creative 2011_small
Demmons creative 2011_smallMichael Demmons
 
De kiemtra 1 tiết lop 10
De kiemtra 1 tiết lop 10De kiemtra 1 tiết lop 10
De kiemtra 1 tiết lop 10nhom05vb2
 
Sponsorship opportunities at big boys toys 2012
Sponsorship opportunities at big boys toys 2012Sponsorship opportunities at big boys toys 2012
Sponsorship opportunities at big boys toys 2012Big Boys Toys UAE
 
Autism training-powerpoint
Autism training-powerpointAutism training-powerpoint
Autism training-powerpointdenisebur
 
Experimental Design
Experimental DesignExperimental Design
Experimental Designcoachsmb05
 
Roseland proposal
Roseland proposalRoseland proposal
Roseland proposalandymag1
 
Epic poetry battles of history!
Epic poetry battles of history!Epic poetry battles of history!
Epic poetry battles of history!Amanda Villalobos
 
The Yammer Way - Our Product Development Approach
The Yammer Way - Our Product Development ApproachThe Yammer Way - Our Product Development Approach
The Yammer Way - Our Product Development Approachyann ARMAND
 

Destacado (16)

Who said it
Who said itWho said it
Who said it
 
President powerpoint
President powerpointPresident powerpoint
President powerpoint
 
Bee
BeeBee
Bee
 
Are you paying attention presentation assignment #2-a crash course in creativ...
Are you paying attention presentation assignment #2-a crash course in creativ...Are you paying attention presentation assignment #2-a crash course in creativ...
Are you paying attention presentation assignment #2-a crash course in creativ...
 
Scars identify
Scars identifyScars identify
Scars identify
 
1.2. pruebas de hipótesis de una muestra parte 2
1.2. pruebas de hipótesis de una muestra parte 21.2. pruebas de hipótesis de una muestra parte 2
1.2. pruebas de hipótesis de una muestra parte 2
 
сетевые информационные технологии
сетевые информационные технологиисетевые информационные технологии
сетевые информационные технологии
 
Demmons creative 2011_small
Demmons creative 2011_smallDemmons creative 2011_small
Demmons creative 2011_small
 
De kiemtra 1 tiết lop 10
De kiemtra 1 tiết lop 10De kiemtra 1 tiết lop 10
De kiemtra 1 tiết lop 10
 
Sponsorship opportunities at big boys toys 2012
Sponsorship opportunities at big boys toys 2012Sponsorship opportunities at big boys toys 2012
Sponsorship opportunities at big boys toys 2012
 
Gg ppt
Gg pptGg ppt
Gg ppt
 
Autism training-powerpoint
Autism training-powerpointAutism training-powerpoint
Autism training-powerpoint
 
Experimental Design
Experimental DesignExperimental Design
Experimental Design
 
Roseland proposal
Roseland proposalRoseland proposal
Roseland proposal
 
Epic poetry battles of history!
Epic poetry battles of history!Epic poetry battles of history!
Epic poetry battles of history!
 
The Yammer Way - Our Product Development Approach
The Yammer Way - Our Product Development ApproachThe Yammer Way - Our Product Development Approach
The Yammer Way - Our Product Development Approach
 

Similar a Assignment 3

Intro to Functional Programming Workshop (code4lib)
Intro to Functional Programming Workshop (code4lib)Intro to Functional Programming Workshop (code4lib)
Intro to Functional Programming Workshop (code4lib)Will Kurt
 
Tarea De Scilab By Sebastian Vasquez
Tarea De Scilab By Sebastian VasquezTarea De Scilab By Sebastian Vasquez
Tarea De Scilab By Sebastian VasquezSebastian Vasquez
 
Ejercicios Scilab Completo
Ejercicios Scilab CompletoEjercicios Scilab Completo
Ejercicios Scilab CompletoRicardo Grandas
 
2. Fixed Point Iteration.pptx
2. Fixed Point Iteration.pptx2. Fixed Point Iteration.pptx
2. Fixed Point Iteration.pptxsaadhaq6
 
Introduction to MatLab programming
Introduction to MatLab programmingIntroduction to MatLab programming
Introduction to MatLab programmingDamian T. Gordon
 
MATLABAssignment 2Bracketing (Multiple Roots) (4)Bisection .docx
MATLABAssignment 2Bracketing (Multiple Roots) (4)Bisection .docxMATLABAssignment 2Bracketing (Multiple Roots) (4)Bisection .docx
MATLABAssignment 2Bracketing (Multiple Roots) (4)Bisection .docxandreecapon
 
Introduction to Functional Programming with Haskell and JavaScript
Introduction to Functional Programming with Haskell and JavaScriptIntroduction to Functional Programming with Haskell and JavaScript
Introduction to Functional Programming with Haskell and JavaScriptWill Kurt
 
Solucionario_de_Chapra_y_Canale_Quinta_E.pdf
Solucionario_de_Chapra_y_Canale_Quinta_E.pdfSolucionario_de_Chapra_y_Canale_Quinta_E.pdf
Solucionario_de_Chapra_y_Canale_Quinta_E.pdfJeancarlosPatalasanc
 
Performance Portability Through Descriptive Parallelism
Performance Portability Through Descriptive ParallelismPerformance Portability Through Descriptive Parallelism
Performance Portability Through Descriptive ParallelismJeff Larkin
 
Programación funcional con Haskell
Programación funcional con HaskellProgramación funcional con Haskell
Programación funcional con HaskellSoftware Guru
 
Gamma beta functions-1
Gamma   beta functions-1Gamma   beta functions-1
Gamma beta functions-1Selvaraj John
 
NUMERICAL METHODS WITH MATLAB : bisection,mueller's,newton-raphson,false poin...
NUMERICAL METHODS WITH MATLAB : bisection,mueller's,newton-raphson,false poin...NUMERICAL METHODS WITH MATLAB : bisection,mueller's,newton-raphson,false poin...
NUMERICAL METHODS WITH MATLAB : bisection,mueller's,newton-raphson,false poin...Parhamsagharchi
 
Csci101 lect04 advanced_selection
Csci101 lect04 advanced_selectionCsci101 lect04 advanced_selection
Csci101 lect04 advanced_selectionElsayed Hemayed
 

Similar a Assignment 3 (20)

Intro to Functional Programming Workshop (code4lib)
Intro to Functional Programming Workshop (code4lib)Intro to Functional Programming Workshop (code4lib)
Intro to Functional Programming Workshop (code4lib)
 
Tarea De Scilab By Sebastian Vasquez
Tarea De Scilab By Sebastian VasquezTarea De Scilab By Sebastian Vasquez
Tarea De Scilab By Sebastian Vasquez
 
Ejercicios Scilab Completo
Ejercicios Scilab CompletoEjercicios Scilab Completo
Ejercicios Scilab Completo
 
2. Fixed Point Iteration.pptx
2. Fixed Point Iteration.pptx2. Fixed Point Iteration.pptx
2. Fixed Point Iteration.pptx
 
Taller De Scilab
Taller De ScilabTaller De Scilab
Taller De Scilab
 
Introduction to MatLab programming
Introduction to MatLab programmingIntroduction to MatLab programming
Introduction to MatLab programming
 
MATLABAssignment 2Bracketing (Multiple Roots) (4)Bisection .docx
MATLABAssignment 2Bracketing (Multiple Roots) (4)Bisection .docxMATLABAssignment 2Bracketing (Multiple Roots) (4)Bisection .docx
MATLABAssignment 2Bracketing (Multiple Roots) (4)Bisection .docx
 
Primer Punto
Primer PuntoPrimer Punto
Primer Punto
 
Numerical Method for UOG mech stu prd by Abdrehman Ahmed
Numerical Method for UOG mech stu prd by Abdrehman Ahmed Numerical Method for UOG mech stu prd by Abdrehman Ahmed
Numerical Method for UOG mech stu prd by Abdrehman Ahmed
 
Numerical methods generating polynomial
Numerical methods generating polynomialNumerical methods generating polynomial
Numerical methods generating polynomial
 
Introduction to Functional Programming with Haskell and JavaScript
Introduction to Functional Programming with Haskell and JavaScriptIntroduction to Functional Programming with Haskell and JavaScript
Introduction to Functional Programming with Haskell and JavaScript
 
Solucionario_de_Chapra_y_Canale_Quinta_E.pdf
Solucionario_de_Chapra_y_Canale_Quinta_E.pdfSolucionario_de_Chapra_y_Canale_Quinta_E.pdf
Solucionario_de_Chapra_y_Canale_Quinta_E.pdf
 
Performance Portability Through Descriptive Parallelism
Performance Portability Through Descriptive ParallelismPerformance Portability Through Descriptive Parallelism
Performance Portability Through Descriptive Parallelism
 
Mit6 094 iap10_lec03
Mit6 094 iap10_lec03Mit6 094 iap10_lec03
Mit6 094 iap10_lec03
 
Programación funcional con Haskell
Programación funcional con HaskellProgramación funcional con Haskell
Programación funcional con Haskell
 
Sary
SarySary
Sary
 
Gamma beta functions-1
Gamma   beta functions-1Gamma   beta functions-1
Gamma beta functions-1
 
NUMERICAL METHODS WITH MATLAB : bisection,mueller's,newton-raphson,false poin...
NUMERICAL METHODS WITH MATLAB : bisection,mueller's,newton-raphson,false poin...NUMERICAL METHODS WITH MATLAB : bisection,mueller's,newton-raphson,false poin...
NUMERICAL METHODS WITH MATLAB : bisection,mueller's,newton-raphson,false poin...
 
Csci101 lect04 advanced_selection
Csci101 lect04 advanced_selectionCsci101 lect04 advanced_selection
Csci101 lect04 advanced_selection
 
Millionways
MillionwaysMillionways
Millionways
 

Último

Dr. Admir Softic_ presentation_Green Club_ENG.pdf
Dr. Admir Softic_ presentation_Green Club_ENG.pdfDr. Admir Softic_ presentation_Green Club_ENG.pdf
Dr. Admir Softic_ presentation_Green Club_ENG.pdfAdmir Softic
 
Call Girls Hebbal Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
Call Girls Hebbal Just Call 👗 7737669865 👗 Top Class Call Girl Service BangaloreCall Girls Hebbal Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
Call Girls Hebbal Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangaloreamitlee9823
 
Value Proposition canvas- Customer needs and pains
Value Proposition canvas- Customer needs and painsValue Proposition canvas- Customer needs and pains
Value Proposition canvas- Customer needs and painsP&CO
 
Organizational Transformation Lead with Culture
Organizational Transformation Lead with CultureOrganizational Transformation Lead with Culture
Organizational Transformation Lead with CultureSeta Wicaksana
 
Call Girls From Raj Nagar Extension Ghaziabad❤️8448577510 ⊹Best Escorts Servi...
Call Girls From Raj Nagar Extension Ghaziabad❤️8448577510 ⊹Best Escorts Servi...Call Girls From Raj Nagar Extension Ghaziabad❤️8448577510 ⊹Best Escorts Servi...
Call Girls From Raj Nagar Extension Ghaziabad❤️8448577510 ⊹Best Escorts Servi...lizamodels9
 
Whitefield CALL GIRL IN 98274*61493 ❤CALL GIRLS IN ESCORT SERVICE❤CALL GIRL
Whitefield CALL GIRL IN 98274*61493 ❤CALL GIRLS IN ESCORT SERVICE❤CALL GIRLWhitefield CALL GIRL IN 98274*61493 ❤CALL GIRLS IN ESCORT SERVICE❤CALL GIRL
Whitefield CALL GIRL IN 98274*61493 ❤CALL GIRLS IN ESCORT SERVICE❤CALL GIRLkapoorjyoti4444
 
BAGALUR CALL GIRL IN 98274*61493 ❤CALL GIRLS IN ESCORT SERVICE❤CALL GIRL
BAGALUR CALL GIRL IN 98274*61493 ❤CALL GIRLS IN ESCORT SERVICE❤CALL GIRLBAGALUR CALL GIRL IN 98274*61493 ❤CALL GIRLS IN ESCORT SERVICE❤CALL GIRL
BAGALUR CALL GIRL IN 98274*61493 ❤CALL GIRLS IN ESCORT SERVICE❤CALL GIRLkapoorjyoti4444
 
Eluru Call Girls Service ☎ ️93326-06886 ❤️‍🔥 Enjoy 24/7 Escort Service
Eluru Call Girls Service ☎ ️93326-06886 ❤️‍🔥 Enjoy 24/7 Escort ServiceEluru Call Girls Service ☎ ️93326-06886 ❤️‍🔥 Enjoy 24/7 Escort Service
Eluru Call Girls Service ☎ ️93326-06886 ❤️‍🔥 Enjoy 24/7 Escort ServiceDamini Dixit
 
SEO Case Study: How I Increased SEO Traffic & Ranking by 50-60% in 6 Months
SEO Case Study: How I Increased SEO Traffic & Ranking by 50-60%  in 6 MonthsSEO Case Study: How I Increased SEO Traffic & Ranking by 50-60%  in 6 Months
SEO Case Study: How I Increased SEO Traffic & Ranking by 50-60% in 6 MonthsIndeedSEO
 
Nelamangala Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
Nelamangala Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...Nelamangala Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
Nelamangala Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...amitlee9823
 
👉Chandigarh Call Girls 👉9878799926👉Just Call👉Chandigarh Call Girl In Chandiga...
👉Chandigarh Call Girls 👉9878799926👉Just Call👉Chandigarh Call Girl In Chandiga...👉Chandigarh Call Girls 👉9878799926👉Just Call👉Chandigarh Call Girl In Chandiga...
👉Chandigarh Call Girls 👉9878799926👉Just Call👉Chandigarh Call Girl In Chandiga...rajveerescorts2022
 
Call Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service Available
Call Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service AvailableCall Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service Available
Call Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service AvailableSeo
 
Marel Q1 2024 Investor Presentation from May 8, 2024
Marel Q1 2024 Investor Presentation from May 8, 2024Marel Q1 2024 Investor Presentation from May 8, 2024
Marel Q1 2024 Investor Presentation from May 8, 2024Marel
 
Cracking the Cultural Competence Code.pptx
Cracking the Cultural Competence Code.pptxCracking the Cultural Competence Code.pptx
Cracking the Cultural Competence Code.pptxWorkforce Group
 
Call Girls in Delhi, Escort Service Available 24x7 in Delhi 959961-/-3876
Call Girls in Delhi, Escort Service Available 24x7 in Delhi 959961-/-3876Call Girls in Delhi, Escort Service Available 24x7 in Delhi 959961-/-3876
Call Girls in Delhi, Escort Service Available 24x7 in Delhi 959961-/-3876dlhescort
 
Phases of Negotiation .pptx
 Phases of Negotiation .pptx Phases of Negotiation .pptx
Phases of Negotiation .pptxnandhinijagan9867
 
The Abortion pills for sale in Qatar@Doha [+27737758557] []Deira Dubai Kuwait
The Abortion pills for sale in Qatar@Doha [+27737758557] []Deira Dubai KuwaitThe Abortion pills for sale in Qatar@Doha [+27737758557] []Deira Dubai Kuwait
The Abortion pills for sale in Qatar@Doha [+27737758557] []Deira Dubai Kuwaitdaisycvs
 
The Path to Product Excellence: Avoiding Common Pitfalls and Enhancing Commun...
The Path to Product Excellence: Avoiding Common Pitfalls and Enhancing Commun...The Path to Product Excellence: Avoiding Common Pitfalls and Enhancing Commun...
The Path to Product Excellence: Avoiding Common Pitfalls and Enhancing Commun...Aggregage
 
Call Girls From Pari Chowk Greater Noida ❤️8448577510 ⊹Best Escorts Service I...
Call Girls From Pari Chowk Greater Noida ❤️8448577510 ⊹Best Escorts Service I...Call Girls From Pari Chowk Greater Noida ❤️8448577510 ⊹Best Escorts Service I...
Call Girls From Pari Chowk Greater Noida ❤️8448577510 ⊹Best Escorts Service I...lizamodels9
 
PHX May 2024 Corporate Presentation Final
PHX May 2024 Corporate Presentation FinalPHX May 2024 Corporate Presentation Final
PHX May 2024 Corporate Presentation FinalPanhandleOilandGas
 

Último (20)

Dr. Admir Softic_ presentation_Green Club_ENG.pdf
Dr. Admir Softic_ presentation_Green Club_ENG.pdfDr. Admir Softic_ presentation_Green Club_ENG.pdf
Dr. Admir Softic_ presentation_Green Club_ENG.pdf
 
Call Girls Hebbal Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
Call Girls Hebbal Just Call 👗 7737669865 👗 Top Class Call Girl Service BangaloreCall Girls Hebbal Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
Call Girls Hebbal Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
 
Value Proposition canvas- Customer needs and pains
Value Proposition canvas- Customer needs and painsValue Proposition canvas- Customer needs and pains
Value Proposition canvas- Customer needs and pains
 
Organizational Transformation Lead with Culture
Organizational Transformation Lead with CultureOrganizational Transformation Lead with Culture
Organizational Transformation Lead with Culture
 
Call Girls From Raj Nagar Extension Ghaziabad❤️8448577510 ⊹Best Escorts Servi...
Call Girls From Raj Nagar Extension Ghaziabad❤️8448577510 ⊹Best Escorts Servi...Call Girls From Raj Nagar Extension Ghaziabad❤️8448577510 ⊹Best Escorts Servi...
Call Girls From Raj Nagar Extension Ghaziabad❤️8448577510 ⊹Best Escorts Servi...
 
Whitefield CALL GIRL IN 98274*61493 ❤CALL GIRLS IN ESCORT SERVICE❤CALL GIRL
Whitefield CALL GIRL IN 98274*61493 ❤CALL GIRLS IN ESCORT SERVICE❤CALL GIRLWhitefield CALL GIRL IN 98274*61493 ❤CALL GIRLS IN ESCORT SERVICE❤CALL GIRL
Whitefield CALL GIRL IN 98274*61493 ❤CALL GIRLS IN ESCORT SERVICE❤CALL GIRL
 
BAGALUR CALL GIRL IN 98274*61493 ❤CALL GIRLS IN ESCORT SERVICE❤CALL GIRL
BAGALUR CALL GIRL IN 98274*61493 ❤CALL GIRLS IN ESCORT SERVICE❤CALL GIRLBAGALUR CALL GIRL IN 98274*61493 ❤CALL GIRLS IN ESCORT SERVICE❤CALL GIRL
BAGALUR CALL GIRL IN 98274*61493 ❤CALL GIRLS IN ESCORT SERVICE❤CALL GIRL
 
Eluru Call Girls Service ☎ ️93326-06886 ❤️‍🔥 Enjoy 24/7 Escort Service
Eluru Call Girls Service ☎ ️93326-06886 ❤️‍🔥 Enjoy 24/7 Escort ServiceEluru Call Girls Service ☎ ️93326-06886 ❤️‍🔥 Enjoy 24/7 Escort Service
Eluru Call Girls Service ☎ ️93326-06886 ❤️‍🔥 Enjoy 24/7 Escort Service
 
SEO Case Study: How I Increased SEO Traffic & Ranking by 50-60% in 6 Months
SEO Case Study: How I Increased SEO Traffic & Ranking by 50-60%  in 6 MonthsSEO Case Study: How I Increased SEO Traffic & Ranking by 50-60%  in 6 Months
SEO Case Study: How I Increased SEO Traffic & Ranking by 50-60% in 6 Months
 
Nelamangala Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
Nelamangala Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...Nelamangala Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
Nelamangala Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
 
👉Chandigarh Call Girls 👉9878799926👉Just Call👉Chandigarh Call Girl In Chandiga...
👉Chandigarh Call Girls 👉9878799926👉Just Call👉Chandigarh Call Girl In Chandiga...👉Chandigarh Call Girls 👉9878799926👉Just Call👉Chandigarh Call Girl In Chandiga...
👉Chandigarh Call Girls 👉9878799926👉Just Call👉Chandigarh Call Girl In Chandiga...
 
Call Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service Available
Call Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service AvailableCall Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service Available
Call Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service Available
 
Marel Q1 2024 Investor Presentation from May 8, 2024
Marel Q1 2024 Investor Presentation from May 8, 2024Marel Q1 2024 Investor Presentation from May 8, 2024
Marel Q1 2024 Investor Presentation from May 8, 2024
 
Cracking the Cultural Competence Code.pptx
Cracking the Cultural Competence Code.pptxCracking the Cultural Competence Code.pptx
Cracking the Cultural Competence Code.pptx
 
Call Girls in Delhi, Escort Service Available 24x7 in Delhi 959961-/-3876
Call Girls in Delhi, Escort Service Available 24x7 in Delhi 959961-/-3876Call Girls in Delhi, Escort Service Available 24x7 in Delhi 959961-/-3876
Call Girls in Delhi, Escort Service Available 24x7 in Delhi 959961-/-3876
 
Phases of Negotiation .pptx
 Phases of Negotiation .pptx Phases of Negotiation .pptx
Phases of Negotiation .pptx
 
The Abortion pills for sale in Qatar@Doha [+27737758557] []Deira Dubai Kuwait
The Abortion pills for sale in Qatar@Doha [+27737758557] []Deira Dubai KuwaitThe Abortion pills for sale in Qatar@Doha [+27737758557] []Deira Dubai Kuwait
The Abortion pills for sale in Qatar@Doha [+27737758557] []Deira Dubai Kuwait
 
The Path to Product Excellence: Avoiding Common Pitfalls and Enhancing Commun...
The Path to Product Excellence: Avoiding Common Pitfalls and Enhancing Commun...The Path to Product Excellence: Avoiding Common Pitfalls and Enhancing Commun...
The Path to Product Excellence: Avoiding Common Pitfalls and Enhancing Commun...
 
Call Girls From Pari Chowk Greater Noida ❤️8448577510 ⊹Best Escorts Service I...
Call Girls From Pari Chowk Greater Noida ❤️8448577510 ⊹Best Escorts Service I...Call Girls From Pari Chowk Greater Noida ❤️8448577510 ⊹Best Escorts Service I...
Call Girls From Pari Chowk Greater Noida ❤️8448577510 ⊹Best Escorts Service I...
 
PHX May 2024 Corporate Presentation Final
PHX May 2024 Corporate Presentation FinalPHX May 2024 Corporate Presentation Final
PHX May 2024 Corporate Presentation Final
 

Assignment 3

  • 1. Assignment (3) Q1. Solve the integral using paper and pen or calculator, and then compare the answer to the computational method using the Romberg method. Solution = [x6 /6 + x5 /5 + x4/ 4 + ex] ={ [1/6 (4)6 + 1/5 (4)5 + 1/4(4)4 + e4] –[1/6 (0.5)6 + 1/5 (0.5)5 + 1/4(0.5)4 + e5] } = (1006.06) –(1.752865) = 1004.3071 function [q,ea,iter]=romberg(func,a,b,es,maxit,varargin) % if nargin<3,error('at least 3arguments required'),end if nargin<4||isempty(es),es=0.000001;end if nargin<5||isempty(maxit),maxit=50;end n=1; r(1,1) = trap(func,a,b,n,varargin{:}); iter=0; while iter<maxit iter=iter+1; n=2^iter; I(iter+1,1)=trap(func,a,b,n,varargin{:}); for k=2:iter+1 j=2+iter-k; I(j,k)=(4^(k-1)*I(j+1,k-1)-I(j,k-1))/(4^(k-1)-1); end ea=abs((I(1,iter+1)-I(2,iter))/I(1,iter+1))*100; if ea<=es, break; end end q=I(1,iter+1); function I=trap(func,a,b,n,varargin) if(nargin<3) error('at least 3 input arguments required');
  • 2. end if ~(b>a),error('upper bound must be greater than lower'),end if nargin<4||isempty(n),n=100;end x=a; h=(b-a)/n; s=func(a,varargin{:}); for i=1:n-1 x=x+h; s=s+2*func(x,varargin{:}); end s=s+func(b,varargin{:}); I=(b-a)*s/(2*n); >> f=@(x) x^5+x^4+x^3+exp(x); >> romberg(f,0.5,4) ans = 1.0044e+003
  • 3. Q2. Calculate the integral dt. The exact answer to this integral is 15.41260804810169. Solve the integral using the Romberg method Solution function [q,ea,iter]=romberg(func,a,b,es,maxit,varargin) % if nargin<3,error('at least 3arguments required'),end if nargin<4||isempty(es),es=0.000001;end if nargin<5||isempty(maxit),maxit=50;end n=1; r(1,1) = trap(func,a,b,n,varargin{:}); iter=0; while iter<maxit iter=iter+1; n=2^iter; I(iter+1,1)=trap(func,a,b,n,varargin{:}); for k=2:iter+1 j=2+iter-k; I(j,k)=(4^(k-1)*I(j+1,k-1)-I(j,k-1))/(4^(k-1)-1); end ea=abs((I(1,iter+1)-I(2,iter))/I(1,iter+1))*100; if ea<=es, break; end end q=I(1,iter+1); function I=trap(func,a,b,n,varargin) if(nargin<3) error('at least 3 input arguments required'); end if ~(b>a),error('upper bound must be greater than lower'),end if nargin<4||isempty(n),n=100;end x=a; h=(b-a)/n; s=func(a,varargin{:}); for i=1:n-1 x=x+h; s=s+2*func(x,varargin{:}); end s=s+func(b,varargin{:}); I=(b-a)*s/(2*n);
  • 4. >> f=@(t) (10*exp(-t)*sin(2*pi*t))^2 >> romberg (f,0,0.5) ans = 15.4126