0% found this document useful (0 votes)
21 views9 pages

Comort Secone Oroler Douaton O Fistorder: Lafe)

Uploaded by

finalizeop
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
21 views9 pages

Comort Secone Oroler Douaton O Fistorder: Lafe)

Uploaded by

finalizeop
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 9

Stm (24)

douaton ofistorder
Comort secone oroler
2

de

wetor
No

fd,de)
x- LafE)
X2)

dxc2)

fome" dv= ftt,o)


dn ) n(2)
due) stn(2t)
eo fnl
7
Stm (24)
orolor dia uoton tofistosder
Comert seovd

dz = stm(2t)
de

eetors
Noo

de

)
d2 dxc2)

fume
duce) Sin(2t)
ero fon;
yt.No,

bnitat Conolitiong

oreler tofioseler
omrt seeom

ott

Step
font

Teacher's Signature
ep-2

to omim (f)

Step

step-y
Plol.
AS5-2631 OOctober 2019 JSDR | Volume 4, lssue 10

Numerical Solution of Ordinary Differential Equation


using Scilab
IP.Yaswanth, L.Naveen
IPGStudent, ²Assistant Professor
Department of Mathematics,
Dr, SNS RajalakshmiCollege of Arts and Science, Coimbatore, Tamil Nadu, India.
Abstract: Numerical methods are developed to solve certain types of linear and non-linear ordinary differential equations
by and its application. dy/dx = f(x,y) with the initial condition y(x0) = yo and we launch differing numerical method of
Ordinary Differential Equation using Scilab Programming.We compare the differentialequations with the exact solution
and the approximation solution. We rectified percentage of error caleulation with the approximate solution form the exact
solution using initial value problenms. In this paper we discuss about the general first order differential equation (ODE).
Index Terms: Ordinary Differential Equation, Initial Condition, Step - by - Step Method, Initial value Problem, Scilab.
INTRODUCTION
In Mathematics, Ordinary differential equtions are used for pathematical modelling in science and engineering.
Numerical methods are used for solving mathematieal problens that are formulated in science and engineering however it is sed
to solve the first order difterential equation but the initial value differential equation where the solution is obtained. Numerical
method for odinary differential equation js method used to find numerical approximations to the solution of order diferential
equation (ODEs) where it is difficult or complicated to obtain exact 'solution. There ar several numerical methods to compute the
approximate solution and the exact solution. In this paper we compare Taylor Series, Euler Method, Modified Euler Method,
Improved Euler Method and Runge - Kutta Method with the exact solution using Scilab Programming.
Scilab is a high level numerically oriented progranmming language to built a function for all of the most numerical method.
Here we consider the general form of first order differential equation as

Euler method uses stepby - step process'whereas Runge -Kuta method uses Multi steps process to solye ordinary differential
equation with the initial conditions

dx. = f(y) andy(xo),= Yo
In all of the Euler and Runge kutta method we consider the interval length h' and the solution of
by the variable x & y.
these methods can be tabulated
We shalldescribe the various numerical methods for solving the initial value problem and
compute the solution-using Scilab.
NUMERICAL METHOD
Tuylor Series Method
The numerical solution of the equation y =fx,y) give the initial condition y(x)= F
x,y and f(Xo Yo) is known point on the solution curye. Y. is a function of two variable
If the existence of allhigher order partial derivatives is assumed for y at x =
of y at any neighbouring point x + h can be written as Xo, then by Taylor series the value
r y(xo + h) = y(x) +h*y' (xo) +(o) +y"(xG) t.
Similarly higher derivatives ofy at xo also can be computed by making use of
relation.
y'= fx,y)
y" = ft fyy'
y= fx + 2feyy' +fyyy" +fyy" and so on.
Example
Solve dx =x+y, given y(1) =0, and get y(1) by Taylor
series method. Compare your result with the explicit
solution.
9 October 2019 1JSDR Volume 4, Issue 1

TAYLOR SERIES METHOD SOLUTION USING SCILAB


CODING
taylor series sce (CAUsers\Limra
Eile Edit Format Options Window Execute ?
Computers\Desktop\publication\. X

taylor series sce (CUsersLitra


13_02.sce
ComputeEuler
taylor series .sce
rs'Desktoppublcationlcodingtaylo series sce)-ScNGtes
Method.sce Euler Methodo 12.sce
1clearclose clc :
2dai('E= (x, y)''E=x+y')
3deff(D2Y=d2y (x, y) , "D2Y =l+f (x, y)'):
4deii('D3Y-=.d3y (x, y)','D3Y=d2y (x, y) "):
5de£f('Y=y(x),'Y=l.+f(0, 1)*x+ d2y (0, 1) *:^2/2 -+-d3y (0, 1) x3/6'):
¿aisp (y (0),'y(0) =.)
7Gisp (y(0.2) ,'yi0.2) -=.")
8disp (y(0.4),'y(0. 4) -=)
9isp (y (0.¬), 'y(0.6)=. )
10disp(I(0.8),'y(0.8) -=.")
11 disp (y(1.0),'z(1.0) -=.')
Fig. 1
Euler Method
1. Euler Method
The numerical solution of the
x,y and f(o yo) is known pointequation y' = f(x,y) gives the initial
on the solution curve. conditiony(xo,)yo, f is a function of two variable
Let us take the point = Xo X Xzy
wherex; - XË-1*h,
i.e., x{ F X t il,
We require the value of y of the curve at xi=0,1,2,3,
= x:
...
The equation of tangent at P, (XoYo) to the curve is

y= Yotf(Xo Yo). (x- X%)


-Y1FYo t hy'
Yn+1 Yn +hf(å yn);n = 0,1,2 ...
Example:
Solve dx =1+y, given y(1) = 0, and get y(1) by Euler
Method. Compare your result with the explieit solution.
EULER METHOD SOLUTION USING SCILAB
CODING
c;clear;close;
eff('
1;
y-f(x,y)'yxty')
0
0.2;
p('x.....y')
i=l:6
atf'n%g-%g n'(i-1)*h,y(i)
-)=yi)+h*î(i-1)°h,yi)
Improved Euler method
itervat to,t), by previous Euter's metlhod, we
() =y, + hf(Xo, Yo) approximale thecurve by the tangent Po4.
455-2631 OOctober 2019 1JSDR| Volume 4

That is y -yo ={/00.0)+


This line intersect x=x1 at
/(.0)J-xo)

1=o +;hf(o, y%) +f*Yo + hf(Xy, y%) ))


Ynn =Yn t ;f( y) +f(*, +h,y, + hf(M y,)))
Example:
dy
Solve=x+y, given y(1)= 0, and get y(1) by Improved Euler Method. Compare your result with the ex
soution.

IMPROVED EULER METHOD SOLUTION USING SCILAB CODING


cle;clear;close;
det\'y=flxy)'y=xty')
y=l;
x-0;
h=0.2:
printfnlnn.By-Improved-Euler-Methodn'
for i=1:6
)
y(itl)=y(i)+h*f(i-1)*hth/2,y(i)+h*R((i-D*h,y(i)y/2)
y(i+l=y()+h/2*{(i-1)h,y(i)+(-1)"h+-h,y(i) +h*(i-1)*h,y())
end
3.Modified Euler method
Recall the Euler governing equatión y,+l= y.thf(xn,yn)
Abetter estimation of the slope from (Xn,y) to
Yni- yat(h/2){T(Xn,ya)+f(Xn+1,yn+1)},
(Xati,Ynt1)would be
But we don't Know ytl.
However, we can estimate it by using the culer's method, to give a two stage
Modified eulre's Method. Predictor - corrector algorithm that is called the

Example:
Solve dy = xty, given y(1) = 0, and get y(1),by Modified Euler Method. Compare your
dx
solution. result with the explicit

MODIFIED EULER METHOD SOLUTION USING SCILAB CODING


cle;clear;close;
deffi('y-f(x,y)','y=x+y')
y=1;
x-0;
h=0.2;
printf("'n\nln.By-Modified-Euler-Method\n'
for i-1:6 1 )
yit1)=yi)+h*(i-1)*h+h/2,y(i)+h*I((i-)*h,y()y2)
end

|Runge - Kutta Metlhod.


Runge Kutta Methods, the derivative of higher order are not
derivaion of fourth order Runge - Kutta method is tedious, wo require only the given function value at difterent poiut. Since the
will derive Runge- Kutta method of second order.
Second Order R.K algorithnm
|K- hf(x,y)
Ay-k) where h=Ax.
2455-2631 O October 2019 JSDR | Volume 4, Issue 10

K:- hla+h, y+k)


Kj=hf(x+h, y+2k2 - k1)
Ay kt4k;+k,)
Fourth Order R.K algorithm
Ki= hf(x,y)
K= hf(x+h, yk)
Kj= hf(x+h, y+-k:)
K4= hf(x+h,y+k3)
Aykit2kzt2ky+ka)
Example:
Solve=x+y,given y(1) =0, and get y(1) by Runge - Kutta Method. Compare your result with the explicit
solution.

RUNGE- KUTTA METHOD SOLUTION USING SCILAB CODING


clc;clear;close;
deff('y=f(x,y)''y=xty')
printf("the value of yl')
y-l; x=0; h-0.2;
Kleh*fo,y);
K2=h*f(x+h/2,y+ki/2);

JSDE
k3=h*f(x+h/2,y+k2/2);
k4-h*f(x+th,y+k3);
disp(k4, k4,k3, k3="k2, k2=k1,kl=)
yl-y+{(kl+2*k2 +2*k3+k4)6]
ptintf("ny(0.2)-%.8fnln'ý1)
end

FIRST ORDER ORDINARY DIFFERENTIAL EQUATION SOLUTION FOR TAYLOR,


IMPROVED METHOD, RUNGE- KUTTA AND EXACT SOLUTION EULER, MODIFIED,
Table 1

Taylor Euler Modified Improved Runge


X Series Euler Euler Exact
Method Kutta
iri Method Method Method Solution
0 1 1
Method
1 1 1 1
0.2 1.2425 1.2 1.24 1,24 1.2428 1.2428
0.4 1.5813 1.48 1.5768 1.5768 1.5836 1.5836
0.6 2.032 1.856 2.0317 2.0317 2.0442 2.0442
0.8 2.6105 2.3472 2.6307 2.6307 2.6510 2.6510
1.0 3.3333 2.9766 3.4054 3.4054 3.4365 3.4366
Error value
Table 2
Percentage of error
Taylor Euler Modified Improved Runge
X Series Euler
Method Euler Kutta
Method Method Method Method
0 0
0,2 0.02 3.44 0.23 0.23 0
0,4 0.14 6.54 0.43 0.43 0
0.6 0.60 9.21L 0.61 0.6
0.8 1.53 1146 0.77 0.77 0
1.0 13.39
65-263 O October 2019 USDR | Volume 4, Issue 10

W
CONCLUSION
In this paper we obtain the approximate solution & Exact solution for the
value condition using Scilab for Taylor series, Euler's Method. Improved given ordinary differential equations with Initial
Kutta Method. Finally, the results are Calculated and tabulated with Euler's Method, Moditied Euler's Method and Runge -
using Scilab Coding. The Runge - Kutta Method is more effective whileapproximation solution, Exact Solution and Percentage of error
minimumn percentage error. comparing to other numerical methods since we get the

REFERENCES
E. Balagurusw amy,"Scilab Tetbook Companion for Numerical
Numerical Methods: Principles, Analysis, And Algoithms", Methods " S. Pal, "Scilab Textbook Companion for
(2) B. Jayapriya, M. Mutthusclvi, ISBN: 9780195693751.
Euler's nmethod and MATLAB ", Volume"Exact and Numerical Solution of ordinary ditferential equations using Highly
4, Issue 10, 2018, ISSN: 23944099. Improved
(3) N. M. M. Yusop, M. K. Hasan, and M. Rahmat,
Equation Using Scilab Programming", Nol. 3, No. 3, August "Comparison New Algorithn Modified Euler in Ordinary Diferential
2015, DOE 107763LNSE.2015.V3.190.
(4) Gadamsetty Revathi, Assistant Professor in Mathematics, "Numericul Solution Of Ordinary Diferential Equations And
Applications", Volume-3, Issue-2, Fcb.-2017, ISSN: 2394-7926.
Zulzamri salleh, "Ordinary Derential Equations (ode) using euler's technique and Seilab
1-6|804-106-7. programming", 1SBN; 978

JSDR

You might also like