Documente Academic
Documente Profesional
Documente Cultură
Computer Solutions
to Calculus Problems
Scientific Computing with
MATLAB, 2nd Edition
CRC/Taylor & Francis Press
Chinese version by Tsinghua University Press
□ MATLAB function
□ MATLAB commands
□ Three-stages
Declare variables describe function solve
No intermediate results, no skills needed
5/19/2018 Dingyü Xue and YangQuan Chen. Scientific Computing 5/154
with MATLAB, 2nd Edition. CRC Press, 2016
Example 3.2 Single-sided
Limit Problem Solution
□ Solve the problem
□ MATLAB statements
□ MATLAB commands
□ Break point
5/19/2018 Dingyü Xue and YangQuan Chen. Scientific Computing 8/154
with MATLAB, 2nd Edition. CRC Press, 2016
Example 3-4 Limit of a
Sequence
□ Given the sequence
□ Example 3-7:
Find
□ Syntax
5/19/2018 Dingyü Xue and YangQuan Chen. Scientific Computing 13/154
with MATLAB, 2nd Edition. CRC Press, 2016
Example 3-8 Plotting of
Piecewise Functions
□ Piecewise function
□
5/19/2018 Dingyü Xue and YangQuan Chen. Scientific Computing 14/154
with MATLAB, 2nd Edition. CRC Press, 2016
3.1.3 Limit of
Multivariable Functions
□ Sequential limit of f (x,y)
□ Solution in MATLAB
□ MATLAB commands
Three-phase solution
□ Difficulties in solutions
Along all directions
At all speed in different directions
Special cases
Different sequential limit, no multiple limit
Same sequential limit, no multiple limit
□ Solutions
Try 4 different directions and speeds
□ Simplification
□ MATLAB commands
□ MATLAB syntax
□ or
5/19/2018 Dingyü Xue and YangQuan Chen. Scientific Computing 28/154
with MATLAB, 2nd Edition. CRC Press, 2016
Example 3.15 Gradients
□ Given 2-variable function
□ Function
□ Partial derivatives
□ MATLAB solutions
□ MATLAB command
□ High-order
□ MATLAB solutions
□ Jacobian matrix
□ MATLAB solutions
5/19/2018 Dingyü Xue and YangQuan Chen. Scientific Computing 37/154
with MATLAB, 2nd Edition. CRC Press, 2016
Example 3.19 Finding the
Jacobian Matrix
□ Descartes to polar coordinate conversion
□ MATLAB solution
□ Earlier versions
5/19/2018 Dingyü Xue and YangQuan Chen. Scientific Computing 39/154
with MATLAB, 2nd Edition. CRC Press, 2016
Example 3.20 Hessian Matrix
□ Function with 2 independent variables
□ MATLAB solution
□ Alternatively
□ MATLAB solutions
integral
Multiple integrals, nested use or loops
□ MATLAB solution
□ Results
□ Special function
5/19/2018 Dingyü Xue and YangQuan Chen. Scientific Computing 46/154
with MATLAB, 2nd Edition. CRC Press, 2016
Non-integratible function
with parameters
□ Find , where
□ MATLAB commands
□ MATLAB solutions
□ MATLAB solutions
□ The function
□ Please evaluate
□ Solve with
□ MATLAB solutions
with
□ MATLAB
□ Old versions
5/19/2018 Dingyü Xue and YangQuan Chen. Scientific Computing 56/154
with MATLAB, 2nd Edition. CRC Press, 2016
Taylor Series About x=a Point
□ About x = a, Taylor series expansion
□ where
□ MATLAB
□ Old versions
5/19/2018 Dingyü Xue and YangQuan Chen. Scientific Computing 57/154
with MATLAB, 2nd Edition. CRC Press, 2016
Example 3.28 Taylor Series
□ Function
□ About x=0, x=2 and x=a
About x=0, Taylor series
coefficients
□ Validate results
□ Math description
□ General form
5/19/2018 Dingyü Xue and YangQuan Chen. Scientific Computing 66/154
with MATLAB, 2nd Edition. CRC Press, 2016
Example 3.32 Approximation
of Piecewise Functions
□ Function
□ Approximation
□ Mathematical form
□ General form
5/19/2018 Dingyü Xue and YangQuan Chen. Scientific Computing 68/154
with MATLAB, 2nd Edition. CRC Press, 2016
Assumptions of
Piecewise Functions
□ In interval [-2p,2p], fitting quality comparison
□ MATLAB statement
□ Numerical solution
□ Use symsum()
□ Symbolic computation
Convergent intervals returned
□ MATLAB solutions
□ Solution
□ MATLAB statements
New Math Toolbox
Old versions
□ General term
□ Solve
5/19/2018 Dingyü Xue and YangQuan Chen. Scientific Computing 78/154
with MATLAB, 2nd Edition. CRC Press, 2016
Example 3.40 Product of
Sequence of a Function
□ Problem
□ Direct solution
or
□ Convert to definite integral problem
Formula
□ MATLAB solutions
l is encircled by y = x and
□ Results
5/19/2018 Dingyü Xue and YangQuan Chen. Scientific Computing 85/154
with MATLAB, 2nd Edition. CRC Press, 2016
3.5.1.2 Line Integrals
□ Line integral
□ where
□ and
□ Converted to
□ MATLAB solutions
□ MATLAB solutions
□ S is surface
□ Converted to double integral of x-y plane
□ 其中 为积分区域
5/19/2018 Dingyü Xue and YangQuan Chen. Scientific Computing 90/154
with MATLAB, 2nd Edition. CRC Press, 2016
Example 3.45 Surface Integral
□ Compute , S is
□ Formula
□ MATLAB solutions
The last one, integrand is not zero
□ Surface integral
where
Surface S
□ MATLAB solutions
integrand
With
□ Surface is given by
with
□ Compute
□ MATLAB solutions
□ Forward difference
□ Backward difference
□ Algorithms
5/19/2018 Dingyü Xue and YangQuan Chen. Scientific Computing 102/154
with MATLAB, 2nd Edition. CRC Press, 2016
Central Difference Algorithms
□ Formula 1
First order differentiation
Denote
Algorithm precision
□ Error o(Dt2)
5/19/2018 Dingyü Xue and YangQuan Chen. Scientific Computing 105/154
with MATLAB, 2nd Edition. CRC Press, 2016
High Precistion Algorithms
□ Differentiation
Precision
5/19/2018 Dingyü Xue and YangQuan Chen. Scientific Computing 106/154
with MATLAB, 2nd Edition. CRC Press, 2016
MATLAB Implementation of
Central Differentiation
□ Syntax
□ Function listing
□ Error analysis
□ Gradient computation
□ where Dx and Dy are step-sizes in x, y
5/19/2018 Dingyü Xue and YangQuan Chen. Scientific Computing 110/154
with MATLAB, 2nd Edition. CRC Press, 2016
Example 3.49 Gradient
□ Function
Generate data
Calculate gradients and analyze errors
□ MATLAB solutions
□ Graphics comparisons
□ MATLAB syntax
□ or
5/19/2018 Dingyü Xue and YangQuan Chen. Scientific Computing 115/154
with MATLAB, 2nd Edition. CRC Press, 2016
Example 3.50
Integral Evaluations
□ Evaluate functions
□ Definite integral in interval
□ MATLAB solutions
5/19/2018 0.25seconds
Dingyü Xue and YangQuan Chen. Scientific Computing 118/154
with MATLAB, 2nd Edition. CRC Press, 2016
3.7.2 Numerical Integral with
One Independent Variable
□ Example of algorithms
Simpson method, integral
where
Old version
Definite integral
Other functions
quadl(), quadgk(), quadv()
5/19/2018 Dingyü Xue and YangQuan Chen. Scientific Computing 120/154
with MATLAB, 2nd Edition. CRC Press, 2016
Example 3.52 MATLAB
Descriptions of Integrand
□ Compute
Method 1, MATLAB function (dot operation)
□ Compute integral
□ Graphical illustration
□ Analytical solution
□ MATLAB solutions
□ Numerical solution
□ Analytical solution
□ Analytical solutions
□ Syntax
5/19/2018 Dingyü Xue and YangQuan Chen. Scientific Computing 131/154
with MATLAB, 2nd Edition. CRC Press, 2016
Example 3.59 Piecewise Function
□ Draw integral function
□ MATLAB solutions
□ MATLAB function
Rectangular region
Old versions
Rectangular region
□ MATLAB solutions
□ Syntax
□ MATLAB solutions
The last value is definite integral results
□ Syntaxes
□ Old versions
Rectangular region
□ MATLAB solutions
□ Syntax
□ Variable substitution
□ integrand
□ Calculate again, faster
□ Variables
□ Integrand
□ MATLAB solutions
□ Comparison
□ Variables
□ integrand
□ MATLAB solutions