The problem is to solve the following equation
∂c∂t=D∂2c∂x2−Vmax,cellρcellFor a steady state solution, we can neglect the left hand side term, so the equation will be
D∂2c∂x2−Vmax,cellρcell=0We want to know the maximum depth of oxygen penetration.
It is a 1-D problem, so let's say c=c(x) and rewrite the equation as
Dd2cdx2=Vmρ→d2cdx2=VmρDIntegrating both sides of the equation yields:
∫d2cdx2dx=∫VmρDdx→dcdx=VmρDx+C1We can simply use the second boundary condition to get the value of C1. We know dcdx=0 at x=d, so:
0=VmρDd+C1→C1=−VmρdDWe still have a derivative term in the equation, so we integrate it again to eliminate that term:
∫dcdxdx=∫(VmρDx+C1)dx→c(x)=VmρDx22+C1x+C2We already know the value of C1, and by using the first boundary condition, we can obtain the value of C2 as well. According to the first boundary condition, c(x)=c0 at x=0, so:
C2=c0Now, by knowing the value of C1 and C2 and having no remained derivitive in the equation, we can write the equation of the change of concentration of oxygen throughout the construct:
c(x)=VmρDx22−VmρdDx+c0→c(x)=VmρD(x22−xd)+c0It's the time to calculate the maximum depth of diffusion. It can be simply calculated by finding the value of x at which the concentration of oxygen is zero. Let's denote it by dmax (we can say the value of d equals dmax as well), and solve the derived equation:
x=dmax,c(x)=0→0=VmρD(dmax22−dmax2)+c0→dmax=√2c0DVmρfrom sympy import init_session
init_session(quiet=True)
x, D, V, rho = symbols("x, D, V_m, rho", positive=True)
c = Function("c")
ode = D * c(x).diff(x, 2) - V * rho
Eq(ode, 0)
ode_sol = dsolve(ode)
ode_sol
c0, d = symbols("c_0, d", positive=True)
ics = {c(0): c0, c(x).diff(x).subs(x, d): 0}
parameters = ode_sol.free_symbols - set([D, V, rho, x])
eq1 = (ode_sol.lhs - ode_sol.rhs).subs(x, 0).subs(ics)
eq2 = (ode_sol.lhs - ode_sol.rhs).diff(x).subs(x, d).subs(ics)
eqs = [eq1, eq2]
[Eq(eq1, 0), Eq(eq2, 0)]
sol_params = solve(eqs, parameters)
sol_params
cx_sol = ode_sol.subs(sol_params)
cx_sol
d_max = symbols("d_max", positive=True)
d_eq = cx_sol.subs(c(x), 0).subs(x, d_max).subs(d, d_max)
d_eq
ans = solve(d_eq, d_max)[0]
Eq(d_max, ans)