Message Boards Message Boards

Non-numerical derivative message in NDSolve

I'm trying to solve a system of partial differential equations with initial value:

v2 = 2.2; L = 4; sol = 
 NDSolve[{D[f[t, x], t] + I v[t, x]  f[t, x] == 
     D[f[t, x], {x, 2}] + f[t, x] (1 - f[t, x] Conjugate[f[t, x]]), 
    0.01 D[v[t, x], t] == 
     D[v[t, x], {x, 2}] - 
      0.5 I (f[t, x] Conjugate[D[f[t, x], {x, 2}]] - 
         D[f[t, x], {x, 2}] Conjugate[f[t, x]]), 
    f[0, x] == 0.01 E^(0.5 v2 I  4400) x/L , 
    f[t, -L] == 0.01 E^(-0.5 v2 I (t + 4400)), 
    f[t, L] == 0.01 E^(0.5 v2 I (t + 4400)), v[t, -L] == v2/2, 
    v[t, L] == -v2/2, v[0, x] == -0.5 v2 x/L}, {f, v}, {x, -L, L}, {t,
     0, 4}][[1]]

I get an error message "Encountered non-numerical value for a derivative at t == 0.`." If I change the initial value of f to a function that is inconsistent with the boundary conditions (such as f[0,x]==0 or f[0,x]==I), then I get a warning message, but NDSolve does run.

POSTED BY: Jorge Berger

Another twist to the same problem: for the PDE

v2 = 0.0005 t; L = 6; sol = 
 NDSolve[{D[f[t, x], t] + I v[t, x]  f[t, x] == 
     D[f[t, x], {x, 2}] + f[t, x] (1 - f[t, x] Conjugate[f[t, x]]), 
     D[v[t, x], t] == 
     D[v[t, x], {x, 2}] - 
      0.5 I (f[t, x] Conjugate[D[f[t, x], {x, 2}]] - 
         D[f[t, x], {x, 2}] Conjugate[f[t, x]]), f[0, x] == 1, 
    f[t, -L] == E^(-0.5 v2 I t), f[t, L] == E^(0.5 v2 I t), 
    v[t, -L] == v2/2, v[t, L] == -v2/2, v[0, x] == 0}, {f, v}, {x, -L,
     L}, {t, 0, 5}][[1]]

Mathematica claims that there are non-numeric derivatives. However, if I rescale x, so that L becomes a power of 2, e.g., xp=(4/3)x,

v2 = 0.0005 t; L = 8; sol = 
 NDSolve[{D[f[t, xp], t] + 
      I v[t, xp]  f[t, xp] == (16/9) D[f[t, xp], {xp, 2}] + 
      f[t, xp] (1 - f[t, xp] Conjugate[f[t, xp]]), 
    D[v[t, xp], t] == (16/9) D[v[t, xp], {xp, 2}] - 
      0.5 I (f[t, 
           xp] Conjugate[(16/9) D[f[t, xp], {xp, 2}]] - (16/9) D[
           f[t, xp], {xp, 2}] Conjugate[f[t, xp]]), f[0, xp] == 1, 
    f[t, -L] == E^(-0.5 v2 I t), f[t, L] == E^(0.5 v2 I t), 
    v[t, -L] == v2/2, v[t, L] == -v2/2, v[0, xp] == 0}, {f, 
    v}, {xp, -L, L}, {t, 0, 5}][[1]]

then Mathematica runs.

POSTED BY: Jorge Berger
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract