I would like to solve a partial differential equation where one of the boundary conditions is the solution of an ordinary differential equation that is coupled to the partial differential equation. From two related questions (question#1 and question#2), it is not clear if this is possible using NDSolve.

While the code below does not work, it best illustrates what I would like to do and is similar to what is found in question#1. I have tried to modify the code similar to what was done in question#2, but none of the changes I have tried seemed to work.

Does anyone know how I can solve this problem with Mathematica?

initialvalue = 300.;
outervalue = 300.;
c1 = 11.025;(*RI^2*)
c2 = 1.*10^-7;(*contact resistance*)
c3 = 4.7*10^-7;(*contact area*)
c4 = 0.0000258;(*massWire*heatCapacityWire*)
d1 = 0.0000113;(*zpp Diffusivity*)
d2 = 4600.;(*zppDensity*)
d3 = 250.;(*zppCp*)

(*source term*)
source[temp_] := 9.37*10^25*Exp[-29226./temp];

rmin = 0.00003;
rmax = 0.01;
tmin = 0.0;
tmax = 0.02;

eqn1 = D[tempc[r, t], t] == d1 (D[tempc[r, t], {r, 2}] + (1/r) D[tempc[r, t], r]) + source[tempc[r, t]]/d2/d3;

eqn2 = D[tempw[t], t] == c4*(c1 - c3 (tempw[t] - tempc[rmin, t])/c2);

(*boundary conditions*)
bcOuter = tempc[rmax, t] == outervalue;

(*initial conditions*)
icw = tempw[0.] == initialvalue;
icc = tempc[r, 0.] == initialvalue;

(*solve system*)
sol1 = NDSolve[{eqn1, eqn2, bcOuter, icw, icc}, {tempc, tempw}, {r, rmin, rmax}, {t, tmin, tmax}, Compiled -> True]

I appreciate any suggestions or tips you can provide!

  • 1
    $\begingroup$ What is the rmin boundary condition and how is it related to tempw[t]? $\endgroup$
    – bbgodfrey
    Commented May 8, 2017 at 22:35
  • $\begingroup$ The rmin boundary condition for tempc[r,t] comes from solving eqn2 for tempc[rmin,t]. That is how the ODE should be coupled into the rmin boundary condition of the PDE. $\endgroup$
    – Rischaard
    Commented May 9, 2017 at 13:13
  • $\begingroup$ Then, how is tempw[t] determined? eqn2 cannot be used to determine both. $\endgroup$
    – bbgodfrey
    Commented May 9, 2017 at 13:42
  • $\begingroup$ The two unknowns that I have are tempw[t] and tempc[r,t]. I have two equations coupling the two unknowns so the problem is soluble. It really is no different than a solving a system of coupled PDEs (or ODEs) using NDSolve, it's just this time it is a PDE coupled to an ODE. Also, I have solved it already explicitly using a forward-time central-space (FTCS) finite difference method. The problem is this FTCS method is slow in Mathematica and I would like to speed it up using NDSolve, if possible. $\endgroup$
    – Rischaard
    Commented May 9, 2017 at 14:46
  • 1
    $\begingroup$ No. As I stated in an earlier comment, if eqn2 is used to specify tempc[rmin, t], then a different equation must be provided to specify how tempw[t] evolves in time. $\endgroup$
    – bbgodfrey
    Commented May 9, 2017 at 20:27


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.