7
$\begingroup$

I'm trying to solve a system of coupled PDEs as described below. The written code works when executed in Mathematica 10.4.

However, as I change the exponent of the dependent variable u[t,x] in the 2nd pde (the aim is nexp=0.6), no solution is reached. Do you have an idea as to how I have to change the code?

Thanks already,

horst

nexp = 1;(*[-] exponent for u[t,x] in 2nd pde*)

(* Dimensionless Parameters*)
Pem = 1000;
beta1 = 160000;
beta2 = 0.005;
beta3 = 0.7;

(*Integration Parameters*)
tMax = 300000; (*[-] Int. time.*)

(*Solve PDE*)
pde = {D[u[t, x], t] + D[u[t, x], x] - (1/Pem)*D[u[t, x], x, x] + beta1*D[v[t, x], t] == 0,
   D[v[t, x], t] == beta2*(beta3*u[t, x]^nexp - v[t, x])};

bc = {u[0, x] == Exp[-10^3*x],
   u[t, 0] == 1, (*Derivative[0,1][u][t,0]==Pem*(u[t,0]-1),*)
   Derivative[0, 1][u][t, 1] == 0,
   v[0, x] == 0};

sol = NDSolve[{pde, bc}, {u, v}, {t, 0, tMax}, {x, 0, 1},
   Method -> {"PDEDiscretization" -> {"MethodOfLines",     "SpatialDiscretization" -> {"TensorProductGrid", "MinPoints" -> 10}}}];

(*Plotting/Exporting*)
Plot3D[Evaluate[{u[t, x]} /. sol], {x, 0, 1}, {t, 0, tMax}]
Plot[Evaluate[u[t, x] /. sol /. x -> 1], {t, 0, tMax}, PlotRange -> All]
$\endgroup$
4
$\begingroup$

Seems to be a stiff non-linear problem. NDSolve is actually time integration this though very slowly. Setting the time integration to use "StiffnessSwitching" helps a bit:

 Monitor[
 sol = NDSolve[{pde, bc}, {u, v}, {t, 0, tMax}, {x, 0, 1}, 
   Method -> {"PDEDiscretization" -> {"MethodOfLines", 
       "SpatialDiscretization" -> {"TensorProductGrid", 
         "MinPoints" -> 10}},
     "TimeIntegration" -> "StiffnessSwitching"
     }, EvaluationMonitor :> (monitor = 
      Row[{"t = ", CForm[t]}])], monitor]
$\endgroup$
  • $\begingroup$ Thank you for the hint. Is there an other way for speed-up (e.g. using an other method rather than MOL)? $\endgroup$ – Horst Sep 7 '16 at 14:58
  • $\begingroup$ I do not think you will get around the MOL, try playing with the time integration and see if you can find a better suited one., Try also to set the "MaxPoints" to 10 and see if it solves it without complaints. $\endgroup$ – user21 Sep 7 '16 at 15:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.