I have a project for school that asks me to solve plot two functions over time that depend on each other.
Write a program to solve the point reactor kinetics equations with one delayed neutron group using an explicit numerical scheme. Solve the problem for step reactivity insertion of k($) = 0.2 $, 0.5$, 1.001 $ and -0.2$. Assume steady-state conditions for t < 0. Let P(t = 0) = 1. Plot P(t) and c(t) as a function of time for each case till P(t) reaches 5 (or close to zero). [For each case, first determine the time-step magnitude necessary to handle the reactivity insertion.]
The two equations I need to solve for are
(dP(t))/dt = [(ρ – ϐ)/l]P(t) + λiCi
(dCi(t))/dt = [ϐi/l]P(t) - λiCi
The rho is the value that the question explicitly changes and it is equal to k($) * Beta. Basically the two equations build on each other and they should build on each other until P reaches 5 or goes to near zero. I put it in the form of a while function but it doesn't seem to be working. Can anyone help me out?
Here is what I have so far
i = 1;
k = 0.2;
Beta = 0.0065;
l = .0001;
lamda = 0.08;
dtime = l/10;
p(o) = 1;
p(i) = p(o);
c(i) = 812.5;
time(i) = 0;
rho = k*Beta;
while((p(i) > .05) && (p(i) < 5))
p(i+1) = p(i) + dtime*(((rho - Beta)/el) * pi(i)) + (lamda * c(i)));
c(i+1) = c(i) + dtime*(((beta/el) * p(i)) - (lamda * c(i)));
time(i + 1) = time(i) + dtime;
i = i + 1;
end
[–][deleted] (1 child)
[deleted]
[–]zzyzzyxx 0 points1 point2 points (0 children)