更多信息
范例
基本范例
参见
NDSolve`FEM`
DiscretizePDE::femdpop
范例
基本范例 (1)
In the following case, there is a transition from the real to the complex plane:
NDSolveValue[{D[u[x], {x, 2}] == u[x] ^ (3 / 2) / Sqrt[x], u[0] == 1, u[10] == 0}, u, {x, 0, 10}, Method -> "FiniteElement"]One possible workaround is to add a 0 complex component to the equation, such that the solver works in the complex plane:
NDSolveValue[{D[u[x],{x,2}]==u[x]^(3/2)/Sqrt[x]+0.I,u[0]==1,u[10]==0},u,{x,0,10},Method->"FiniteElement"]An alternative in this case is to specify a complex-valued InitialSeeding:
sol = NDSolveValue[{D[u[x], {x, 2}] == u[x] ^ (3 / 2) / Sqrt[x], u[0] == 1, u[10] == 0}, u, {x, 0, 10}, Method -> "FiniteElement", InitialSeeding -> u[x] == 0.I]Visualize the solution making use of Re:
Plot[Re[sol[x]], {x, 0, 10}, PlotRange -> All]Note there is a small complex part of the solution:
Plot[Im[sol[x]], {x, 0, 10}, PlotRange -> All]