# NDSolve 2 functions 2 variables with intermediate calculation : (1 time-space eq) + (1 space eq)

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 ?

• 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} – Xminer Jul 11 '19 at 12:33
• Corrected thx, that was really stupid. But there are still errors – J.A Jul 11 '19 at 12:42
• ok! let's wait a little :). Someone will answer if the problem is NDSolve itself. – Xminer Jul 11 '19 at 13:10
• I thought it would be possible to solve by method of lines but it was useless ... Good Luck! – Xminer Jul 11 '19 at 16:44
• I have solved a similar set of coupled pdes via method of lines, should be possible to do. – KraZug Jul 14 '19 at 5:07