1
$\begingroup$

I have a system of differential equation with this structure :

$$\left\{\begin{split}&\partial_t n(t,r) + \nabla. \big(n(t,r)v(t,r)\big)=0 \\ & f\Big(n(t,r),v(t,r),\partial_r n(t,r),\partial_r v(t,r)\Big)=0\\ & n(0,r)=g(r)\\ \end{split}\right.$$ $$ $$

I'm writing it with NDSolve as follows :

R = 8
eta = 1
alpha = -1
nc = 2
K = 1
eps = 10^(-5)

sol =
 NDSolve[{D[n[t, r], t] + 1/r^2*D[r^2*v[t, r]*n[t, r], r] == 0, 
   n[eps, r] == (1 - Tanh[r - R])/2, 
   1/r^2*D[r^2*(4*eta/3*(D[v[t, r], r] - v[t, r]/r) + 
          2/3*alpha (n[t, r] - nc)), 
       r] + (4*eta/3*(D[v[t, r], r] - v[t, r]/r) + 
       2/3*alpha (n[t, r] - nc))/r == K/n[t, r]*D[n[t, r], r]}, {v[t, r], n[t, r]}, {t, eps, 10}, {r, eps, 10}]; 

But I get the errors :

CoefficientArrays::poly: -(2/3) (-2+n)-n$3018/n+4/3 (-(v/r)+v$3019)+(2 r (-(2/3) (-2+n)+4/3 (Times[<<3>>]+v$3019))+r^2 (-((2 n$3018)/3)+4/3 (Times[<<2>>]+Times[<<3>>]+v$3021)))/r^2 is not a polynomial.

NDSolve::femper: PDE parsing error of {n$3020+(2 n r v+n$3018 r^2 v+n r^2 v$3019)/r^2,-(2/3) (-2+n)-n$3018/n+4/3 (-(v/r)+v$3019)+(2 r (-(2/3) (-2+n)+4/3 (Times[<<3>>]+v$3019))+r^2 (-((2 n$3018)/3)+4/3 (Times[<<2>>]+Times[<<3>>]+v$3021)))/r^2}. Inconsistent equation dimensions.

Could you help me please ?

$\endgroup$
  • $\begingroup$ you need to give start and end point of variables in NDSolve.like,{v[t, r], n[t, r]}, {t,t_start,t_end},{r,r_start,r_end} $\endgroup$ – Xminer Jul 11 at 12:33
  • $\begingroup$ Corrected thx, that was really stupid. But there are still errors $\endgroup$ – J.A Jul 11 at 12:42
  • 1
    $\begingroup$ ok! let's wait a little :). Someone will answer if the problem is NDSolve itself. $\endgroup$ – Xminer Jul 11 at 13:10
  • 1
    $\begingroup$ I thought it would be possible to solve by method of lines but it was useless ... Good Luck! $\endgroup$ – Xminer Jul 11 at 16:44
  • 1
    $\begingroup$ I have solved a similar set of coupled pdes via method of lines, should be possible to do. $\endgroup$ – KraZug Jul 14 at 5:07

Your Answer

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

Browse other questions tagged or ask your own question.