I'm solving numerically a system of differential equations with the use of NDSolve. The numerical integration works only a very small interval of the argument.
I'm wondering if anyone could help me with finding better settings for NDSolve.
ClearAll["Global`*"];
(* THE EXACT SOLUTIONS ARE KNOWN ONLY FOR THE CERTAIN VALUES OF THE PARAMETERS *)
{λ, β, γ, μ, v} = {1, 433/2116, 1, 23/25, 1};
{α, A} = {(8 Sqrt[3])/25, (23 Sqrt[2])/25};
(* THEY ARE USED FOR SETTING BOUNDARY CONDITIONS *)
phi[z_] = v*Tanh[α*z];
chi[z_] = A/Cosh[α*z];
(* THE INTERVAL: HERE'S THE PROBLEM *)
zmin = 0;
(* !!! CHANGE 1.5 TO 2 AND THE SOLVING WILL FAIL !!!*)
zmax = 1.5;
sols = NDSolve[{
D[ϕ[z], z, z] == 4*λ*ϕ[z]*(ϕ[z]*ϕ[z] - v^2) + 2*γ*χ[z]*χ[z]*ϕ[z],
D[χ[z], z, z] == 2*γ*χ[z]*(ϕ[z]*ϕ[z] - μ^2) + 4*β*γ*χ[z]*χ[z]*χ[z],
ϕ[zmin] == phi[zmin],
ϕ[zmax] == phi[zmax],
χ[zmin] == chi[zmin],
χ[zmax] == chi[zmax]
}, {ϕ, χ}, {z, zmin, zmax}
]
Plot[{phi[z], ϕ[z] /. sols}, {z, zmin, zmax},
PlotStyle -> {Thickness[0.015], Thickness[0.007]},
PlotLegends -> "Expressions"]
Plot[{chi[z], χ[z] /. sols}, {z, zmin, zmax},
PlotStyle -> {Thickness[0.015], Thickness[0.007]},
PlotLegends -> "Expressions"]
Many thanks!!


Also, please remember to accept the answer, if any, that solves your problem, by clicking the checkmark sign!
– Feb 05 '16 at 07:26Well, I'd rather call these points pseudosingularities, since the equation is solved perfectly for an arbitrary interval covering them, if this interval is small enough. Say, [0, 1] or [1, 2]. Also, the solutions themselves look pretty smooth and nice...
Do you know by any chance how to set the mesh manually? For example, by fixing the number of points and setting them equidistant.
Or, even better, how to define the mesh as an array and then transfer in to NDSolve.
– mavzolej Feb 05 '16 at 15:19