You are on page 1of 12

NEM393 – ENGINEERING PROJECT II

PROJECT ASSIGNMENT #1

Tarık GÜN
21530181

Report Due: 30/10/2018

Hacettepe University

Nuclear Energy Engineering Department


1 – INTRODUCTION
In this assignment is wanted to solve this differential equations. It is had four choices.

dn ( t )  ( t )  
 n (t )   C (t )
dt 
dC ( t ) 
 n (t )   C (t )
dt 
Where,

   n(0)
-1
0.007 0.08 s 5x10-5 s 1000

𝛽n(0)
𝐶(0) =
Λ
a) First choice is wanted to solve the analytic solution for this differential equations using

Euler Preictor-Coreector method.

b) Second choice is wanted to solve above differential equations for n(t) and C(t) using

Euler Preictor-Coreector method. And it is wanted to plot n(t) and C(t) as a function of

time for ρ(t) = 0.02β.

 𝜌(𝑡) = 0.1𝛽[1 − 0.01𝑡], 0 < 𝑡 < 100 𝑠


0, 100𝑠 < 𝑡

c) Third choice is wanted to solve above differential equations for n(t) using prompt
jump approximation method . And it is wanted to plot n(t) as a function of time.

d) Forth choice is wanted to write a computer program to obtain n(t) and C(t) by using Euler

Preictor-Coreector method. And it is wanted to plot n(t) and C(t) as a function of time.

e) Forth choice is wanted to write a computer program to obtain n(t) and C(t) by using

Runge-Kutta method.. And it is wanted to plot n(t) and C(t) as a function of time.

2
2 – METHODS & CALCULATIONS
a) In this choice we will calculate this problem analyticlly. We can use this formulas to solve it.

𝑑 ( ) 𝜌−𝛽
= 𝑛(𝑡) + 𝜆 𝑐(𝑡)
𝑑𝑡 Λ

𝑑() 𝛽
= 𝑛(𝑡) − 𝜆 𝑐(𝑡)
𝑑𝑡 Λ

𝜌(𝑡) = 𝜌

𝑥(𝑡) = 𝛼 𝑢 𝑒 +𝛼 𝑢 𝑒

𝑛(𝑡) 𝜆
Λ
𝑥(𝑡) = , 𝐴=
𝑐(𝑡) −𝜆
Λ

𝐴𝑢 = 𝜔𝑢

𝐴𝑢 − 𝜔𝑢 = 0

𝑢 (𝑎 − 𝜔𝐼) = 0

det(𝐴 − 𝜔𝐼) = 0

𝜌−𝛽
−𝜔 𝜆
𝐴 − 𝜔𝐼 = Λ
𝛽
−𝜆 − 𝜔
Λ

𝜌−𝛽 𝛽
− 𝜔 (−𝜆 − 𝜔) − 𝜆 = 0
Λ Λ

−𝜌 𝜌−𝛽
𝜆 + 𝜆𝜔 + 𝜔 − 𝑤=0
Λ Λ

𝜌−𝛽 𝜌
𝜔 +𝜔 𝜆− − 𝜆=0
Λ Λ

𝜌 − 0.007 𝜌
Δ = 0.08 − +4 0.08
5 ∗ 10 5 ∗ 10

𝜌 − 0.014𝜌 + 4.9 ∗ 10
Δ = 6.4 𝑋 10 + + 6400𝜌
25 ∗ 10

Δ = (𝜌 − 0.007)

−𝑏 + √Δ
𝜔 = = −0.007 + 1.25 ∗ 10 𝜌
8 ∗ 10

−𝑏 − √Δ
𝜔 = = −0.007 − 1.25 ∗ 10 𝜌
8 ∗ 10

1
𝑈 𝛽 140
𝑈 = = =
𝑈 (0.073 + 1.25 ∗ 10 𝜌)
Λ(𝜆 + 𝜔 )

3
1
𝑈 𝛽 140
𝑈 = = =
𝑈 (0.073 − 1.25 ∗ 10 𝜌)
Λ(𝜆 + 𝜔 )

𝛼 +𝛼
𝑛(0) 140 140
=
𝑐(0) 𝛼 +𝛼
(0.073 + 1.25 ∗ 10 𝜌) (0.073 − 1.25 ∗ 10 𝜌)

175 ∗ 10 𝜌 − 922360
⎡ ⎤
⎢ 10.147 + 176.25 ∗ 10 𝜌 ⎥ ( . ( . ∗ ))
𝑥(𝑡) = ⎢ ⎥𝑒
175 ∗ 10 𝜌 − 922360 140
⎢ ∗ ⎥
⎣ 10.147 + 176.25 ∗ 10 𝜌 0.073 + 1.25 ∗ 10 𝜌 ⎦

. ∗
. . ∗
. ∗

. . ∗ . . ∗

b) In this choice we will calculate this problem with computer program using Euler

Predictor-Corrector method. We can use this formulas to solve it.


y = f(t, y), y(t ) = y

y = y + hf(t , y )

y =y + h(f(t , y ) + f(t ,y ))

c) In this choice we will calculate this problem with computer program using promp jump

aproximation method. We can use this formulas to solve it.

( )
= 𝑛(𝑡) + 𝜆 𝑐(𝑡)

( )
= 𝑛(𝑡) − 𝜆 𝑐(𝑡)

Λ→0

Λ =0

(𝜌 − 𝛽)𝑛(𝑡) + Λ𝜆𝑐(𝑡) = 0
( ) ( )
Λ𝑐(𝑡) =

( ) ( )
𝑛(𝑡) = 𝛽𝑛(𝑡) − 𝜆 𝑛(𝑡) = 𝜌𝑛(𝑡)

(𝛽 − 𝜌)𝑛(𝑡) = 𝑚

4
( )
= ( )
𝑑𝑡

( )
∫ log(𝑒 ) = ∫ ( )
𝑑𝑡

𝑚(𝑡) = 𝛽 − 𝜌(𝑡) ∗ 𝑚(𝑡)

( ) ( ) ( )
log ( ) ( )
=∫ ( )
𝑑𝑡′

( ) ( ) ( )
( ) ( )
= 𝑒𝑥𝑝 ∫ ( )
𝑑𝑡′

( )( ( )) ( )
𝑛(𝑡) = ( )
𝑒𝑥𝑝 ∫ ( )
𝑑𝑡′

( )( ( ))
𝑛(𝑡) = ( )
exp −𝑡 + 1000log

d) In this choice we will calculate this problem with computer program to obtain n(t) and

C(t) by using both mehods . We can use this formulas to solve it.

y = f(t, y), y(t ) = y

y = y + hf(t , y )

y =y + h(f(t , y ) + f(t ,y ))

e) In this choice we will calculate this problem with computer program to obtain n(t) and C(t)

by using both mehods . We can use this formulas to solve it.

ẏ = f(t, y), y(t0 ) = y0

y =y + (k + 2 k + 2k + k )

t =t + h

k = f(t , y )

k = f(t + ,y + k )

k = f(t + ,y + k )

k = f(t + h , y + k )

5
3 – RESULTS & DISCUSSION
a)
-----------------------------------

b)

Fig.1.The graphs of (b)

In this choice, our computer program was ploted n(t) and C(t) for ⍴ =0.02β. But we used Euler

Predictor-Corrector method. And than two figures are so different each other.

c)

Fig.2.The graphs of (c)

In this choice, our computer program was ploted n(t) .But we used promp jump aproximation

method.

6
d)

Fig.3.The graphs of (d1) ,

Fig.4.The graphs of (d2) ,

In this choice, our computer program was ploted n(t) and C(t) We used Euler Predictor-Corrector
method. We selected h=1/10.

e)

Fig.5.The graphs of (e1) ,

7
Fig.6.The graphs of (e2),

In this choice, our computer program was ploted n(t) and C(t). We used Runge-Kutta method. We
selected h=1/10.

4 – CONCLUSION
In this assignment it was required from us to solve this differential equation(which is the point kinetics
equation ) with different methods

Firstly, the equation had to be solved analytically . This method is a little bit hard and a long.

The second part wanted us to solve this equation with Euler Predictor-Corrector method. And we
wrote computer program codes to have the required values. We noticed that this method is easier than
analytic method .

At the Third part we had to use promp jump approximation method. We wrote computer program
codes again. And as the 2nd part , we noticed that this method is easier than analytic solution and it
looks like the other method.

At the end of the assignment we had to change rho’s values and plot n(t) and C(t). In this solutions we
changed h’s values (time difference) and all graphs were changed together. When n(t) increases with
time, C(t) decreases. So, n(t)’s and C(t)’s graphs are reverse to each other.

The last Method ; yields exact results in step reactivity insertions and the method has accuracy of
order H for problems with time-varying reactivities.

5 – APPENDIX

b)
clear all
close all
clc
a1=1000.3199;
a2=-0.3199;
u12=1749.44026439963;
u22=-0.0845195059965852;
w1=2.55961000448224e-05;
w2=-1656.50236486399;
t=0:0.1:10;
for i=1:101;

8
n(i)=(a1*exp(w1*t(i)))+(a2*exp(w2*t(i)));
c(i)=(a1*u12*exp(w1*t(i)))+(a2*u22*exp(w2*t(i)));
end
figure;
plot(t,n);
grid on;
xlabel('Time difference [ s ]');
ylabel('n(t) [ atoms/cm^3 ]');
figure;
plot(t,c);
grid on;
xlabel('Time difference [ s ]');
ylabel('c(t) [ atoms/cm^3 ]');

c)

1)
clear all
close all
clc
beta=0.007;
lamda=0.08;
kapa=(5*10^(-5));
n0=1000;
C0=(beta*n0)/(kapa*lamda);
t=0:1:100;
for i=1:101;
rho(i)=0.1*beta*(1-0.01*t(i));
n(i)= (n0*beta*exp(lamda*(-t(i)+1000*(log((900+t(i))/900))))/(beta-rho(i)));
end
figure;
plot(t,n);
grid on;
xlabel('Time difference [ s ]');
ylabel('n(t) [ atoms/cm^3 ]');

2)
clear all
close all
clc
beta=0.007;
lamda=0.08;
kapa=(5*10^(-5));
n0=1000;
C0=(beta*n0)/(kapa*lamda);
rho=0;
t=100:1:1000;
for i=1:901;
n(i)= (n0*exp(lamda*(-t(i)+1000*(log((900+t(i))/900)))));
end
figure;
plot(t,n);
grid on;
xlabel('Time difference [ s ]');
ylabel('n(t) [ atoms/cm^3 ]');

d)

1)
clear all
close all
clc
beta=0.007;

9
lamda=0.08;
kapa=(5*10^-5);
n(1)=1000; %n(1)=n(0)
rho(1)=0.1*beta;
C(1)=(beta*n(1))/(kapa*lamda);
h=1/10;
t=0:1:100;
for i=2:101;
rho(i)=0.1*beta*(1-0.01*t(i));
a(i)=(rho(i)-beta)/lamda;
b=(beta/lamda);
Delta(i)=((lamda-a(i))^2)+ (4*lamda*(a(i)+b));
x1(i)=(-(lamda-a(i))+(Delta(i)^(1/2)))/2;
x2(i)=(-(lamda-a(i))-(Delta(i)^(1/2)))/2;
A(i)=[(1000*b-C(1))*(x2(i)+lamda)]/(x1(i)-x2(i));
B(i)=C(1)-A(i);
C(i)=A(i)*exp(x1(i)*t(i))+ B(i)*exp(x2(i)*t(i));
n(i)= [(A(i)*x1(i)*exp(x1(i)*t(i))+B(i)*x2(i)*exp(x2(i)*t(i)))+ lamda*(A(i)*exp(x1(i)*t(i))+ B(i)*exp(x2(i)*t(i)))]/b;
end;
for i=1:100;
n(i+1)=n(i)+ (h/2)*[((rho(i)-beta)/lamda)*n(i)+ lamda*C(i)+((rho(i)-beta)/lamda)*n(i+1)+lamda*C(i+1)];
C(i+1)=C(i)+ (h/2)*[(beta/lamda)*n(i)-lamda*C(i)+(beta/lamda)*n(i+1)-lamda*C(i+1)];
end;
figure;
plot(t,n);
grid on;
xlabel('Time difference [ s ]');
ylabel('n(t) [ atoms/cm^3 ]');
figure;
plot(t,C);
grid on;
xlabel('Time difference [ s ]');
ylabel('C(t) [ atoms/cm^3 ]');

2)
clear all
close all
clc
beta=0.007;
lamda=0.08;
kapa=(5*10^-5);
rho=0;
n(1)=1000; %n(1)=n(0)
C(1)=(beta*n(1))/(kapa*lamda);
h=1/10;
t=100:1:1000;
for i=2:901;
a=(rho-beta)/lamda;
b=(beta/lamda);
Delta=((lamda-a)^2)+ (4*lamda*(a+b));
x1=(-(lamda-a)+(Delta^(1/2)))/2;
x2=(-(lamda-a)-(Delta^(1/2)))/2;
A=[(1000*b-C(1))*(x2+lamda)]/(x1-x2);
B=C(1)-A;
C(i)=A*exp(x1*t(i))+ B*exp(x2*t(i));
n(i)= [(A*x1*exp(x1*t(i))+B*x2*exp(x2*t(i)))+ lamda*(A*exp(x1*t(i))+ B*exp(x2*t(i)))]/b;
end;
for i=1:900;
n(i+1)=n(i)+ (h/2)*[((rho-beta)/lamda)*n(i)+ lamda*C(i)+((rho-beta)/lamda)*n(i+1)+lamda*C(i+1)];
C(i+1)=C(i)+ (h/2)*[(beta/lamda)*n(i)-lamda*C(i)+(beta/lamda)*n(i+1)-lamda*C(i+1)];
end;
figure;
plot(t,n);
grid on;
xlabel('Time difference [ s ]');
ylabel('n(t) [ atoms/cm^3 ]');

10
figure;
plot(t,C);
grid on;
xlabel('Time difference [ s ]');
ylabel('C(t) [ atoms/cm^3 ]');

e)
1)
clear all
close all
clc
beta=0.007;
lamda=0.08;
kapa=(5*10^(-5));
n(1)=1000; %n(1)=n(0)
C(1)=(beta*n(1))/(kapa*lamda);
rho(1)=0.1*beta;
h=1/10;
t=0:1:100;
for i=2:101;
rho(i)=0.1*beta*(1-0.01*t(i));
a(i)=(rho(i)-beta)/lamda;
b=(beta/lamda);
Delta(i)=((lamda-a(i))^2)+ (4*lamda*(a(i)+b));
x1(i)=(-(lamda-a(i))+(Delta(i)^(1/2)))/2;
x2(i)=(-(lamda-a(i))-(Delta(i)^(1/2)))/2;
A(i)=[(1000*b-C(1))*(x2(i)+lamda)]/(x1(i)-x2(i));
B(i)=C(1)-A(i);
C(i)=A(i)*exp(x1(i)*t(i))+ B(i)*exp(x2(i)*t(i));
n(i)= [(A(i)*x1(i)*exp(x1(i)*t(i))+B(i)*x2(i)*exp(x2(i)*t(i)))+ lamda*(A(i)*exp(x1(i)*t(i))+ B(i)*exp(x2(i)*t(i)))]/b;
end;
for i=1:100;
k1n(i)=((rho(i)-beta)/lamda)*n(i)+lamda*C(i);
k2n(i)=((rho(i)-beta)/lamda)*n(i)+h/2+lamda*C(i)+ (h/2)*k1n(i);
k3n(i)=((rho(i)-beta)/lamda)*n(i)+ h/2+lamda*C(i)+(h/2)*k2n(i);
k4n(i)=((rho(i)-beta)/lamda)*n(i)+ h+lamda*C(i)+ h*k3n(i);
k1C(i)=(beta/lamda)*n(i)-lamda*C(i);
k2C(i)=(beta/lamda)*n(i)-h/2-lamda*C(i)+(h/2)*k1C(i);
k3C(i)=(beta/lamda)*n(i)-h/2-k2C(i);
k4C(i)=(beta/lamda)*n(i)-h/2-lamda*C(i)+(h/2)*k3C(i);
n(i+1)=n(i)+(h/6)*(k1n(i)+2*k2n(i)+2*k3n(i)+k4n(i));
C(i+1)=C(i)+(h/6)*(k1C(i)+2*k2C(i)+2*k3n(i)+k4C(i));
end;
figure;
plot(t,n);
grid on;
xlabel('Time difference [ s ]');
ylabel('n(t) [ atoms/cm^3 ]');
figure;
plot(t,C);
grid on;
xlabel('Time difference [ s ]');
ylabel('C(t) [ atoms/cm^3 ]');

2)
clear all
close all
clc
beta=0.007;
lamda=0.08;
kapa=(5*10^(-5));

11
n(1)=1000; %n(1)=n(0)
C(1)=(beta*n(1))/(kapa*lamda);
rho=0;
a=(rho-beta)/lamda;
b=(beta/lamda);
Delta=((lamda-a)^2)+ (4*lamda*(a+b));
x1=(-(lamda-a)+(Delta^(1/2)))/2;
x2=(-(lamda-a)-(Delta^(1/2)))/2;
A=[85*b-C(1)*(x2+lamda)]/(x1-x2);
B=C(1)-A;
h=1/10;
t=100:1:1000;
for i=2:901;
a=(rho-beta)/lamda;
b=(beta/lamda);
Delta=((lamda-a)^2)+ (4*lamda*(a+b));
x1=(-(lamda-a)+(Delta^(1/2)))/2;
x2=(-(lamda-a)-(Delta^(1/2)))/2;
A=[(1000*b-C(1))*(x2+lamda)]/(x1-x2);
B=C(1)-A;
C(i)=A*exp(x1*t(i))+ B*exp(x2*t(i));
n(i)= [(A*x1*exp(x1*t(i))+B*x2*exp(x2*t(i)))+ lamda*(A*exp(x1*t(i))+ B*exp(x2*t(i)))]/b;

end;
for i=1:900;
k1n=((rho-beta)/lamda)*n(i)+lamda*C(i);
k2n=((rho-beta)/lamda)*n(i)+h/2+lamda*C(i)+ (h/2)*k1n;
k3n=((rho-beta)/lamda)*n(i)+ h/2+lamda*C(i)+(h/2)*k2n;
k4n=((rho-beta)/lamda)*n(i)+ h+lamda*C(i)+ h*k3n;
k1C=(beta/lamda)*n(i)-lamda*C(i);
k2C=(beta/lamda)*n(i)-h/2-lamda*C(i)+(h/2)*k1C;
k3C=(beta/lamda)*n(i)-h/2-k2C;
k4C=(beta/lamda)*n(i)-h/2-lamda*C(i)+(h/2)*k3C;
n(i+1)=n(i)+(h/6)*(k1n+2*k2n+2*k3n+k4n);
C(i+1)=C(i)+(h/6)*(k1C+2*k2C+2*k3n+k4C);
end;
figure;
plot(t,n);
grid on;
xlabel('Time difference [ s ]');
ylabel('n(t) [ atoms/cm^3 ]');
figure;
plot(t,C);
grid on;
xlabel('Time difference [ s ]');
ylabel('C(t) [ atoms/cm^3 ]');

6 – REFERENCES
S.L. Ross, Differential Equations Third Edition, Wiley, 2004.

E. Kreyszig, Advanced Engineering Mathematics Nineth Edition, Wiley, 2006.

http://www.nuke.hacettepe.edu.tr/tr/webfiles/Courses/NEM393_2018/HWS/HW1/HW1.pdf

12

You might also like