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.