SlideShare ist ein Scribd-Unternehmen logo
1 von 4
Downloaden Sie, um offline zu lesen
http://www.tutorialspoint.com/matlab/matlab_calculus.htm Copyright © tutorialspoint.com
MATLAB - CALCULUS
MATLAB provides various ways for solving problems of differentialand integralcalculus, solving differential
equations of any degree and calculationof limits. Best of all, youcaneasily plot the graphs of complex functions
and check maxima, minima and other stationery points ona graphby solving the originalfunction, as wellas its
derivative.
Inthis chapter and incoming couple of chapters, we willdealwiththe problems of calculus. Inthis chapter, we will
discuss pre-calculus concepts i.e., calculating limits of functions and verifying the properties of limits.
Inthe next chapter Differential, we willcompute derivative of anexpressionand find the localmaxima and minima
ona graph. We willalso discuss solving differentialequations.
Finally, inthe Integration chapter, we willdiscuss integralcalculus.
Calculating Limits
MATLAB provides the limit command for calculating limits. Inits most basic form, the limit command takes
expressionas anargument and finds the limit of the expressionas the independent variable goes to zero.
For example, let us calculate the limit of a functionf(x) = (x3 + 5)/(x4 + 7), as x tends to zero.
syms x
limit((x^3 + 5)/(x^4 + 7))
MATLAB willexecute the above statement and returnthe following result:
ans =
5/7
The limit command falls inthe realmof symbolic computing; youneed to use the syms command to tellMATLAB
whichsymbolic variables youare using. Youcanalso compute limit of a function, as the variable tends to some
number other thanzero. To calculate limx->a(f(x)), we use the limit command witharguments. The first being the
expressionand the second is the number, that x approaches, here it is a.
For example, let us calculate limit of a functionf(x) = (x-3)/(x-1), as x tends to 1.
limit((x - 3)/(x-1),1)
MATLAB willexecute the above statement and returnthe following result:
ans =
NaN
Let's take another example,
limit(x^2 + 5, 3)
MATLAB willexecute the above statement and returnthe following result:
ans =
14
Calculating Limits using Octave
Following is Octave versionof the above example using symbolic package, try to execute and compare the
result:
pkg load symbolic
symbols
x=sym("x");
subs((x^3+5)/(x^4+7),x,0)
Octave willexecute the above statement and returnthe following result:
ans =
0.7142857142857142857
Verification of Basic Properties of Limits
Algebraic Limit Theoremprovides some basic properties of limits. These are as follows:
Let us consider two functions:
1. f(x) = (3x + 5)/(x - 3)
2. g(x) = x2 + 1.
Let us calculate the limits of the functions as x tends to 5, of bothfunctions and verify the basic properties of limits
using these two functions and MATLAB.
Example
Create a script file and type the following code into it:
syms x
f = (3*x + 5)/(x-3);
g = x^2 + 1;
l1 = limit(f, 4)
l2 = limit (g, 4)
lAdd = limit(f + g, 4)
lSub = limit(f - g, 4)
lMult = limit(f*g, 4)
lDiv = limit (f/g, 4)
Whenyourunthe file, it displays:
l1 =
17
l2 =
17
lAdd =
34
lSub =
0
lMult =
289
lDiv =
1
Verification of Basic Properties of Limits using Octave
Following is Octave versionof the above example using symbolic package, try to execute and compare the
result:
pkg load symbolic
symbols
x = sym("x");
f = (3*x + 5)/(x-3);
g = x^2 + 1;
l1=subs(f, x, 4)
l2 = subs (g, x, 4)
lAdd = subs (f+g, x, 4)
lSub = subs (f-g, x, 4)
lMult = subs (f*g, x, 4)
lDiv = subs (f/g, x, 4)
Octave willexecute the above statement and returnthe following result:
l1 =
17.0
l2 =
17.0
lAdd =
34.0
lSub =
0.0
lMult =
289.0
lDiv =
1.0
Left and Right Sided Limits
Whena functionhas a discontinuity for some particular value of the variable, the limit does not exist at that point. In
other words, limits of a functionf(x) has discontinuity at x = a, whenthe value of limit, as x approaches x fromleft
side, does not equalthe value of the limit as x approaches fromright side.
This leads to the concept of left-handed and right-handed limits. A left-handed limit is defined as the limit as x ->
a, fromthe left, i.e., x approaches a, for values of x < a. A right-handed limit is defined as the limit as x -> a, from
the right, i.e., x approaches a, for values of x > a. Whenthe left-handed limit and right-handed limits are not equal,
the limit does not exist.
Let us consider a function:
f(x) = (x - 3)/|x - 3|
We willshow that limx->3 f(x) does not exist. MATLAB helps us to establishthis fact intwo ways:
By plotting the graphof the functionand showing the discontinuity
By computing the limits and showing that bothare different.
The left-handed and right-handed limits are computed by passing the character strings 'left' and 'right' to the limit
command as the last argument.
Example
Create a script file and type the following code into it:
f = (x - 3)/abs(x-3);
ezplot(f,[-1,5])
l = limit(f,x,3,'left')
r = limit(f,x,3,'right')
Whenyourunthe file, MATLAB draws the following plot,
and displays the following output:
l =
-1
r =
1

Weitere ähnliche Inhalte

Was ist angesagt?

Introduction to Algorithms and Asymptotic Notation
Introduction to Algorithms and Asymptotic NotationIntroduction to Algorithms and Asymptotic Notation
Introduction to Algorithms and Asymptotic NotationAmrinder Arora
 
Euclid's Algorithm for Greatest Common Divisor - Time Complexity Analysis
Euclid's Algorithm for Greatest Common Divisor - Time Complexity AnalysisEuclid's Algorithm for Greatest Common Divisor - Time Complexity Analysis
Euclid's Algorithm for Greatest Common Divisor - Time Complexity AnalysisAmrinder Arora
 
Implementation Of String Functions In C
Implementation Of String Functions In CImplementation Of String Functions In C
Implementation Of String Functions In CFazila Sadia
 
Machine learning session 9
Machine learning session 9Machine learning session 9
Machine learning session 9NirsandhG
 
Introduction to the AKS Primality Test
Introduction to the AKS Primality TestIntroduction to the AKS Primality Test
Introduction to the AKS Primality TestPranshu Bhatnagar
 
Managing I/O & String function in C
Managing I/O & String function in CManaging I/O & String function in C
Managing I/O & String function in CAbinaya B
 
Riemann Hypothesis
Riemann HypothesisRiemann Hypothesis
Riemann Hypothesisbarnetdh
 
String in programming language in c or c++
 String in programming language  in c or c++  String in programming language  in c or c++
String in programming language in c or c++ Samsil Arefin
 
Learning sparse Neural Networks using L0 Regularization
Learning sparse Neural Networks using L0 RegularizationLearning sparse Neural Networks using L0 Regularization
Learning sparse Neural Networks using L0 RegularizationVarun Reddy
 
Slides2if85 assmeth2
Slides2if85 assmeth2Slides2if85 assmeth2
Slides2if85 assmeth2mackees
 
Seismic data processing lecture 3
Seismic data processing lecture 3Seismic data processing lecture 3
Seismic data processing lecture 3Amin khalil
 
Folding Unfolded - Polyglot FP for Fun and Profit - Haskell and Scala Part 2 ...
Folding Unfolded - Polyglot FP for Fun and Profit - Haskell and Scala Part 2 ...Folding Unfolded - Polyglot FP for Fun and Profit - Haskell and Scala Part 2 ...
Folding Unfolded - Polyglot FP for Fun and Profit - Haskell and Scala Part 2 ...Philip Schwarz
 

Was ist angesagt? (20)

Introduction to Algorithms and Asymptotic Notation
Introduction to Algorithms and Asymptotic NotationIntroduction to Algorithms and Asymptotic Notation
Introduction to Algorithms and Asymptotic Notation
 
Euclid's Algorithm for Greatest Common Divisor - Time Complexity Analysis
Euclid's Algorithm for Greatest Common Divisor - Time Complexity AnalysisEuclid's Algorithm for Greatest Common Divisor - Time Complexity Analysis
Euclid's Algorithm for Greatest Common Divisor - Time Complexity Analysis
 
14 ruby strings
14 ruby strings14 ruby strings
14 ruby strings
 
Implementation Of String Functions In C
Implementation Of String Functions In CImplementation Of String Functions In C
Implementation Of String Functions In C
 
Machine learning session 9
Machine learning session 9Machine learning session 9
Machine learning session 9
 
Strings
StringsStrings
Strings
 
Introduction to the AKS Primality Test
Introduction to the AKS Primality TestIntroduction to the AKS Primality Test
Introduction to the AKS Primality Test
 
Managing I/O & String function in C
Managing I/O & String function in CManaging I/O & String function in C
Managing I/O & String function in C
 
Riemann Hypothesis
Riemann HypothesisRiemann Hypothesis
Riemann Hypothesis
 
String in programming language in c or c++
 String in programming language  in c or c++  String in programming language  in c or c++
String in programming language in c or c++
 
C string
C stringC string
C string
 
05 dataflow
05 dataflow05 dataflow
05 dataflow
 
Learning sparse Neural Networks using L0 Regularization
Learning sparse Neural Networks using L0 RegularizationLearning sparse Neural Networks using L0 Regularization
Learning sparse Neural Networks using L0 Regularization
 
Lecture1 3
Lecture1 3Lecture1 3
Lecture1 3
 
Slides2if85 assmeth2
Slides2if85 assmeth2Slides2if85 assmeth2
Slides2if85 assmeth2
 
Seismic data processing lecture 3
Seismic data processing lecture 3Seismic data processing lecture 3
Seismic data processing lecture 3
 
Algorithum Analysis
Algorithum AnalysisAlgorithum Analysis
Algorithum Analysis
 
String functions in C
String functions in CString functions in C
String functions in C
 
Folding Unfolded - Polyglot FP for Fun and Profit - Haskell and Scala Part 2 ...
Folding Unfolded - Polyglot FP for Fun and Profit - Haskell and Scala Part 2 ...Folding Unfolded - Polyglot FP for Fun and Profit - Haskell and Scala Part 2 ...
Folding Unfolded - Polyglot FP for Fun and Profit - Haskell and Scala Part 2 ...
 
Algorithmic Notations
Algorithmic NotationsAlgorithmic Notations
Algorithmic Notations
 

Andere mochten auch

Andere mochten auch (18)

Matlab numbers
Matlab numbersMatlab numbers
Matlab numbers
 
Matlab syntax
Matlab syntaxMatlab syntax
Matlab syntax
 
Matlab algebra
Matlab algebraMatlab algebra
Matlab algebra
 
Matlab operators
Matlab operatorsMatlab operators
Matlab operators
 
C24 company overview brochure lowres
C24 company overview brochure lowresC24 company overview brochure lowres
C24 company overview brochure lowres
 
Matlab operators
Matlab operatorsMatlab operators
Matlab operators
 
Effective resume writing
Effective resume writingEffective resume writing
Effective resume writing
 
Matlab plotting
Matlab plottingMatlab plotting
Matlab plotting
 
Matlab differential
Matlab differentialMatlab differential
Matlab differential
 
Matlab gnu octave
Matlab gnu octaveMatlab gnu octave
Matlab gnu octave
 
C24 bi datasheet leading in the legal sector with big data
C24 bi datasheet leading in the legal sector with big dataC24 bi datasheet leading in the legal sector with big data
C24 bi datasheet leading in the legal sector with big data
 
C24 wright hassall casestudy a4 3pp
C24 wright hassall casestudy a4 3ppC24 wright hassall casestudy a4 3pp
C24 wright hassall casestudy a4 3pp
 
Matlab simulink
Matlab simulinkMatlab simulink
Matlab simulink
 
Matlab data import
Matlab data importMatlab data import
Matlab data import
 
Matlab integration
Matlab integrationMatlab integration
Matlab integration
 
Matlab functions
Matlab functionsMatlab functions
Matlab functions
 
Matlab strings
Matlab stringsMatlab strings
Matlab strings
 
C24 Arthur Terry Case Study 365
C24 Arthur Terry Case Study 365C24 Arthur Terry Case Study 365
C24 Arthur Terry Case Study 365
 

Ähnlich wie Matlab calculus

Dsp manual completed2
Dsp manual completed2Dsp manual completed2
Dsp manual completed2bilawalali74
 
CALCULUS chapter number one presentation
CALCULUS chapter number one presentationCALCULUS chapter number one presentation
CALCULUS chapter number one presentationkdoha825
 
Scilab for real dummies j.heikell - part 2
Scilab for real dummies j.heikell - part 2Scilab for real dummies j.heikell - part 2
Scilab for real dummies j.heikell - part 2Scilab
 
Programming with effects - Graham Hutton
Programming with effects - Graham HuttonProgramming with effects - Graham Hutton
Programming with effects - Graham HuttonWen-Shih Chao
 
A MATLAB project on LCR circuits
A MATLAB project on LCR circuitsA MATLAB project on LCR circuits
A MATLAB project on LCR circuitssvrohith 9
 
A complete introduction on matlab and matlab's projects
A complete introduction on matlab and matlab's projectsA complete introduction on matlab and matlab's projects
A complete introduction on matlab and matlab's projectsMukesh Kumar
 
Dsp lab _eec-652__vi_sem_18012013
Dsp lab _eec-652__vi_sem_18012013Dsp lab _eec-652__vi_sem_18012013
Dsp lab _eec-652__vi_sem_18012013amanabr
 
Dsp lab _eec-652__vi_sem_18012013
Dsp lab _eec-652__vi_sem_18012013Dsp lab _eec-652__vi_sem_18012013
Dsp lab _eec-652__vi_sem_18012013Kurmendra Singh
 
Tutorfly Review Session Math 31A
Tutorfly Review Session Math 31ATutorfly Review Session Math 31A
Tutorfly Review Session Math 31AEge Tanboga
 

Ähnlich wie Matlab calculus (20)

MatlabIntro.ppt
MatlabIntro.pptMatlabIntro.ppt
MatlabIntro.ppt
 
MatlabIntro.ppt
MatlabIntro.pptMatlabIntro.ppt
MatlabIntro.ppt
 
MatlabIntro.ppt
MatlabIntro.pptMatlabIntro.ppt
MatlabIntro.ppt
 
Matlab intro
Matlab introMatlab intro
Matlab intro
 
MatlabIntro.ppt
MatlabIntro.pptMatlabIntro.ppt
MatlabIntro.ppt
 
Lecture co3 math21-1
Lecture co3 math21-1Lecture co3 math21-1
Lecture co3 math21-1
 
R lecture co4_math 21-1
R lecture co4_math 21-1R lecture co4_math 21-1
R lecture co4_math 21-1
 
Matlab Sample Assignment Solution
Matlab Sample Assignment SolutionMatlab Sample Assignment Solution
Matlab Sample Assignment Solution
 
Dsp manual completed2
Dsp manual completed2Dsp manual completed2
Dsp manual completed2
 
CALCULUS chapter number one presentation
CALCULUS chapter number one presentationCALCULUS chapter number one presentation
CALCULUS chapter number one presentation
 
Scilab for real dummies j.heikell - part 2
Scilab for real dummies j.heikell - part 2Scilab for real dummies j.heikell - part 2
Scilab for real dummies j.heikell - part 2
 
Matlab booklet
Matlab bookletMatlab booklet
Matlab booklet
 
Programming with effects - Graham Hutton
Programming with effects - Graham HuttonProgramming with effects - Graham Hutton
Programming with effects - Graham Hutton
 
A MATLAB project on LCR circuits
A MATLAB project on LCR circuitsA MATLAB project on LCR circuits
A MATLAB project on LCR circuits
 
A complete introduction on matlab and matlab's projects
A complete introduction on matlab and matlab's projectsA complete introduction on matlab and matlab's projects
A complete introduction on matlab and matlab's projects
 
1551 limits and continuity
1551 limits and continuity1551 limits and continuity
1551 limits and continuity
 
EPE821_Lecture3.pptx
EPE821_Lecture3.pptxEPE821_Lecture3.pptx
EPE821_Lecture3.pptx
 
Dsp lab _eec-652__vi_sem_18012013
Dsp lab _eec-652__vi_sem_18012013Dsp lab _eec-652__vi_sem_18012013
Dsp lab _eec-652__vi_sem_18012013
 
Dsp lab _eec-652__vi_sem_18012013
Dsp lab _eec-652__vi_sem_18012013Dsp lab _eec-652__vi_sem_18012013
Dsp lab _eec-652__vi_sem_18012013
 
Tutorfly Review Session Math 31A
Tutorfly Review Session Math 31ATutorfly Review Session Math 31A
Tutorfly Review Session Math 31A
 

Mehr von pramodkumar1804 (13)

Matlab polynomials
Matlab polynomialsMatlab polynomials
Matlab polynomials
 
Matlab overview 3
Matlab overview 3Matlab overview 3
Matlab overview 3
 
Matlab overview 2
Matlab overview 2Matlab overview 2
Matlab overview 2
 
Matlab overview
Matlab overviewMatlab overview
Matlab overview
 
Matlab variables
Matlab variablesMatlab variables
Matlab variables
 
Matlab matrics
Matlab matricsMatlab matrics
Matlab matrics
 
Matlab m files
Matlab m filesMatlab m files
Matlab m files
 
Matlab loops 2
Matlab loops 2Matlab loops 2
Matlab loops 2
 
Matlab loops
Matlab loopsMatlab loops
Matlab loops
 
Matlab graphics
Matlab graphicsMatlab graphics
Matlab graphics
 
Matlab decisions
Matlab decisionsMatlab decisions
Matlab decisions
 
Matlab colon notation
Matlab colon notationMatlab colon notation
Matlab colon notation
 
Matlab vectors
Matlab vectorsMatlab vectors
Matlab vectors
 

Kürzlich hochgeladen

On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsMebane Rash
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.MaryamAhmad92
 
Third Battle of Panipat detailed notes.pptx
Third Battle of Panipat detailed notes.pptxThird Battle of Panipat detailed notes.pptx
Third Battle of Panipat detailed notes.pptxAmita Gupta
 
PROCESS RECORDING FORMAT.docx
PROCESS      RECORDING        FORMAT.docxPROCESS      RECORDING        FORMAT.docx
PROCESS RECORDING FORMAT.docxPoojaSen20
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhikauryashika82
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxDenish Jangid
 
Magic bus Group work1and 2 (Team 3).pptx
Magic bus Group work1and 2 (Team 3).pptxMagic bus Group work1and 2 (Team 3).pptx
Magic bus Group work1and 2 (Team 3).pptxdhanalakshmis0310
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsTechSoup
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.christianmathematics
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingTechSoup
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdfQucHHunhnh
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...pradhanghanshyam7136
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...christianmathematics
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxVishalSingh1417
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfPoh-Sun Goh
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibitjbellavia9
 
Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseSpellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseAnaAcapella
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 
psychiatric nursing HISTORY COLLECTION .docx
psychiatric  nursing HISTORY  COLLECTION  .docxpsychiatric  nursing HISTORY  COLLECTION  .docx
psychiatric nursing HISTORY COLLECTION .docxPoojaSen20
 

Kürzlich hochgeladen (20)

On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 
Third Battle of Panipat detailed notes.pptx
Third Battle of Panipat detailed notes.pptxThird Battle of Panipat detailed notes.pptx
Third Battle of Panipat detailed notes.pptx
 
PROCESS RECORDING FORMAT.docx
PROCESS      RECORDING        FORMAT.docxPROCESS      RECORDING        FORMAT.docx
PROCESS RECORDING FORMAT.docx
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
Magic bus Group work1and 2 (Team 3).pptx
Magic bus Group work1and 2 (Team 3).pptxMagic bus Group work1and 2 (Team 3).pptx
Magic bus Group work1and 2 (Team 3).pptx
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 
Spatium Project Simulation student brief
Spatium Project Simulation student briefSpatium Project Simulation student brief
Spatium Project Simulation student brief
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptx
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdf
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseSpellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please Practise
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
psychiatric nursing HISTORY COLLECTION .docx
psychiatric  nursing HISTORY  COLLECTION  .docxpsychiatric  nursing HISTORY  COLLECTION  .docx
psychiatric nursing HISTORY COLLECTION .docx
 

Matlab calculus

  • 1. http://www.tutorialspoint.com/matlab/matlab_calculus.htm Copyright © tutorialspoint.com MATLAB - CALCULUS MATLAB provides various ways for solving problems of differentialand integralcalculus, solving differential equations of any degree and calculationof limits. Best of all, youcaneasily plot the graphs of complex functions and check maxima, minima and other stationery points ona graphby solving the originalfunction, as wellas its derivative. Inthis chapter and incoming couple of chapters, we willdealwiththe problems of calculus. Inthis chapter, we will discuss pre-calculus concepts i.e., calculating limits of functions and verifying the properties of limits. Inthe next chapter Differential, we willcompute derivative of anexpressionand find the localmaxima and minima ona graph. We willalso discuss solving differentialequations. Finally, inthe Integration chapter, we willdiscuss integralcalculus. Calculating Limits MATLAB provides the limit command for calculating limits. Inits most basic form, the limit command takes expressionas anargument and finds the limit of the expressionas the independent variable goes to zero. For example, let us calculate the limit of a functionf(x) = (x3 + 5)/(x4 + 7), as x tends to zero. syms x limit((x^3 + 5)/(x^4 + 7)) MATLAB willexecute the above statement and returnthe following result: ans = 5/7 The limit command falls inthe realmof symbolic computing; youneed to use the syms command to tellMATLAB whichsymbolic variables youare using. Youcanalso compute limit of a function, as the variable tends to some number other thanzero. To calculate limx->a(f(x)), we use the limit command witharguments. The first being the expressionand the second is the number, that x approaches, here it is a. For example, let us calculate limit of a functionf(x) = (x-3)/(x-1), as x tends to 1. limit((x - 3)/(x-1),1) MATLAB willexecute the above statement and returnthe following result: ans = NaN Let's take another example, limit(x^2 + 5, 3) MATLAB willexecute the above statement and returnthe following result: ans = 14 Calculating Limits using Octave Following is Octave versionof the above example using symbolic package, try to execute and compare the result: pkg load symbolic
  • 2. symbols x=sym("x"); subs((x^3+5)/(x^4+7),x,0) Octave willexecute the above statement and returnthe following result: ans = 0.7142857142857142857 Verification of Basic Properties of Limits Algebraic Limit Theoremprovides some basic properties of limits. These are as follows: Let us consider two functions: 1. f(x) = (3x + 5)/(x - 3) 2. g(x) = x2 + 1. Let us calculate the limits of the functions as x tends to 5, of bothfunctions and verify the basic properties of limits using these two functions and MATLAB. Example Create a script file and type the following code into it: syms x f = (3*x + 5)/(x-3); g = x^2 + 1; l1 = limit(f, 4) l2 = limit (g, 4) lAdd = limit(f + g, 4) lSub = limit(f - g, 4) lMult = limit(f*g, 4) lDiv = limit (f/g, 4) Whenyourunthe file, it displays: l1 = 17 l2 = 17 lAdd = 34 lSub = 0 lMult = 289 lDiv = 1
  • 3. Verification of Basic Properties of Limits using Octave Following is Octave versionof the above example using symbolic package, try to execute and compare the result: pkg load symbolic symbols x = sym("x"); f = (3*x + 5)/(x-3); g = x^2 + 1; l1=subs(f, x, 4) l2 = subs (g, x, 4) lAdd = subs (f+g, x, 4) lSub = subs (f-g, x, 4) lMult = subs (f*g, x, 4) lDiv = subs (f/g, x, 4) Octave willexecute the above statement and returnthe following result: l1 = 17.0 l2 = 17.0 lAdd = 34.0 lSub = 0.0 lMult = 289.0 lDiv = 1.0 Left and Right Sided Limits Whena functionhas a discontinuity for some particular value of the variable, the limit does not exist at that point. In other words, limits of a functionf(x) has discontinuity at x = a, whenthe value of limit, as x approaches x fromleft side, does not equalthe value of the limit as x approaches fromright side. This leads to the concept of left-handed and right-handed limits. A left-handed limit is defined as the limit as x -> a, fromthe left, i.e., x approaches a, for values of x < a. A right-handed limit is defined as the limit as x -> a, from the right, i.e., x approaches a, for values of x > a. Whenthe left-handed limit and right-handed limits are not equal, the limit does not exist. Let us consider a function: f(x) = (x - 3)/|x - 3| We willshow that limx->3 f(x) does not exist. MATLAB helps us to establishthis fact intwo ways: By plotting the graphof the functionand showing the discontinuity By computing the limits and showing that bothare different. The left-handed and right-handed limits are computed by passing the character strings 'left' and 'right' to the limit command as the last argument. Example
  • 4. Create a script file and type the following code into it: f = (x - 3)/abs(x-3); ezplot(f,[-1,5]) l = limit(f,x,3,'left') r = limit(f,x,3,'right') Whenyourunthe file, MATLAB draws the following plot, and displays the following output: l = -1 r = 1