# PDE combined with ODE 1D

I try to solve the following system of PDE coupled with ODE: $$\theta_t - a\theta_{xx} + b\kappa_a(\theta^4-\varphi)=0,$$ $$-\alpha\varphi_{xx} + \kappa_a(\varphi - \theta^4) = 0,$$ $$-a\theta_x + \beta\theta|_{x=0} = 0,\;\;a\theta_x + \beta\theta|_{x=L} = 0$$ $$-\alpha\varphi_x + \gamma\varphi|_{x=0} = 0,\;\;\alpha\varphi_x + \gamma\varphi|_{x=L} = 0$$ $$\theta|_{t=0} = \theta_0, \;\;\varphi_{t=0} = \varphi_0$$ for functions $\theta, \varphi$.

I use the following code ($\zeta = \theta - \theta_s$, $\xi = \varphi - \varphi_s$ where $\theta_s, \varphi_s$ is the solution of the stationary problem):

s = NDSolve[{D[zeta[t, x], t] - a*D[zeta[t, x], x, x] +
b*kappaa*(((thetas[x] + zeta[t, x])^4 - thetas[x]^4) -
xi[t, x]) == 0,
-alpha*D[xi[t, x], x, x] +
kappaa*(xi[t, x] - ((thetas[x] + zeta[t, x])^4 - thetas[x]^4)) ==
0,
zeta[0, x] == zeta0[x], xi[0, x] == xi00[x],
-a*Derivative[0, 1][zeta][t, 0] + beta*zeta[t, 0] == 0,
a*Derivative[0, 1][zeta][t, ll] + beta*zeta[t, ll] == 0,
-alpha*Derivative[0, 1][xi][t, 0] + gamma*xi[t, 0] == 0,
alpha*Derivative[0, 1][xi][t, ll] + gamma*xi[t, ll] == 0},
{zeta, xi}, {x, 0, ll}, {t, 0, tt}]


The initial condition for $\theta$ is prescribed, the initial condition for $\varphi$ was computed.

Wolfram Mathematica doesn't solve this system.

How can I solve it?

• NDSolve (up to version 9) uses the method of lines exclusively to solve PDEs and AFAIK can't automatically solve coupled equations of PDE and ODEs. What you can do is to apply the method of lines yourself and then combine the resulting set of ODEs for the PDE with the single ODE to one system which then can be solved to NDSolve. I think there are examples of manual application of the method of lines in the advanced documentation of NDSolve as well as on this site... – Albert Retey May 18 '14 at 10:12
• @AlbertRetey Thank you for your reply. I have found such example but in this example the initial conditions don't depend on $x$ and I don't know how to modify this example. Here is my another question: mathematica.stackexchange.com/questions/48034/… – jokersobak May 18 '14 at 11:19
• After applying the method of line there will be one ODE per discretization point and extra initial conditions for each discretization point. You would just have to insert the corresponding x into each of them. Or do I miss something? Unfortunately I don't have the time to elaborate, but if it is just for inserting an x dependent initial condition, that might make a good extra question (if you provide a otherwise working example)... – Albert Retey May 18 '14 at 11:34
• @AlbertRetey I mean using NDSolve with some modification as in the example on the page reference.wolfram.com/mathematica/tutorial/NDSolveDAE.html (subsection "Combined Elliptic-Parabolic PDE in 1D"). – jokersobak May 18 '14 at 11:45
• The 2nd equation indicates $\varphi$ is also a function of $x$ and $t$, so this is not a system of PDE coupled with ODE. Still, this system is troublesome to solve, because the 2nd PDE doesn't involve pure derivative respect to $t$. I've solved similar problem here, here and here, and I'll try solving this one if I have time. – xzczd Dec 26 '18 at 7:27