In [14]:
%pylab inline
In [20]:
D = linspace(0,20)
late = 3
early = 10
base = 0.02
fig1 = figure(1, dpi=600)
ax1 = fig1.add_subplot(1,1,1)
ax1.set_yscale('log')
plot(D,exp(-base*late*D - base*D**2), label="Late responding tissue")
shift = 0.63
plot(D,exp(-base*shift*early*D - base*shift*D**2), label="Early responding tissue")
legend(loc="lower left")
title("No Fractionation")
xlabel("Radiation dose (Gy)")
ylabel("Surviving franction")
ylim([0.001, 1])
Out[20]:
In [16]:
twoGy = exp(-base*late*2 - base*2**2)
pLate = zeros(len(D))
for i in range(len(D)):
numFrac, thisFrac = divmod(D[i],2)
currEffect = twoGy**numFrac * exp(-base*late*thisFrac - base*thisFrac**2)
pLate[i] = currEffect
twoGy = exp(-base*shift*early*2 - base*shift*2**2)
pEarly = zeros(len(D))
for i in range(len(D)):
numFrac, thisFrac = divmod(D[i],2)
currEffect = twoGy**numFrac * exp(-base*shift*early*thisFrac - base*shift*thisFrac**2)
pEarly[i] = currEffect
In [19]:
fig2 = figure(2, dpi=600)
ax2 = fig2.add_subplot(1,1,1)
ax2.set_yscale('log')
plot(D,pLate, label="Late responding tissue")
plot(D,pEarly, label="Early responding tissue")
legend(loc="lower left")
title("With Fractionation")
xlabel("Radiation dose (Gy)")
ylabel("Surviving franction")
ylim([0.001, 1])
Out[19]:
In [18]:
show()