SlideShare una empresa de Scribd logo
1 de 25
Introduction to DifferentialIntroduction to Differential
EquationsEquations
Prepared By :-
Divyanshi Bagrawala - 130420105003
Bhaumik Parikh - 130420105006
Bhumika Jariwala - 130420105019
Juhi Kala - 130420105025
Keval dalsaniya - 130420105030
Vishvaraj Chauhan - 130420105058
Definition:
A differential equation is an equation containing an unknown function
and its derivatives.
Equations which are composed of an unknown function and its derivatives are
called differential equations.
32 += x
dx
dy
032
2
=++ ay
dx
dy
dx
yd
36
4
3
3
=+





+ y
dx
dy
dx
yd
Examples:-
y is dependent variable and x is independent variable,
and these are ordinary differential equations
1.
2.
3.
Ordinary Differential Equations
Order of Differential Equation
The order of the differential equation is order of the highest
derivative in the differential equation.
Differential Equation ORDER
32 += x
dx
dy
0932
2
=++ y
dx
dy
dx
yd
36
4
3
3
=+





+ y
dx
dy
dx
yd
1
2
3
Degree of Differential Equation
Differential Equation Degree
032
2
=++ ay
dx
dy
dx
yd
36
4
3
3
=+





+ y
dx
dy
dx
yd
03
53
2
2
=+





+





dx
dy
dx
yd
1
1
3
The degree of a differential equation is power of the highest
order derivative term in the differential equation.
Solution of Differential EquationSolution of Differential Equation
Taylor's Series method
Consider the one dimensional initial value problem
y' = f(x, y), y(x0
) = y0
where f is a function of two variables x and y and (x0
, y0
) is a known point on the
solution curve.
•If the existence of all higher order partial derivatives is assumed for y at x = x0
, then by
Taylor series the value of y at any neibhouring point x+h can be written as
y(x0
+h) = y(x0
) + h y'(x0
) + h2
/2 y''(x0
) + h3
/3! y'''(x0
) + . . . . . .
•where ' represents the derivative with respect to x. Since at x0
, y0
is known, y' at x0
can
be found by computing f(x0
,y0
). Similarly higher derivatives of y at x0
also can be
computed by making use of the relation
y' = f(x,y)
y'' = fx
+ fy
y'
y''' = fxx
+ 2fxy
y' + fyy
y'2
+ fy
y''
and so on.
Then
y(x0
+h) = y(x0
) + h f + h2
( fx
+ fy
y' ) / 2! + h3
( fxx
+ 2fxy
y' + fyy
y'2
+ fy
y'' ) / 3! + o(h4
)
Hence the value of y at any neighboring point x0
+ h can be obtained by summing the
Example: 1
Solve the initial value problem y' = -2xy2
, y(0) = 1 for y at x = 1 with step length 0.2 using Taylor series
method of order four.
Solution:
Given y' = f(x,y) = -2xy2
Þ y'' = -2y2
- 4xyy'
y''' = -8yy' - 4xy'2
- 4xyy''
yiv
= -12y'2
- 12yy'' - 12xy'y'' - 4xyy'''
yv
= -48y'y'' - 16yy''' -12xy''2
- 16xy'y''' - 4xyyiv
The forth order Taylor's formula is
y(xi+h) = y(xi) + h y'(xi, yi) + h2
y''(xi, yi)/2! + h3
y'''(xi, yi)/3! + h4
yiv
(xi, yi)/4!
given at x=0, y=1 and with h = .2 we have
y' = -2(0)(1)2
= 0.0
y'' = -2(1)2
- 4(0)(1)(0) = -2
y''' = -8(1)(0) - 4(0)(0)2
- 4(0)(1)(-2) = 0.0
yiv
= -12(0)2
- 12(1)(-2) - 12(0)(0)(-2) - 4(0)(1)(0) = 24
y(0.2) = 1 + .2 (0) + .22
(-2)/2! + 0 + .24
(24)/4! = .9615
now at x = .2 we have y = .9615
y' = -0.3699, y'' = -1.5648, y''' = 3.9397 and yiv
= 11.9953
then y(0.4) = 1 + .2 (-.3699) + .22
(-1.5648)/2! + .23
(3.9397)/3! + .24
(11.9953)/4! = 0.8624
y(0.6) = 1 + .2 (-.5950) + .22
(-0.6665)/2! + .23
(4.4579)/3! + .24
(-5.4051)/4! = 0.7356
y(0.8) = 1 + .2 (-.6494) + .22
(-0.0642)/2! + .23
(2.6963)/3! + .24
(-10.0879)/4! = 0.6100
y(1.0) = 1 + .2 (-.5953) + .22
(-0.4178)/2! + .23
(0.9553)/3! + .24
(-6.7878)/4! = 0.5001
now at x = 1.0 we have y = .5001
y' = -0.5001,
y'' = 0.5004,
y''' = -.000525 and yiv
= -3.0005
Error in the approximation
E4 = h4
(y4
(1.0) - y4
(0.8))/ 5! = h4
(-3.0005-11.9953)/ 5! = -1.9994e-004
Analytical solution y(x) = 1/(1+x2
) at x = 1, y = .5
Alternate method:
By Taylor series method
y(x0 + x - x0) = y0 + (x-x0)y'(x0) + (x-x0)2
y''(x0)/2! + (x-x0)3
y'''(x0)/3! + (x-
x0)4
yiv
(x0)/4! + . . .
Since x0 = y' = y''' = 0, y = 1, y'' = -2 and yiv
= 24 at x = 0,
y( x ) = 1. - x2
+ x4
+ . . .
Example 2:
Using Taylor series method, find y(0.1) for y' = x - y2
, y(0) = 1 correct upto four
decimal places.
Solution:
Given y' = f(x,y) = x - y2
y'' = 1 - 2yy', y''' = -2yy'' - 2y'2
, yiv
= -2yy''' - 6y'y'', yv
= -2yyiv
-8y'y''' -6y''2
Since at x = 0, y = 1;
y' = -1, y'' = 3, y''' = -8, yiv
= 34 and yv
= -186
The forth order Taylor's formula is
y(x) = y(x0) + (x-x0) y'(x0, y0) + (x-x0)2
y''(x0, y0)/2! + (x-x0)3
y'''(x0, y0)/3! +
(x-x0)4
yiv
(x0, y0)/4! + h5
yv
(x0, y0)/5! +.
. .
= 1 - x + 3 x2
/2! - 8 x3
/3! + 34 x4
/4! - 186 x5
/5! (since x0 = 0)
= 1 - x + 3 x2
/2 - 4 x3
/3 + 17 x4
/12 - 31 x5
/20
Now
y(0.1) = 1 - (0.1) + 3 (0.1)2
/2 - 4 (0.1)3
/3 + 17 (0.1)4
/12 - 31 (0.1)5
/20
= 0.9 + 3 (0.1)2
/2 - 4 (0.1)3
/3 + 17 (0.1)4
/12 - 31 (0.1)5
/20
= 0.915 - 4 (0.1)3
/3 + 17 (0.1)4
/12 - 31 (0.1)5
/20
= 0.9137 + 17 (0.1)4
/12 - 31 (0.1)5
/20
= 0.9138 - 31 (0.1)5
/20
= 0.9138
Euler’s Method
Though in principle it is possible to use Taylor's method of
any order for the given initial value problem to get good
approximations, it has few draw backs like
•The scheme assumes the existence of all higher order
derivatives for the given function f(x,y) which is not a
requirement for the existence of the solution for any first
order initial value problem.
•Even the existence of these higher derivatives is guaranteed
it may not be easy to compute them for any given f(x,y).
•Because of the usage of higher order derivatives in the
formula it is not convenient to write computer programs , that
is the method is more suited for hand calculations.
To overcome these difficulties, Euler developed a scheme by
approximating y' in the given ivp. The scheme is as follows:
The derivative term in the first order ivp
y' = f(x, y) , y(x0
) = y0
is approximated by making use of Taylor series approximation of the
dependent variable y(x) at the point xi+1
. That is
y(xi+1
) = y(xi
+ ∆x) = y(xi
) + ∆xy'(xi
) + (∆x2
/ 2)y''(xi
) + . . .
= y(xi
) + ∆xf(xi
, yi
) + (∆x2
/ 2)y''(xi
) + . . .
(... y'(xi
) = f(xi
, yi
))
if the infinite series is truncated from the term ∆x2
onwards, then
y(xi+1
) = y(xi
) + ∆x y'(xi
) (or)
yi+1
= yi
+ ∆x fi
for all i
That is,
for i = 0, y1
= y0
+ ∆x f0
i = 1, y2
= y1
+ ∆x f1
i = n-1, yn
= yn-1
+ ∆x fn-1
• The first derivative provides a direct estimate of the
slope at xi
where f(xi,yi) is the differential equation evaluated at xi
and yi. This estimate can be substituted into the
equation:
• A new value of y is predicted using the slope to
extrapolate linearly over the step size h.
),( ii yxf=φ
hyxfyy iiii ),(1 +=+
1,0
5.820122),(
00
23
==
+−+−==
yxpointStarting
xxxyxf
dx
dy
25.55.0*5.81),(1 =+=+=+ hyxfyy iiii
Error Analysis for Euler’s Method/
• Numerical solutions of ODEs involves two types of
error:
– Truncation error
• Local truncation error
• Propagated truncation error
– The sum of the two is the total or global truncation error
– Round-off errors
)(
!2
),(
2
2
hOE
h
yxf
E
a
ii
a
=
′
=
Example 3:
Find y(0.5) if y is the solution of IVP y' = -2x-y, y(0) = -1 using
Euler's method with step length 0.1. Also find the error in the
approximation.
Solution:
f(x, y) = -2x - y,
y1 = y0 + h f(x0, y0) = -1 + 0.1* (-2*0 - (-1)) = -0.8999
y2 = y1 + h f(x1, y1) = -0.8999 + 0.1* (-2*0 - (-0.8999)) = -0.8299
y3 = y2 + h f(x2, y2) = -0.8299 + 0.1* (-2*0 - (-0.8299)) = -0.7869
y4 = y3 + h f(x3, y3) = -0.7869 + 0.1* (-2*0 - (-0.7869)) = -0.7683
y5 = y4 + h f(x4, y4) = -0.7683 + 0.1* (-2*0 - (-0.7683)) = -0.7715
Truncation error in the approximation = ( h2
/2 ) f''(x), where 0 < x
<0.5
= 0.005 f''(x)
Example 4:
Find y(0.8) with h = 0.1 from y' = y - 2x/y, y(0) = 1 using Euler's
method:-
Solution:
f(x, y) = y - 2x/y
y1
= y0
+ h f(x0
, y0
) = 1.0 + 0.1* ( 1.0- 2*0.0/1.0 ) = 1.1000
y2
= y1
+ h f(x1
, y1
) = 1.1 + 0.1* ( 1.1- 2*0.1/1.1 ) = 1.1918
y3
= y2
+ h f(x2
, y2
) = 1.1918 + 0.1* ( 1.1918- 2*0.2/1.1918 ) = 1.2774
y4
= y3
+ h f(x3
, y3
) = 1.2774 + 0.1* ( 1.2774- 2*0.3/1.2774 ) = 1.3582
y5
= y4
+ h f(x4
, y4
) = 1.3582 + 0.1* ( 1.3582- 2*0.4/1.3582 ) = 1.4351
y6
= y5
+ h f(x5
, y5
) = 1.4351 + 0.1* ( 1.4351- 2*0.5/1.4351 ) = 1.5089
y7
= y6
+ h f(x6
, y6
) = 1.5089 + 0.1* ( 1.5089- 2*0.6/1.5089 ) = 1.5803
y8
= y7
+ h f(x7
, y7
) = 1.5803 + 0.1* ( 1.5803- 2*0.7/1.5803 ) = 1.6497
Modified Euler's Method :
The Euler forward scheme may be very easy to implement but it
can't give accurate solutions. A very small step size is required
for any meaningful result. In this scheme, since, the starting point
of each sub-interval is used to find the slope of the solution
curve, the solution would be correct only if the function is linear.
So an improvement over this is to take the arithmetic average of
the slopes at xi
and xi+1
(that is, at the end points of each sub-
interval). The scheme so obtained is called modified Euler's
method. It works first by approximating a value to yi+1
and then
improving it by making use of average slope.
If Euler's method is used to find the first approximation of yi+1
then
yi+1
= yi
+ 0.5h(fi
+ f(xi+1
, yi
+ hfi
))
Truncation error:
yi+1 = yi + h y'i + h2
yi'' /2 + h3
yi''' /3! + h4
yi
iv
/4! + . . .
fi+1 = y'i+1 = y'i + h y''i + h2
yi'''' /2 + h3
yi
iv
/3! + h4
yi
v
/4! + . . .
By substituting these expansions in the Modified Euler formula gives
yi + h y'i + h2
yi'' /2 + h3
yi''' /3! + h4
yi
iv
/4! + . . . = yi+ h/2 (y'i + y'i + h y''i
+ h2
yi'''' /2 + h3
yi
iv
/3! + h4
yi
v
/4! + . . . )
So the truncation error is: - h3
yi''' /12 - h4
yi
iv
/24 + . . . that is, Modified
Euler's method is of order two.
Example 5:
Find y(1.0) accurate upto four decimal places using Modified Euler's
method by solving the IVP y' = -2xy2
, y(0) = 1 with step lengh 0.2.
Solution:
f(x, y) = -2xy2
y' = -2*x*y*y, y[0.0] = 1.0 with h = 0.2
Given
y[0.0] = 1.0
Euler Solution: y(1) = y(0) + h*(-2*x*y*y)(1)
y[0.20] = 1.0
Modified Euler iterations:y(1) = y(0) + .5*h*((-2*x*y*y)(0) + (-2*x*y*y)(1)
y[0.20] = 1.0 y[0.20] = 0.9599999988079071 y[0.20] =
0.9631359989929199
y[0.20] = 0.9628947607919341 y[0.20] = 0.9629133460803093
Euler Solution: y(2) = y(1) + h*(-2*x*y*y)(2)
y[0.40] = 0.8887359638083165
Modified Euler iterations:y(2) = y(1) + .5*h*((-2*x*y*y)(1) + (-2*x*y*y)(2)
y[0.40] = 0.8887359638083165 y[0.40] = 0.8626358081578545
y[0.40] = 0.8662926943348495 y[0.40] = 0.8657868947404332
y[0.40] = 0.865856981554814
Euler Solution: y(3) = y(2) + h*(-2*x*y*y)(3)
y[0.60] = 0.7458966289094106
Modified Euler iterations:y(3) = y(2) + .5*h*((-2*x*y*y)(2) + (-2*x*y*y)(3)
y[0.60] = 0.7458966289094106 y[0.60] = 0.7391085349039348
y[0.60] = 0.7403181774980547 y[0.60] = 0.7401034281837107
y[0.60] = 0.7401415785278189
Euler Solution: y(4) = y(3) + h*(-2*x*y*y)(4)
y[0.80] = 0.6086629119889084
Modified Euler iterations:y(4) = y(3) + .5*h*((-2*x*y*y)(3) + (-2*x*y*y)(4)
y[0.80] = 0.6086629119889084 y[0.80] = 0.6151235687114084
y[0.80] = 0.6138585343771569 y[0.80] = 0.6141072871136244
y[0.80] = 0.6140584135348263
Euler Solution: y(5) = y(4) + h*(-2*x*y*y)(5)
y[1.00] = 0.49340256427369866
Modified Euler iterations:y(5) = y(4) + .5*h*((-2*x*y*y)(4) + (-2*x*y*y)(5)
y[1.00] = 0.49340256427369866 y[1.00] = 0.5050460713552334
y[1.00] = 0.5027209825340415 y[1.00] = 0.5031896121302805
y[1.00] = 0.5030953322323046 y[1.00] = 0.503114306721248
22
Runge-Kutta Methods (RK)
• Runge-Kutta methods achieve the accuracy of a
Taylor series approach without requiring the
calculation of higher derivatives.
),(
),(
),(
),(
constants'
),,(
11,122,1111
22212133
11112
1
2211
1
hkqhkqhkqyhpxfk
hkqhkqyhpxfk
hkqyhpxfk
yxfk
sa
kakaka
hhyxyy
nnnnninin
ii
ii
ii
nn
iiii
−−−−−−
+
+++++=
+++=
++=
=
=
+++=
+=


φ
φ
Increment function
p’s and q’s are constants
•RK method of order 2nd
Order (v = 2)
K1 = h f(xi, yi)
K2 = h f(xi + h, yi + K1 )
yi+1 = yi + (K1 + K2 )/2 at xi+1 = xi + h
•RK method of order 4th
Order (v = 4)
K1 = h f(xi, yi)
K2 = h f(xi + h/2, yi + K1 /2)
K3 = h f(xi + h/2, yi + K2 /2)
K4 = h f(xi + h, yi + K3 )
yi+1 = yi + ( K1 + 2K2 + 2K3 + K4 )/6 at at xi+1 = xi + h
Example 6:
Using RK method of order four find y at x = 1.1 and 1.2 by solving y' = x2
+
y2
, y(1) = 2.3
Solution: Using RK method of order 4
Given y' = x*x+y*y,
y[1.00] = 2.3
with step-length = 0.1
K1 = 0.628999987438321
K2 = 0.7938110087671021
K3 = 0.83757991687511
K4 = 1.1054407603556848
y[1.10] = 3.1328703854960227
K1 = 1.102487701987972
K2 = 1.4895197934605002
K3 = 1.6358516854539997
K4 = 2.4180710557439085
y[1.20] = 4.761420671422837
Introduction to Differential Equations

Más contenido relacionado

La actualidad más candente

Finite difference method
Finite difference methodFinite difference method
Finite difference methodDivyansh Verma
 
Euler and improved euler method
Euler and improved euler methodEuler and improved euler method
Euler and improved euler methodSohaib Butt
 
introduction to differential equations
introduction to differential equationsintroduction to differential equations
introduction to differential equationsEmdadul Haque Milon
 
Second order homogeneous linear differential equations
Second order homogeneous linear differential equations Second order homogeneous linear differential equations
Second order homogeneous linear differential equations Viraj Patel
 
First order linear differential equation
First order linear differential equationFirst order linear differential equation
First order linear differential equationNofal Umair
 
Series solution to ordinary differential equations
Series solution to ordinary differential equations Series solution to ordinary differential equations
Series solution to ordinary differential equations University of Windsor
 
Euler's Method
Euler's MethodEuler's Method
Euler's Methoddmidgette
 
Ode powerpoint presentation1
Ode powerpoint presentation1Ode powerpoint presentation1
Ode powerpoint presentation1Pokkarn Narkhede
 
Langrange Interpolation Polynomials
Langrange Interpolation PolynomialsLangrange Interpolation Polynomials
Langrange Interpolation PolynomialsSohaib H. Khan
 
Ordinary differential equations
Ordinary differential equationsOrdinary differential equations
Ordinary differential equationsAhmed Haider
 
presentation on Euler and Modified Euler method ,and Fitting of curve
presentation on Euler and Modified Euler method ,and Fitting of curve presentation on Euler and Modified Euler method ,and Fitting of curve
presentation on Euler and Modified Euler method ,and Fitting of curve Mukuldev Khunte
 
Runge-Kutta methods with examples
Runge-Kutta methods with examplesRunge-Kutta methods with examples
Runge-Kutta methods with examplesSajjad Hossain
 
First Order Differential Equations
First Order Differential EquationsFirst Order Differential Equations
First Order Differential EquationsItishree Dash
 
partialderivatives
partialderivativespartialderivatives
partialderivativesyash patel
 
1.1 review on algebra 1
1.1 review on algebra 11.1 review on algebra 1
1.1 review on algebra 1math265
 
Differential equations
Differential equationsDifferential equations
Differential equationsSeyid Kadher
 
ORDINARY DIFFERENTIAL EQUATION
ORDINARY DIFFERENTIAL EQUATION ORDINARY DIFFERENTIAL EQUATION
ORDINARY DIFFERENTIAL EQUATION LANKESH S S
 

La actualidad más candente (20)

Finite difference method
Finite difference methodFinite difference method
Finite difference method
 
Euler and improved euler method
Euler and improved euler methodEuler and improved euler method
Euler and improved euler method
 
introduction to differential equations
introduction to differential equationsintroduction to differential equations
introduction to differential equations
 
Second order homogeneous linear differential equations
Second order homogeneous linear differential equations Second order homogeneous linear differential equations
Second order homogeneous linear differential equations
 
First order linear differential equation
First order linear differential equationFirst order linear differential equation
First order linear differential equation
 
Series solution to ordinary differential equations
Series solution to ordinary differential equations Series solution to ordinary differential equations
Series solution to ordinary differential equations
 
Calculus of variations
Calculus of variationsCalculus of variations
Calculus of variations
 
Finite Difference Method
Finite Difference MethodFinite Difference Method
Finite Difference Method
 
Euler's Method
Euler's MethodEuler's Method
Euler's Method
 
Ode powerpoint presentation1
Ode powerpoint presentation1Ode powerpoint presentation1
Ode powerpoint presentation1
 
11365.integral 2
11365.integral 211365.integral 2
11365.integral 2
 
Langrange Interpolation Polynomials
Langrange Interpolation PolynomialsLangrange Interpolation Polynomials
Langrange Interpolation Polynomials
 
Ordinary differential equations
Ordinary differential equationsOrdinary differential equations
Ordinary differential equations
 
presentation on Euler and Modified Euler method ,and Fitting of curve
presentation on Euler and Modified Euler method ,and Fitting of curve presentation on Euler and Modified Euler method ,and Fitting of curve
presentation on Euler and Modified Euler method ,and Fitting of curve
 
Runge-Kutta methods with examples
Runge-Kutta methods with examplesRunge-Kutta methods with examples
Runge-Kutta methods with examples
 
First Order Differential Equations
First Order Differential EquationsFirst Order Differential Equations
First Order Differential Equations
 
partialderivatives
partialderivativespartialderivatives
partialderivatives
 
1.1 review on algebra 1
1.1 review on algebra 11.1 review on algebra 1
1.1 review on algebra 1
 
Differential equations
Differential equationsDifferential equations
Differential equations
 
ORDINARY DIFFERENTIAL EQUATION
ORDINARY DIFFERENTIAL EQUATION ORDINARY DIFFERENTIAL EQUATION
ORDINARY DIFFERENTIAL EQUATION
 

Similar a Introduction to Differential Equations

Differential Calculus
Differential Calculus Differential Calculus
Differential Calculus OlooPundit
 
Top school in India
Top school in IndiaTop school in India
Top school in IndiaEdhole.com
 
Numericals Reasoning.pdf
Numericals Reasoning.pdfNumericals Reasoning.pdf
Numericals Reasoning.pdfAvirup Pal
 
Top School in india
Top School in indiaTop School in india
Top School in indiaEdhole.com
 
Top School in delhi
Top School in delhiTop School in delhi
Top School in delhiEdhole.com
 
Computational techniques
Computational techniquesComputational techniques
Computational techniquesRafi Dar
 
CalculusStudyGuide
CalculusStudyGuideCalculusStudyGuide
CalculusStudyGuideMo Elkhatib
 
Assignment For Matlab Report Subject Calculus 2
Assignment For Matlab Report Subject  Calculus 2Assignment For Matlab Report Subject  Calculus 2
Assignment For Matlab Report Subject Calculus 2Laurie Smith
 
Initial value problems
Initial value problemsInitial value problems
Initial value problemsAli Jan Hasan
 
Numerical differentiation integration
Numerical differentiation integrationNumerical differentiation integration
Numerical differentiation integrationTarun Gehlot
 

Similar a Introduction to Differential Equations (20)

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
 
lec12.pdf
lec12.pdflec12.pdf
lec12.pdf
 
Differential Calculus
Differential Calculus Differential Calculus
Differential Calculus
 
Top school in India
Top school in IndiaTop school in India
Top school in India
 
Numericals Reasoning.pdf
Numericals Reasoning.pdfNumericals Reasoning.pdf
Numericals Reasoning.pdf
 
Top School in india
Top School in indiaTop School in india
Top School in india
 
Top School in delhi
Top School in delhiTop School in delhi
Top School in delhi
 
Computational techniques
Computational techniquesComputational techniques
Computational techniques
 
CalculusStudyGuide
CalculusStudyGuideCalculusStudyGuide
CalculusStudyGuide
 
Sect1 1
Sect1 1Sect1 1
Sect1 1
 
Sect2 5
Sect2 5Sect2 5
Sect2 5
 
Euler's Method.pdf
Euler's Method.pdfEuler's Method.pdf
Euler's Method.pdf
 
Euler's Method.pdf
Euler's Method.pdfEuler's Method.pdf
Euler's Method.pdf
 
Sect2 4
Sect2 4Sect2 4
Sect2 4
 
Assignment For Matlab Report Subject Calculus 2
Assignment For Matlab Report Subject  Calculus 2Assignment For Matlab Report Subject  Calculus 2
Assignment For Matlab Report Subject Calculus 2
 
Numerical method
Numerical methodNumerical method
Numerical method
 
Lagrange_Multipliers.pdf
Lagrange_Multipliers.pdfLagrange_Multipliers.pdf
Lagrange_Multipliers.pdf
 
Diff-Eqs
Diff-EqsDiff-Eqs
Diff-Eqs
 
Initial value problems
Initial value problemsInitial value problems
Initial value problems
 
Numerical differentiation integration
Numerical differentiation integrationNumerical differentiation integration
Numerical differentiation integration
 

Más de Vishvaraj Chauhan

Preparation of Activated Bio-Carbon from Sawdust, Rice Husks and Coconut Husks
Preparation of Activated Bio-Carbon from Sawdust, Rice Husks and Coconut HusksPreparation of Activated Bio-Carbon from Sawdust, Rice Husks and Coconut Husks
Preparation of Activated Bio-Carbon from Sawdust, Rice Husks and Coconut HusksVishvaraj Chauhan
 
Prevention and Control of Air Pollution, Noise Pollution and Vehicular Pollut...
Prevention and Control of Air Pollution, Noise Pollution and Vehicular Pollut...Prevention and Control of Air Pollution, Noise Pollution and Vehicular Pollut...
Prevention and Control of Air Pollution, Noise Pollution and Vehicular Pollut...Vishvaraj Chauhan
 
Frequency Response Analysis and Bode Diagrams for First Order Systems
Frequency Response Analysis and Bode Diagrams for First Order SystemsFrequency Response Analysis and Bode Diagrams for First Order Systems
Frequency Response Analysis and Bode Diagrams for First Order SystemsVishvaraj Chauhan
 
Shell and Tube Heat Exchangers, LMTD, Extended Surface Heat Exchangers.
Shell and Tube Heat Exchangers, LMTD, Extended Surface Heat Exchangers.Shell and Tube Heat Exchangers, LMTD, Extended Surface Heat Exchangers.
Shell and Tube Heat Exchangers, LMTD, Extended Surface Heat Exchangers.Vishvaraj Chauhan
 
Lime Soda Process - Softening Of Water
Lime Soda Process - Softening Of WaterLime Soda Process - Softening Of Water
Lime Soda Process - Softening Of WaterVishvaraj Chauhan
 
Waste Disposal Management - Basics
Waste Disposal Management - BasicsWaste Disposal Management - Basics
Waste Disposal Management - BasicsVishvaraj Chauhan
 

Más de Vishvaraj Chauhan (9)

Preparation of Activated Bio-Carbon from Sawdust, Rice Husks and Coconut Husks
Preparation of Activated Bio-Carbon from Sawdust, Rice Husks and Coconut HusksPreparation of Activated Bio-Carbon from Sawdust, Rice Husks and Coconut Husks
Preparation of Activated Bio-Carbon from Sawdust, Rice Husks and Coconut Husks
 
Prevention and Control of Air Pollution, Noise Pollution and Vehicular Pollut...
Prevention and Control of Air Pollution, Noise Pollution and Vehicular Pollut...Prevention and Control of Air Pollution, Noise Pollution and Vehicular Pollut...
Prevention and Control of Air Pollution, Noise Pollution and Vehicular Pollut...
 
Adsorption - Basics
Adsorption - BasicsAdsorption - Basics
Adsorption - Basics
 
Ultrafine Filtration
Ultrafine FiltrationUltrafine Filtration
Ultrafine Filtration
 
Frequency Response Analysis and Bode Diagrams for First Order Systems
Frequency Response Analysis and Bode Diagrams for First Order SystemsFrequency Response Analysis and Bode Diagrams for First Order Systems
Frequency Response Analysis and Bode Diagrams for First Order Systems
 
Shell and Tube Heat Exchangers, LMTD, Extended Surface Heat Exchangers.
Shell and Tube Heat Exchangers, LMTD, Extended Surface Heat Exchangers.Shell and Tube Heat Exchangers, LMTD, Extended Surface Heat Exchangers.
Shell and Tube Heat Exchangers, LMTD, Extended Surface Heat Exchangers.
 
Polishing
PolishingPolishing
Polishing
 
Lime Soda Process - Softening Of Water
Lime Soda Process - Softening Of WaterLime Soda Process - Softening Of Water
Lime Soda Process - Softening Of Water
 
Waste Disposal Management - Basics
Waste Disposal Management - BasicsWaste Disposal Management - Basics
Waste Disposal Management - Basics
 

Último

1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
 
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...KokoStevan
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxAreebaZafar22
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsTechSoup
 
Making and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfMaking and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfChris Hunter
 
PROCESS RECORDING FORMAT.docx
PROCESS      RECORDING        FORMAT.docxPROCESS      RECORDING        FORMAT.docx
PROCESS RECORDING FORMAT.docxPoojaSen20
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDThiyagu K
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphThiyagu K
 
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
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 
Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.MateoGardella
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfJayanti Pande
 
An Overview of Mutual Funds Bcom Project.pdf
An Overview of Mutual Funds Bcom Project.pdfAn Overview of Mutual Funds Bcom Project.pdf
An Overview of Mutual Funds Bcom Project.pdfSanaAli374401
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxVishalSingh1417
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Disha Kariya
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin ClassesCeline George
 
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
 
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...Shubhangi Sonawane
 

Último (20)

1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
Making and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfMaking and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdf
 
PROCESS RECORDING FORMAT.docx
PROCESS      RECORDING        FORMAT.docxPROCESS      RECORDING        FORMAT.docx
PROCESS RECORDING FORMAT.docx
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SD
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
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
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
An Overview of Mutual Funds Bcom Project.pdf
An Overview of Mutual Funds Bcom Project.pdfAn Overview of Mutual Funds Bcom Project.pdf
An Overview of Mutual Funds Bcom Project.pdf
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptx
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
 
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
 
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
 

Introduction to Differential Equations

  • 1. Introduction to DifferentialIntroduction to Differential EquationsEquations Prepared By :- Divyanshi Bagrawala - 130420105003 Bhaumik Parikh - 130420105006 Bhumika Jariwala - 130420105019 Juhi Kala - 130420105025 Keval dalsaniya - 130420105030 Vishvaraj Chauhan - 130420105058
  • 2. Definition: A differential equation is an equation containing an unknown function and its derivatives. Equations which are composed of an unknown function and its derivatives are called differential equations. 32 += x dx dy 032 2 =++ ay dx dy dx yd 36 4 3 3 =+      + y dx dy dx yd Examples:- y is dependent variable and x is independent variable, and these are ordinary differential equations 1. 2. 3. Ordinary Differential Equations
  • 3. Order of Differential Equation The order of the differential equation is order of the highest derivative in the differential equation. Differential Equation ORDER 32 += x dx dy 0932 2 =++ y dx dy dx yd 36 4 3 3 =+      + y dx dy dx yd 1 2 3
  • 4. Degree of Differential Equation Differential Equation Degree 032 2 =++ ay dx dy dx yd 36 4 3 3 =+      + y dx dy dx yd 03 53 2 2 =+      +      dx dy dx yd 1 1 3 The degree of a differential equation is power of the highest order derivative term in the differential equation.
  • 5. Solution of Differential EquationSolution of Differential Equation
  • 6. Taylor's Series method Consider the one dimensional initial value problem y' = f(x, y), y(x0 ) = y0 where f is a function of two variables x and y and (x0 , y0 ) is a known point on the solution curve. •If the existence of all higher order partial derivatives is assumed for y at x = x0 , then by Taylor series the value of y at any neibhouring point x+h can be written as y(x0 +h) = y(x0 ) + h y'(x0 ) + h2 /2 y''(x0 ) + h3 /3! y'''(x0 ) + . . . . . . •where ' represents the derivative with respect to x. Since at x0 , y0 is known, y' at x0 can be found by computing f(x0 ,y0 ). Similarly higher derivatives of y at x0 also can be computed by making use of the relation y' = f(x,y) y'' = fx + fy y' y''' = fxx + 2fxy y' + fyy y'2 + fy y'' and so on. Then y(x0 +h) = y(x0 ) + h f + h2 ( fx + fy y' ) / 2! + h3 ( fxx + 2fxy y' + fyy y'2 + fy y'' ) / 3! + o(h4 ) Hence the value of y at any neighboring point x0 + h can be obtained by summing the
  • 7. Example: 1 Solve the initial value problem y' = -2xy2 , y(0) = 1 for y at x = 1 with step length 0.2 using Taylor series method of order four. Solution: Given y' = f(x,y) = -2xy2 Þ y'' = -2y2 - 4xyy' y''' = -8yy' - 4xy'2 - 4xyy'' yiv = -12y'2 - 12yy'' - 12xy'y'' - 4xyy''' yv = -48y'y'' - 16yy''' -12xy''2 - 16xy'y''' - 4xyyiv The forth order Taylor's formula is y(xi+h) = y(xi) + h y'(xi, yi) + h2 y''(xi, yi)/2! + h3 y'''(xi, yi)/3! + h4 yiv (xi, yi)/4! given at x=0, y=1 and with h = .2 we have y' = -2(0)(1)2 = 0.0 y'' = -2(1)2 - 4(0)(1)(0) = -2 y''' = -8(1)(0) - 4(0)(0)2 - 4(0)(1)(-2) = 0.0 yiv = -12(0)2 - 12(1)(-2) - 12(0)(0)(-2) - 4(0)(1)(0) = 24 y(0.2) = 1 + .2 (0) + .22 (-2)/2! + 0 + .24 (24)/4! = .9615 now at x = .2 we have y = .9615 y' = -0.3699, y'' = -1.5648, y''' = 3.9397 and yiv = 11.9953 then y(0.4) = 1 + .2 (-.3699) + .22 (-1.5648)/2! + .23 (3.9397)/3! + .24 (11.9953)/4! = 0.8624 y(0.6) = 1 + .2 (-.5950) + .22 (-0.6665)/2! + .23 (4.4579)/3! + .24 (-5.4051)/4! = 0.7356 y(0.8) = 1 + .2 (-.6494) + .22 (-0.0642)/2! + .23 (2.6963)/3! + .24 (-10.0879)/4! = 0.6100 y(1.0) = 1 + .2 (-.5953) + .22 (-0.4178)/2! + .23 (0.9553)/3! + .24 (-6.7878)/4! = 0.5001
  • 8. now at x = 1.0 we have y = .5001 y' = -0.5001, y'' = 0.5004, y''' = -.000525 and yiv = -3.0005 Error in the approximation E4 = h4 (y4 (1.0) - y4 (0.8))/ 5! = h4 (-3.0005-11.9953)/ 5! = -1.9994e-004 Analytical solution y(x) = 1/(1+x2 ) at x = 1, y = .5 Alternate method: By Taylor series method y(x0 + x - x0) = y0 + (x-x0)y'(x0) + (x-x0)2 y''(x0)/2! + (x-x0)3 y'''(x0)/3! + (x- x0)4 yiv (x0)/4! + . . . Since x0 = y' = y''' = 0, y = 1, y'' = -2 and yiv = 24 at x = 0, y( x ) = 1. - x2 + x4 + . . .
  • 9. Example 2: Using Taylor series method, find y(0.1) for y' = x - y2 , y(0) = 1 correct upto four decimal places. Solution: Given y' = f(x,y) = x - y2 y'' = 1 - 2yy', y''' = -2yy'' - 2y'2 , yiv = -2yy''' - 6y'y'', yv = -2yyiv -8y'y''' -6y''2 Since at x = 0, y = 1; y' = -1, y'' = 3, y''' = -8, yiv = 34 and yv = -186 The forth order Taylor's formula is y(x) = y(x0) + (x-x0) y'(x0, y0) + (x-x0)2 y''(x0, y0)/2! + (x-x0)3 y'''(x0, y0)/3! + (x-x0)4 yiv (x0, y0)/4! + h5 yv (x0, y0)/5! +. . . = 1 - x + 3 x2 /2! - 8 x3 /3! + 34 x4 /4! - 186 x5 /5! (since x0 = 0) = 1 - x + 3 x2 /2 - 4 x3 /3 + 17 x4 /12 - 31 x5 /20 Now y(0.1) = 1 - (0.1) + 3 (0.1)2 /2 - 4 (0.1)3 /3 + 17 (0.1)4 /12 - 31 (0.1)5 /20 = 0.9 + 3 (0.1)2 /2 - 4 (0.1)3 /3 + 17 (0.1)4 /12 - 31 (0.1)5 /20 = 0.915 - 4 (0.1)3 /3 + 17 (0.1)4 /12 - 31 (0.1)5 /20 = 0.9137 + 17 (0.1)4 /12 - 31 (0.1)5 /20 = 0.9138 - 31 (0.1)5 /20 = 0.9138
  • 10. Euler’s Method Though in principle it is possible to use Taylor's method of any order for the given initial value problem to get good approximations, it has few draw backs like •The scheme assumes the existence of all higher order derivatives for the given function f(x,y) which is not a requirement for the existence of the solution for any first order initial value problem. •Even the existence of these higher derivatives is guaranteed it may not be easy to compute them for any given f(x,y). •Because of the usage of higher order derivatives in the formula it is not convenient to write computer programs , that is the method is more suited for hand calculations.
  • 11. To overcome these difficulties, Euler developed a scheme by approximating y' in the given ivp. The scheme is as follows: The derivative term in the first order ivp y' = f(x, y) , y(x0 ) = y0 is approximated by making use of Taylor series approximation of the dependent variable y(x) at the point xi+1 . That is y(xi+1 ) = y(xi + ∆x) = y(xi ) + ∆xy'(xi ) + (∆x2 / 2)y''(xi ) + . . . = y(xi ) + ∆xf(xi , yi ) + (∆x2 / 2)y''(xi ) + . . . (... y'(xi ) = f(xi , yi )) if the infinite series is truncated from the term ∆x2 onwards, then y(xi+1 ) = y(xi ) + ∆x y'(xi ) (or) yi+1 = yi + ∆x fi for all i That is, for i = 0, y1 = y0 + ∆x f0 i = 1, y2 = y1 + ∆x f1 i = n-1, yn = yn-1 + ∆x fn-1
  • 12.
  • 13. • The first derivative provides a direct estimate of the slope at xi where f(xi,yi) is the differential equation evaluated at xi and yi. This estimate can be substituted into the equation: • A new value of y is predicted using the slope to extrapolate linearly over the step size h. ),( ii yxf=φ hyxfyy iiii ),(1 +=+
  • 15. Error Analysis for Euler’s Method/ • Numerical solutions of ODEs involves two types of error: – Truncation error • Local truncation error • Propagated truncation error – The sum of the two is the total or global truncation error – Round-off errors )( !2 ),( 2 2 hOE h yxf E a ii a = ′ =
  • 16. Example 3: Find y(0.5) if y is the solution of IVP y' = -2x-y, y(0) = -1 using Euler's method with step length 0.1. Also find the error in the approximation. Solution: f(x, y) = -2x - y, y1 = y0 + h f(x0, y0) = -1 + 0.1* (-2*0 - (-1)) = -0.8999 y2 = y1 + h f(x1, y1) = -0.8999 + 0.1* (-2*0 - (-0.8999)) = -0.8299 y3 = y2 + h f(x2, y2) = -0.8299 + 0.1* (-2*0 - (-0.8299)) = -0.7869 y4 = y3 + h f(x3, y3) = -0.7869 + 0.1* (-2*0 - (-0.7869)) = -0.7683 y5 = y4 + h f(x4, y4) = -0.7683 + 0.1* (-2*0 - (-0.7683)) = -0.7715 Truncation error in the approximation = ( h2 /2 ) f''(x), where 0 < x <0.5 = 0.005 f''(x)
  • 17. Example 4: Find y(0.8) with h = 0.1 from y' = y - 2x/y, y(0) = 1 using Euler's method:- Solution: f(x, y) = y - 2x/y y1 = y0 + h f(x0 , y0 ) = 1.0 + 0.1* ( 1.0- 2*0.0/1.0 ) = 1.1000 y2 = y1 + h f(x1 , y1 ) = 1.1 + 0.1* ( 1.1- 2*0.1/1.1 ) = 1.1918 y3 = y2 + h f(x2 , y2 ) = 1.1918 + 0.1* ( 1.1918- 2*0.2/1.1918 ) = 1.2774 y4 = y3 + h f(x3 , y3 ) = 1.2774 + 0.1* ( 1.2774- 2*0.3/1.2774 ) = 1.3582 y5 = y4 + h f(x4 , y4 ) = 1.3582 + 0.1* ( 1.3582- 2*0.4/1.3582 ) = 1.4351 y6 = y5 + h f(x5 , y5 ) = 1.4351 + 0.1* ( 1.4351- 2*0.5/1.4351 ) = 1.5089 y7 = y6 + h f(x6 , y6 ) = 1.5089 + 0.1* ( 1.5089- 2*0.6/1.5089 ) = 1.5803 y8 = y7 + h f(x7 , y7 ) = 1.5803 + 0.1* ( 1.5803- 2*0.7/1.5803 ) = 1.6497
  • 18. Modified Euler's Method : The Euler forward scheme may be very easy to implement but it can't give accurate solutions. A very small step size is required for any meaningful result. In this scheme, since, the starting point of each sub-interval is used to find the slope of the solution curve, the solution would be correct only if the function is linear. So an improvement over this is to take the arithmetic average of the slopes at xi and xi+1 (that is, at the end points of each sub- interval). The scheme so obtained is called modified Euler's method. It works first by approximating a value to yi+1 and then improving it by making use of average slope. If Euler's method is used to find the first approximation of yi+1 then yi+1 = yi + 0.5h(fi + f(xi+1 , yi + hfi ))
  • 19. Truncation error: yi+1 = yi + h y'i + h2 yi'' /2 + h3 yi''' /3! + h4 yi iv /4! + . . . fi+1 = y'i+1 = y'i + h y''i + h2 yi'''' /2 + h3 yi iv /3! + h4 yi v /4! + . . . By substituting these expansions in the Modified Euler formula gives yi + h y'i + h2 yi'' /2 + h3 yi''' /3! + h4 yi iv /4! + . . . = yi+ h/2 (y'i + y'i + h y''i + h2 yi'''' /2 + h3 yi iv /3! + h4 yi v /4! + . . . ) So the truncation error is: - h3 yi''' /12 - h4 yi iv /24 + . . . that is, Modified Euler's method is of order two.
  • 20. Example 5: Find y(1.0) accurate upto four decimal places using Modified Euler's method by solving the IVP y' = -2xy2 , y(0) = 1 with step lengh 0.2. Solution: f(x, y) = -2xy2 y' = -2*x*y*y, y[0.0] = 1.0 with h = 0.2 Given y[0.0] = 1.0 Euler Solution: y(1) = y(0) + h*(-2*x*y*y)(1) y[0.20] = 1.0 Modified Euler iterations:y(1) = y(0) + .5*h*((-2*x*y*y)(0) + (-2*x*y*y)(1) y[0.20] = 1.0 y[0.20] = 0.9599999988079071 y[0.20] = 0.9631359989929199 y[0.20] = 0.9628947607919341 y[0.20] = 0.9629133460803093 Euler Solution: y(2) = y(1) + h*(-2*x*y*y)(2) y[0.40] = 0.8887359638083165 Modified Euler iterations:y(2) = y(1) + .5*h*((-2*x*y*y)(1) + (-2*x*y*y)(2) y[0.40] = 0.8887359638083165 y[0.40] = 0.8626358081578545 y[0.40] = 0.8662926943348495 y[0.40] = 0.8657868947404332 y[0.40] = 0.865856981554814
  • 21. Euler Solution: y(3) = y(2) + h*(-2*x*y*y)(3) y[0.60] = 0.7458966289094106 Modified Euler iterations:y(3) = y(2) + .5*h*((-2*x*y*y)(2) + (-2*x*y*y)(3) y[0.60] = 0.7458966289094106 y[0.60] = 0.7391085349039348 y[0.60] = 0.7403181774980547 y[0.60] = 0.7401034281837107 y[0.60] = 0.7401415785278189 Euler Solution: y(4) = y(3) + h*(-2*x*y*y)(4) y[0.80] = 0.6086629119889084 Modified Euler iterations:y(4) = y(3) + .5*h*((-2*x*y*y)(3) + (-2*x*y*y)(4) y[0.80] = 0.6086629119889084 y[0.80] = 0.6151235687114084 y[0.80] = 0.6138585343771569 y[0.80] = 0.6141072871136244 y[0.80] = 0.6140584135348263 Euler Solution: y(5) = y(4) + h*(-2*x*y*y)(5) y[1.00] = 0.49340256427369866 Modified Euler iterations:y(5) = y(4) + .5*h*((-2*x*y*y)(4) + (-2*x*y*y)(5) y[1.00] = 0.49340256427369866 y[1.00] = 0.5050460713552334 y[1.00] = 0.5027209825340415 y[1.00] = 0.5031896121302805 y[1.00] = 0.5030953322323046 y[1.00] = 0.503114306721248
  • 22. 22 Runge-Kutta Methods (RK) • Runge-Kutta methods achieve the accuracy of a Taylor series approach without requiring the calculation of higher derivatives. ),( ),( ),( ),( constants' ),,( 11,122,1111 22212133 11112 1 2211 1 hkqhkqhkqyhpxfk hkqhkqyhpxfk hkqyhpxfk yxfk sa kakaka hhyxyy nnnnninin ii ii ii nn iiii −−−−−− + +++++= +++= ++= = = +++= +=   φ φ Increment function p’s and q’s are constants
  • 23. •RK method of order 2nd Order (v = 2) K1 = h f(xi, yi) K2 = h f(xi + h, yi + K1 ) yi+1 = yi + (K1 + K2 )/2 at xi+1 = xi + h •RK method of order 4th Order (v = 4) K1 = h f(xi, yi) K2 = h f(xi + h/2, yi + K1 /2) K3 = h f(xi + h/2, yi + K2 /2) K4 = h f(xi + h, yi + K3 ) yi+1 = yi + ( K1 + 2K2 + 2K3 + K4 )/6 at at xi+1 = xi + h
  • 24. Example 6: Using RK method of order four find y at x = 1.1 and 1.2 by solving y' = x2 + y2 , y(1) = 2.3 Solution: Using RK method of order 4 Given y' = x*x+y*y, y[1.00] = 2.3 with step-length = 0.1 K1 = 0.628999987438321 K2 = 0.7938110087671021 K3 = 0.83757991687511 K4 = 1.1054407603556848 y[1.10] = 3.1328703854960227 K1 = 1.102487701987972 K2 = 1.4895197934605002 K3 = 1.6358516854539997 K4 = 2.4180710557439085 y[1.20] = 4.761420671422837