Professional Documents
Culture Documents
18113038
TERM PROJECT
Numerical Methods
Term Project
Piyush Pastor
Roll No. 18113038
Semester: 5th
B.Tech
Chemical Engineering
Problem Statement
Parabolic equation
Find the temperature as a function of time for a steel plate that is 2 cm. Assume heat flow is at
only one direction. For steel, k= 0.13 cal/(s.cm. oC, specific heat cp= 0.11 cal/g.oC and density
ρ=7.8 g/cm3 . Consider only one dimensional flow of heat. Initially the temperature at x=0 and
x=2 cm are given by relation
α c p ρΔx 2
Take Δx=0.33, α =0.5 and 1. The value of Δt =
k
Solution.
Given, the boundary conditions, at x=0and at x =2, are u=0 ℃ for all values of time.
Δx=0.333
100 x , 0 ≤∧x ≤ 1
T ( x )= {200−100 x ,1 ≤∧x ≤ 0
Now, the value for Δt depends on the value we take for α and is given by the relation
α c p ρΔx 2
Δt =
k
g
where, density , ρ=7.8
cm3
step¿ ∆ x =0.333 cm
Page |3
uij+1=0.5∗( u i+1
j j
+ui−1 )
The values of u at the internal mesh points are found by using above formula and with the help
i→
t↓ 0 1 2 3 4 5 6
j↓
0 0 0 33.3 66.6 100 66.6 33.3 0
0.36 1 0 33.3 66.6 66.6 66.6 33.3 0
0.72 2 0 33.3 50 66.6 50 33.3 0
1.08 3 0 25 50 49.9 50 25 0
1.46 4 0 25 37.51 49.9 37.5 25 0
1.83 5 0 18.75 37.5 37.5 37.5 18.75 0
we have,
The values of u at the internal mesh points are found by using above formula and with the help
of boundary conditions.
#include <iostream>
#include <iomanip>
int main()
Page |5
for (i=0;i<1;i++)
{for (j=0;j<=6;j++)
{u[i][j]=j*0.3333;
for (i=1;i<2;i++)
{for (j=0;j<=3;j++)
{u[i][j]=100*u[i-1][j];
for (j=4;j<=6;j++)
{u[i][j]=200-100*u[i-1][j];
cin>>alpha;
cin>>tend;
Page |6
cout<<"Enter u(0,t)"<<endl;
cin>>uint;
cout<<"Enter u(2,t)"<<endl;
cin>>uend;
for(i=1;i<=tend+2;i++)
{for(j=0;j<1;j++)
{u[i][j]=uint;
for(i=1;i<=tend+2;i++)
{for(j=6;j<7;j++)
{u[i][j]=uend;
for(i=2;i<=tend+2;i++)
{for(j=1;j<6;j++)
for(i=0;i<=tend+2;i++)
Page |7
{for(j=0;j<7;j++){
cout<<setw(10)<<setprecision(5)<<u[i][j];
cout<<endl;
return 0;