- #1
- 307
- 0
-f''-(2/x)f'+(2/x^2)f+f^3-f=0
the boundary condition is f(x=0)=0 and f(x=\infty)=1
how to solve f numerically?
the boundary condition is f(x=0)=0 and f(x=\infty)=1
how to solve f numerically?
thanks a lotSince you have two boundary conditions at two different points, this is usually solved by the shooting method, where you assume a value of f'(0), and then integrate out to see if it satisfies the boundary condition at infinity, then adjust your assumption to match the desired boundary condition. However, I tried this briefly using Mathematica's NDSolve function:
NDSolve[{-D[D[f[x], x], x] - 2/x D[f[x], x] + 2/x^2 f[x] + f[x]^3 -
f[x] == 0, f[.00001] == 0,
f'[.00001] == 1.0}, f[x], {x, .00001, 20}]
and I got oscillatory solutions that tended to zero as x->inf (see attachment). Perhaps there is a particluar value of f' at zero that will give the solution you want?
There is no singularity at the origin. Assume as x->0 that f looks like f = K x. Then f->0, f^3 ->0, f''->0, and f'->K, and the equation reduces to: -2K/x+2K/x=0. So everything is well behaved. In essence, the two "singular" terms cancel. You can then start your integration at some small distance away from the origin (I chose x=1E-5, but it won't really matter as long as you start where the other terms are negligible).thanks a lot
but i am always concerned with the singularity at the origin
the coefficients diverge there
so i do not know how to deal with it
i guess the substitution y=xu may be better?You can simplify things making [tex]y(x)=u(x)/x[/tex]. Then you have:
[tex]u''+(1-2/x^{2})u-u^{3}/x^{2}[/tex]
this equation has two independent solutions as [tex]x\rightarrow \infty[/tex], namely:
[tex]u\rightarrow C_{1}Sin(x)+C_{2}Cos(x)[/tex]
You can integrate the equation backwards. I am not very sure about there being no singularity. If you keep all the terms, except for [tex]u^{3}/x^{2}[/tex], you still obtain a solution:
[tex]u(x)\equiv C_{1}(Sin(x)-Cos(x)/x)+C_{2}(Cos(x)-Sin(x)/x)[/tex]
which should be valid before the neglected term is noticeable. I see no way for any solution being bounded at x=0, unless the term with [tex]u^3[/tex] is dominant somehow
thanks a lot.The change I suggest is standard. It removes the first order differentiation, allowing to study the decay and the oscillation separately
how about guess a taylor expansion of f around x=0The change I suggest is standard. It removes the first order differentiation, allowing to study the decay and the oscillation separately