This question is related to an earlier question I had asked, regarding coupled first order odes. I'll add the system of odes with their boundary conditions again here. .
The comments for the previous post were helpful.
I was wondering if the following could be done. Start with the first two boundary conditions and impose them at $r=0$, namely,$ \phi(0)=0 $and $f(0)=1$. We know how the functions behave close to zero: $\phi(r) = c_1*r+c_2*r^2+... $and $f(r)= 1+f_1 * r+ f_2*r^2+..$. If we perform this Taylor expansion around zero and plug it into the coupled system, we generate a recursion relation between the coefficients $c_n$ and $f_n$. All these coefficients can be expressed as a function of $c_1$. I tried this by hand upto $O(r^5)$. If we consider the value of these Taylor expanded functions at some $r=0.01$ and use that as the initial condition for my system of ODEs, can I try and sweep over the free parameter $c_1$ so as to get the desired behaviour I want.
I'm attaching the desired graphs which satisfy all four conditions . I've been trying to do this "sweeping" on Mathematica in the following manner. The $c$ used in the code is the same as the $c_1$ coefficient I'm referring to here in the text :
f[c_, r_] := 1 - (1/2) r^2 + (c^2/4 ) r^4 - (c^2/12) r^6
\[Phi][c_, r_] := c*r - (c/4) r^3 + ((c^3/16) + c/32) r^5
soln = ParametricNDSolve[{f'[r] ==
r (\[Phi][r]^2 - 1), \[Phi]'[r] == f[r] \[Phi][r]/r,
f[0.1] == f[c, 0.1], \[Phi][0.1] == \[Phi][c, 0.1]}, {\[Phi],
f}, {r, 0.1, 10}, c]
and
Plot[Evaluate[Table[f[c][r] /. soln, {c, 0.84, 0.85, 0.001}]], {r,
0.1, 10}, PlotRange -> {0, 2}]
Plot[Evaluate[
Table[\[Phi][c][r] /. soln, {c, 0.84, 0.85, 0.001}]], {r, 0.1, 10},
PlotRange -> {0, 2}]
For c lying between 0.84 and 0.85, I get the following graphs:
and for c lying between 0.85 and 0.86 I get the following graphs:
So I know that c should lie somewhere in this regime but I do not know of a way to isolate the number. Also, from fig.3, we can see that $\phi(r)$ approaches its desired behaviour better than $f(r)$.Unfortunately, I do not know of an efficient way to get my desired graphs by varying c.
phi[c_, r_]
can have thec/r
term. It goes to infinity at $r=0$ unless $c=0$. And $c=0$ would seem to correspond to the solution $f(r)=1=r^2/2,\;\phi(r)=0$. You wrote $c_1*r\dots$ above the code. Is there a mistake? $\endgroup$