0% found this document useful (0 votes)
109 views

N X y Dy/dx: Euler'S Method

1) The document presents the numerical solution of an ordinary differential equation using Euler's Method and Modified Euler's Method. 2) Euler's Method is used to solve the differential equation dy/dx=ylny/x with the initial condition y(2)=e, calculating y values at increments of h=0.1 from x=2 to x=3. 3) Modified Euler's Method is also used to solve the same differential equation, calculating updated y values at each step using the averaged slope.

Uploaded by

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

N X y Dy/dx: Euler'S Method

1) The document presents the numerical solution of an ordinary differential equation using Euler's Method and Modified Euler's Method. 2) Euler's Method is used to solve the differential equation dy/dx=ylny/x with the initial condition y(2)=e, calculating y values at increments of h=0.1 from x=2 to x=3. 3) Modified Euler's Method is also used to solve the same differential equation, calculating updated y values at each step using the averaged slope.

Uploaded by

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

CE50P-2/A1

RICAFRENTE, Janine Roanne B.

2017141623
CLASSWORK #1 (MODULE 3)
Activity No.: M3-CW
Activity Title: Numerical Solution of Ordinary Differential Equation

𝑑𝑦/𝑑𝑥=𝑦𝑙𝑛𝑦/𝑥 , 𝑦(2)=𝑒
EULER'S METHOD
n x y dy/dx
0 2.0 2.718281828459 1.359140914230 𝑑𝑦/(𝑦𝑙𝑛(𝑦))=𝑑𝑥/𝑥
1 2.1 2.854195919882 1.425453622564
2 2.2 2.996741282138 1.494999932350 ∫1▒𝑑𝑢/𝑢=∫1▒𝑑𝑥/𝑥
3 2.3 3.146241275373 1.567934119735
4 2.4 3.303034687347 1.644418087350
5 2.5 3.467476496082 1.724621690375 𝑙𝑛|𝑢|=𝑙𝑛|𝑥|+𝑐
6 2.6 3.639938665119 1.808723085835 𝑢=𝑘𝑥
7 2.7 3.820810973703 1.896909104456 ln (y) = kx
8 2.8 4.010501884148 1.989375644840 𝑦=𝑒^𝑘𝑥
9 2.9 4.209439448632 2.086328090032
𝑦=𝑒^(𝑘(2))
10 3.0 4.418072257636 2.187981746782
k=1/2
Actual Value = 4.4816890703381
Approxi. Value = 4.418072257636 𝑦=𝑒^(𝑥/2)
error% = 1.4194829606426 𝑎𝑐𝑡𝑢𝑎𝑙 𝑣𝑎𝑙𝑢𝑒=𝑦= 𝑒^(𝑥/2)= 𝑒^(3/2)= 4.48168907

𝑒𝑟𝑟𝑜𝑟%= |(𝑎𝑐𝑡𝑢𝑎𝑙−𝑎𝑝𝑝𝑟𝑜𝑥𝑖)/𝑎𝑐𝑡𝑢𝑎𝑙|𝑥 100= 1.41948


𝑑𝑦/𝑑𝑥=𝑦𝑙𝑛𝑦/𝑥 , 𝑦(2)=𝑒

ℎ= (3−2)/10=0.1
𝑓(2,𝑒)= (𝑒 ln⁡𝑒)/2=𝑒/2= 1.359140914230

𝑦(𝑥+ℎ)=𝑦(𝑥)+ℎ𝑓(𝑥,𝑦)
𝑦_1=𝑦(2.1)=𝑒+0.1(𝑒/2)= 2.854195919882

𝑑𝑦/𝑑𝑥=𝑓(2.1, 2.854195919882)= (2.854195919882 ln⁡〖 2.854195919882 〗 )/2.1= 1.425453622564

𝑦_2=𝑦(2.2)="2.854195919882 "+0.1(1.425453622564 )= 2.996741282138

𝑑𝑦/𝑑𝑥=𝑓(2.2, 2.996741282138)= ("2.996741282138" ln⁡〖 "2.996741282138" 〗 )/2.2= 1.494999932350

𝑦_3=𝑦(2.3)="2.996741282138 "+0.1(1.494999932350 )= 3.146241275373

𝑑𝑦/𝑑𝑥=𝑓(2.3, 3.146241275373)= (3.146241275373 ln⁡〖 3.146241275373 〗 )/2.3= 1.567934119735

𝑦_4=𝑦(2.4)="3.146241275373 "+0.1(1.567934119735)= 3.303034687347

𝑑𝑦/𝑑𝑥=𝑓(2.4, 3.303034687347)= (3.303034687347 ln⁡〖 "3.303034687347 " 〗 )/2.4= 1.644418087350

𝑦_5=𝑦(2.5)="3.303034687347"+0.1(1.644418087350)= 3.467476496082

𝑑𝑦/𝑑𝑥=𝑓(2.5, 3.467476496082)= (3.467476496082 ln⁡〖 "3.467476496082 " 〗 )/2.5= 1.724621690375

𝑦_6=𝑦(2.6)="3.467476496082"+0.1(1.724621690375)= 3.639938665119

𝑑𝑦/𝑑𝑥=𝑓(2.6, 3.639938665119)= ("3.639938665119" ln⁡〖 "3.639938665119 " 〗 )/2.6= 1.808723085835

𝑦_7=𝑦(2.7)="3.639938665119"+0.1(1.808723085835)= 3.820810973703

𝑑𝑦/𝑑𝑥=𝑓(2.7, "3.820810973703" )= ("3.820810973703" ln⁡〖 "3.820810973703 " 〗 )/2.7= 1.896909104456

𝑦_8=𝑦(2.8)="3.820810973703"+0.1(1.896909104456)= 4.010501884148
𝑑𝑦/𝑑𝑥=𝑓(2.8, "4.010501884148" )= ("4.010501884148" ln⁡〖 "4.010501884148 " 〗 )/2.8= 1.989375644840

𝑦_9=𝑦(2.9)="4.010501884148"+0.1(1.989375644840)= 4.209439448632

𝑑𝑦/𝑑𝑥=𝑓(2.9, "4.209439448632" )= ("4.209439448632" ln⁡〖 "4.209439448632 " 〗 )/2.9= 2.086328090032

𝑦_10=𝑦(3.0)="4.209439448632"+0.1(2.086328090032)= 4.418072257636

𝑑𝑦/𝑑𝑥=𝑓(3.0, "4.418072257636 " )= ("4.418072257636 " ln⁡〖 "4.418072257636 " 〗 )/3.0= 2.187981746782
5/1/2021

CE/2
MODULE 3)

rdinary Differential Equations


/2)= 𝑒^(3/2)= 4.4816890703381

𝑜𝑥𝑖)/𝑎𝑐𝑡𝑢𝑎𝑙|𝑥 100= 1.4194829606426

1.425453622564

/2.2= 1.494999932350

1.567934119735

2.4= 1.644418087350

2.5= 1.724621690375

2.6= 1.808723085835

2.7= 1.896909104456
2.8= 1.989375644840

= 2.086328090032

/3.0= 2.187981746782
CE50P-2/A1
RICAFRENTE, Janine Roanne B.

2017141623
CLASSWORK #2 (MODULE 3)
Activity No.: M3-CW
Activity Title: Numerical Solution of Ordinary Differential Equations

EULER'S METHOD
n x y dy/dx
0 2.0 2.718281828459 1.359140914230
1 2.1 2.854195919882 1.425453622564
2 2.2 2.996741282138 1.494999932350
3 2.3 3.146241275373 1.567934119735
4 2.4 3.303034687347 1.644418087350
5 2.5 3.467476496082 1.724621690375
6 2.6 3.639938665119 1.808723085835
7 2.7 3.820810973703 1.896909104456
8 2.8 4.010501884148 1.989375644840
9 2.9 4.209439448632 2.086328090032
10 3.0 4.418072257636 2.187981746782
Actual Value = 4.481689070338
Approxi. Value = 4.418072257636
error% = 1.419482960643

(dy/dx) is the same with Euler's Method)***

𝑓(2,𝑒)= (𝑒 ln⁡𝑒)/2=𝑒/2= 1.359140914230 𝑌_1= "2.718281828459

𝑌_2= "2.857511555299
𝑑𝑦/𝑑𝑥=𝑓(2.1, 2.854195919882)= (2.854195919882 ln⁡〖 2.854195919882 〗 )/2.1= 1.425453622564
𝑌_3= "3.003534233044

𝑑𝑦/𝑑𝑥=𝑓(2.2, 2.996741282138)= ("2.996741282138" ln⁡〖 "2.996741282138" 〗 )/2.2= 1.494999932350


𝑌_4= "3.156680935649

𝑌_5= "3.317298546003
𝑑𝑦/𝑑𝑥=𝑓(2.3, 3.146241275373)= (3.146241275373 ln⁡〖 3.146241275373 〗 )/2.3= 1.567934119735
𝑌_6= "3.485750534889

𝑌_7= "3.662417773700
𝑑𝑦/𝑑𝑥=𝑓(2.4, 3.303034687347)= (3.303034687347 ln⁡〖 "3.303034687347 " 〗 )/2.4= 1.644418087350

𝑌_8= "3.847699383214

𝑑𝑦/𝑑𝑥=𝑓(2.5, 3.467476496082)= (3.467476496082 ln⁡〖 "3.467476496082 " 〗 )/2.5= 1.724621690375


𝑌_9= "4.042013620679

𝑌_10= "4.24579880742
𝑑𝑦/𝑑𝑥=𝑓(2.6, 3.639938665119)= ("3.639938665119" ln⁡〖 "3.639938665119 " 〗 )/2.6= 1.808723085835

𝑑𝑦/𝑑𝑥=𝑓(2.7, "3.820810973703" )= ("3.820810973703" ln⁡〖 "3.820810973703 " 〗 )/2.7= 1.896909104456

𝑑𝑦/𝑑𝑥=𝑓(2.8, "4.010501884148" )= ("4.010501884148" ln⁡〖 "4.010501884148 " 〗 )/2.8= 1.989375644840

𝑑𝑦/𝑑𝑥=𝑓(2.9, "4.209439448632" )= ("4.209439448632" ln⁡〖 "4.209439448632 " 〗 )/2.9= 2.086328090032

𝑑𝑦/𝑑𝑥=𝑓(3.0, "4.418072257636 " )= ("4.418072257636 " ln⁡〖 "4.418072257636 " 〗 )/3.0= 2.187981746782
5/1/2021

CE/2
MODULE 3)

rdinary Differential Equations

MODIFIED EULER'S METHOD


n x y dy/dx
0 2.0 2.718281828459 1.359140914230 𝑑𝑦/(𝑦𝑙𝑛(𝑦))=𝑑
1 2.1 2.857511555299 1.425453622564
2 2.2 3.003534233044 1.494999932350 ∫1▒𝑑𝑢/𝑢=∫1▒
3 2.3 3.156680935649 1.567934119735
4 2.4 3.317298546003 1.644418087350
5 2.5 3.485750534889 1.724621690375
6 2.6 3.662417773700 1.808723085835
7 2.7 3.847699383214 1.896909104456
8 2.8 4.042013620679 1.989375644840
9 2.9 4.245798807423 2.086328090032
10 3.0 4.459514299263 2.187981746782
Actual Value = 4.481689070338
Approxi. Value = 4.459514299263
error% = 0.494786022118 𝑎𝑐𝑡𝑢𝑎𝑙 𝑣𝑎𝑙𝑢𝑒=𝑦= 𝑒^(𝑥/2

𝑒𝑟𝑟𝑜𝑟%= |(𝑎𝑐𝑡𝑢𝑎𝑙−𝑎𝑝𝑝𝑟𝑜𝑥

𝑌_1= "2.718281828459"+ 0.1/2("1.359140914230 + 1.425453622564) = 2.857511555299 "

𝑌_2= "2.857511555299"+ 0.1/2("1.425453622564 + 1.494999932350) = 3.003534233044 "

𝑌_3= "3.003534233044 "+ 0.1/2("1.494999932350 + 1.567934119735) = 3.156680935649 "

𝑌_4= "3.156680935649"+ 0.1/2("1.567934119735 + 1.644418087350) = 3.317298546003 "


999932350

𝑌_5= "3.317298546003 "+ 0.1/2("1.644418087350 + 1.724621690375) = 3.485750534889 "

𝑌_6= "3.485750534889"+ 0.1/2("1.724621690375 + 1.808723085835) = 3.662417773700 "

𝑌_7= "3.662417773700"+ 0.1/2("1.808723085835 + 1.896909104456) = 3.847699383214 "


18087350

𝑌_8= "3.847699383214"+ 0.1/2("1.896909104456 + 1.989375644840) = 4.042013620679 "

21690375
𝑌_9= "4.042013620679"+ 0.1/2("1.989375644840 + 2.086328090032) = 4.245798807423 "

𝑌_10= "4.245798807423"+ 0.1/2("2.086328090032+ 2.187981746782) = 4.459514299263 "


23085835

09104456

75644840

28090032

981746782
𝑑𝑦/𝑑𝑥=𝑦𝑙𝑛𝑦/𝑥 , 𝑦(2)=𝑒

𝑑𝑦/(𝑦𝑙𝑛(𝑦))=𝑑𝑥/𝑥

∫1▒𝑑𝑢/𝑢=∫1▒𝑑𝑥/𝑥

𝑙𝑛|𝑢|=𝑙𝑛|𝑥|+𝑐
𝑢=𝑘𝑥
ln (y) = kx
𝑦=𝑒^𝑘𝑥
𝑦=𝑒^(𝑘(2))
k=1/2
𝑦=𝑒^(𝑥/2)
𝑎𝑐𝑡𝑢𝑎𝑙 𝑣𝑎𝑙𝑢𝑒=𝑦= 𝑒^(𝑥/2)= 𝑒^(3/2)= 4.4816890703381

𝑟𝑟𝑜𝑟%= |(𝑎𝑐𝑡𝑢𝑎𝑙−𝑎𝑝𝑝𝑟𝑜𝑥𝑖)/𝑎𝑐𝑡𝑢𝑎𝑙|𝑥 100= 0.494786022118

ℎ= (3−2)/10=0.1

You might also like