This is a question related to a DAE system originally posted on Mathematica Stack Exchange here. Since I haven't received an answer yet, I tried to come here for help. The equation system now I am eagering for an answer is
L = 10; l = L*(3/1000); DD = 0.01; mu = 1;
sol =
ParametricNDSolve[{ϕ1''[s] - (T - F)*Sin[ϕ1[s]] ==
0, ϕ2''[s] - T*Sin[ϕ2[s]] == 0, ϕ1[0] ==
0, ϕ2'[L] == 0, ϕ1[l] == ϕ2[l] ==
ArcTan[1/mu]}, {ϕ1, ϕ2}, {s, 0, L}, {T, F}];
m1[s_, T_, F_] :=
Evaluate[Evaluate[ϕ1[T, F] /. sol][s]];
m2[s_, T_, F_] :=
Evaluate[Evaluate[ϕ2[T, F] /. sol][s]];
dm1[s_, T_, F_] := Evaluate[D[m1[s, T, F], s]];
dm2[s_, T_, F_] := Evaluate[D[m2[s, T, F], s]];
BC1[T_?NumericQ, F_?NumericQ] :=
NIntegrate[Cos[m1[s, T, F]], {s, 0, l}] - DD;
BC2[T_?NumericQ, F_?NumericQ] := -dm1[l, T, F] + dm2[l, T, F];
sol2 =
Monitor[
FindRoot[{BC1[T, F] == 0, BC2[T, F] == 0}, {{T, 1}, {F, 1}}], {T, F}];
then define a piecewise function which is the conbination of ϕ1
and ϕ2
fin[s_] := Piecewise[{{ϕ1[s], 0 <= s < l}, {ϕ2[s], l <= s <= L}}];
Since for different initial values used in Findroot, we can get different ϕ1
and ϕ2
. However, the shape of fin[s]
shown in the following figure is actually my goal.
Actually for this equation system I have received two answers from to users in Mathematica Stack Exchange @AlexTrounev and @bbgodfrey. However, it is related to my eariler question and the parameters there are set to l = L*(3/10); DD = 1
; . Now in this one I especially need the results in condition of smaller DD and l. I have found there codes work not very well at small DD and l. It seems there exists a bottleneck in function FindRoot and NDSolveValue at extreme conditions, for example, in this question they are set to
l = L*(3/1000); DD = 0.01;
I’m curious about what causes such difficulty in solving these equations at this condition in function FindRoot
and NDSolveValue
. Are there any techniques that can help improve this situation? I am eagering for an answer.