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?
(*constants*)
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];
(*ranges*)
rmin = 0.00003;
rmax = 0.01;
tmin = 0.0;
tmax = 0.02;
(*equations*)
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!
rminboundary condition and how is it related totempw[t]? – bbgodfrey May 08 '17 at 22:35rminboundary condition fortempc[r,t]comes from solvingeqn2fortempc[rmin,t]. That is how the ODE should be coupled into the rmin boundary condition of the PDE. – Rischaard May 09 '17 at 13:13tempw[t]determined?eqn2cannot be used to determine both. – bbgodfrey May 09 '17 at 13:42tempw[t]andtempc[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. – Rischaard May 09 '17 at 14:46tempc[rmin, t] == tempw[t]? I ask this, because this equation is not included in your question, and it (or something similar) is necessary in order to provide a boundary condition fortempcatrmin. With such a boundary condition, the system of equations can be solved as described here, with the equation fortempc[rmin, t]replace by the equation fortempw[t]. – bbgodfrey May 09 '17 at 17:18tempc[rmin, t] == tempw[t] - (c2 / c3)(c1-D[tempw[t], t] / c4). With the finite difference scheme I mentioned previously,tempw[t]is calculated using values from the previous time step and it is then straight forward to approximateD[tempw[t], t]from(tempw[tcurrent] - tempw[tprevious])/dt. – Rischaard May 09 '17 at 19:46eqn2is used to specifytempc[rmin, t], then a different equation must be provided to specify howtempw[t]evolves in time. – bbgodfrey May 09 '17 at 20:27