I'm working on numerically solving the fractional nonlinear Schrödinger equation (here of order $\alpha$):
$$\frac{1}{2}u-\frac{1}{2}\frac{\partial^{\alpha}}{\partial x^{\alpha}}u-u^3=0.$$
The paper I read uses shifted Chebyshev polynomials to construct a series solution to any fractional nonlinear differential equation [1]. They are shifted from their regular domain $[-1,1]$ to $[0,1]$. Essentially what we solve for are the coefficients in front of each shifted Chebyshev polynomial, here array c
, with 7 total coefficients. I think I have the code set up right, but NSolve
has run for about thirty minutes now and is still working. I'm afraid that it's not going to find the coefficients because of the nonlinearity. Is there anything I can do to improve the performance or ensure the coefficients are found? So far no errors. Perhaps there is a different way of solving for them.
ClearAll["Global`*"]
γ0 = 0; (* u(0) = 0 *)
β0 = 0.8; (* u'(0) = 0.8 *)
α = 18/15;
m = 6; (* number of terms in approximation series-1 *)
Array[c, m + 1]; (* array of coefficients *)
ts[n_, x_] := ChebyshevT[n, 2 x - 1]; (* Defines Shifted Chebyshev Polynoms *)
pts = N[Solve[{ts[5, x] == 0}, x]]
collocation = Table[pts[[i, 1, 2]], {i, 1, Length[pts]}] (* collocation points *)
s[x_] := Sum[c[n] ts[n - 1, x], {n, 1, m + 1}]; (* series approximation *)
b[n_, r_, α_] := (-1)^r 2^(2 n - 2 r) n (Factorial[2 n - r - 1] Factorial[n - r])/
(Factorial[r] Factorial[2 n - 2 r] Gamma[n - r + 1.0 - α]);
eqn1 = Sum[(-1)^(n - 1) c[n], {n, 1, m + 1}] == γ0; (*u(0) initial condition*)
eqn2 = 2 Sum[(-1)^n (n - 1)^2 c[n], {n, 1, m + 1}] == β0; (*u'(0) initial condition*)
eqn[x_] := Sum[Sum[c[n + 1] b[n, r, α] x^(n - r - α), {r, 0, n - 2}], {n, 2, m}] ==
s[x] - 2 (s[x])^3 (* fractional nonlinear Schroedinger *)
eqnlist = Table[eqn[x] /. x -> collocation[[i]], {i, 1, Length[collocation]}];
(* fractional nonlinear Schroedinger evaluated at collocation points *)
list = Flatten[{eqn1, eqn2, eqnlist}];
NSolve[list, {c[1], c[2], c[3], c[4], c[5], c[6], c[7]}, Reals]
Thanks for any help!
Edit Per comment below I changed the number of collocation points to 5 (used to be 6). The nonlinear Schrödinger equation evaluated at 5 collocation points, plus 2 equations for initial conditions, gives us 7 total equations, for 7 unknowns. Unfortunately Mathematica gives me an empty set.
[1]: A Chebyshev Pseudo-Spectral Method for Solving Fractional-Order Integro-Differential Equations
Length[list]
) and 7 variables. $\endgroup$NSolve
how aboutFindRoot
:sol = FindRoot[ list, {{c[1], 0}, {c[2], 0}, {c[3], 0}, {c[4], 0}, {c[5], 0}, {c[6], 0}, {c[7], 0}}]
$\endgroup$