Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

The original system of equations reads:

$\begin{cases} f'(r) + f(r) \left(a(r) - \frac{1}{r}\right) = 0,\\ f^2(r) + a'(r) + \frac{a(r)}{r} - 1 = 0\,, \end{cases}$

with boundary conditions $f(0) = 0\,,\,\, f(\infty) = 1\,.$ I know that it allows non-divergent nontrivial solutions $\left(0 \leq f(r) \leq 1\,,\,\, f(r \to 0) \sim r\right.,$ and approaching exponentially to $1$ at large $r$$\left. \right)$.

Due to the boundary condition at infinity I tried the following change of variables: $r = \frac{1}{x} - 1$, which transforms it to the following system:

$\begin{cases} -x^2 f'(x) + f(x) \left(a(x) - \frac{x}{1 - x}\right) = 0,\\ f^2(x) - x^2 a'(x) + a(x) \frac{x}{1 - x} - 1 = 0\,, \end{cases}$

with boundary conditions $f(0) = 1\,,\,\, f(1) = 0\,,$ which Matematica (NDSolve) can't solve:

NDSolve[{-x^2 f'[x] + f[x] (a[x] - x/(1 - x)) == 0, f[x]^2 - x^2 a'[x] + a[x] x/(1 - x) == 1,
        f[0] == 1, f[1] == 0}, {f,a}, {x, 0, 1}]

One can eliminate $a(x)$ to obtain a 2nd-order differential equation for $f(x)$:

$f^2(x) + x^4\left( \frac{f'(x)}{f(x)}\right)^2 - x^4 \frac{f''(x)}{f(x)} +x^3\left( \frac{1}{1 - x} - 2\right)\frac{f'(x)}{f(x)} - 1 = 0\,,$ for which NDSolve again has no answer:

NDSolve[{f[x]^2 + x^4 (f'[x]/f[x])^2 - x^4 f''[x]/f[x] + x^3 (1/(1 - x) - 2) f'[x]/f[x] - 1 == 0,
      f[0] == 1, f[1] == 0}, f, {r, 0, 1}]

Any suggestions how to solve this problem in Mathematica (and not Matlab)?

share|improve this question

1 Answer 1

There is a problem with boundary conditions. Changing them and fixing a few typos you can get:

eq = {-f[x]^2 + f[x]^4 + 
     x^4 Derivative[1][f][x]^2 + (x^3) /(-1 + x)
       f[x] ((1 - 2 x) f'[x] - (-1 + x) x f''[x]) == 0, f[1/10] == 1, 
   f'[1/10] == -1/10};
eq // Column // TraditionalForm

enter image description here

s = NDSolve[eq, f, {x, 1/10, 9/10}];
Plot[Evaluate[f[x] /. s], {x, 1/10, 9/10}, PlotRange -> All]

enter image description here

Usually people first try to consider some expansions, approximations, etc. at the boundaries to understand the behaviour. So the system solvable - just understand it first and set up proper BCs. Perhaps there is an error somewhere in derivation of final equation that it stops corresponding to your BCs?

share|improve this answer
    
I don't believe there's a mistake. You are right, however, that boundary conditions are very important here. The solution I was after looks different from yours because its shape is highly dependent on BCs. Note that as you decrease the value of the first derivative while the boundary slowly approaches 0 from 1/10, the shape of the solution changes drastically. It does not even seem to converge when doing it this way. Instead, you can get the solution found in literature by assuming the following BCs: f[1 - 10^-5] == 0.85329*10^-5, f'[1 - 10^-5] == -0.85329. Why is it so unstable/sensitive? –  Alexey Galda Aug 19 at 3:39

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.