# Differential Equation with split boundary conditions

So I have a problem where I'm trying to solve some differential equations with split boundary conditions and have ran into some problems.

Firstly I define some parameters:

λi = 2; r0 = {-100, 500}; r1 = {300, 300}; u = {0, -1}; v = {1/Sqrt, 1/Sqrt};


Then I start from a Lagrangian:

L = Sqrt[x'[s]^2 + y'[s]^2] + λ (x'[s]*y''[s] -y'[s]*x''[s])^2/(x'[s]^2 + y'[s]^2)^3


and then generate two coupled differential equations:

eq1 = D[D[L, x'[s]], s] == D[D[L, x''[s]], {s, 2}] // FullSimplify
eq2 = D[D[L, y'[s]], s] == D[D[L, y''[s]], {s, 2}] // FullSimplify


which are very long and unpleasant to look at, but I'd like to be able to obtain a numerical solution with the following boundary conditions:

bc1 = x == r0[];
bc2 = x == r0[];
bc3 = y == r1[];
bc4 = y == r1[];
bc5 = x' == u[] *Sqrt[x'^2 + y'^2];
bc6 = x' == v[] *Sqrt[x'^2 + y'^2];
bc7 = y' == u[] * Sqrt[x'^2 + y'^2];
bc8 = y' == v[]*Sqrt[x'^2 + y'^2];


However when I try using NDSolve:

NDSolve[{eq1 , eq2, bc1, bc2, bc3, bc4, bc5, bc6, bc7, bc8} /. λ -> λi, {x, y}, {s, 0, 1}]


I get the errors:

NDSolve::ntdvdae: Cannot solve to find an explicit formula for the derivatives. NDSolve will try solving the system as differential-algebraic equations.

NDSolve::bvdae: Differential-algebraic equations must be given as initial value problems.

I tried to adapt an answer here and use parametricNDSolve to provide an initial value problem:

parSol2 = ParametricNDSolve[{eq1, eq2, bc1, bc3, bc5, bc7, x'' == xdd0, y'' == ydd0,
x''' == xddd0, y''' == yddd0}, {x, y}, {s, 0, 1}, {xdd0, ydd0, xddd0, yddd0}]


which works but then trying to solve for the root doesn't work, i.e.:

FindRoot[{bc2, bc4, bc6, bc8} /. {x -> x[xdd0, ydd0, xddd0, yddd0],
y -> y[xdd0, ydd0, xddd0, yddd0]} /. parSol // Evaluate,
{{xdd0, 0.1}, {ydd0, 0.1}, {xddd0, 0.1}, {yddd0, 0.1}}]


probably because I'm not providing a good initial guess (but I'm not sure how to go about improving this really with a 4 dimensional problem). Any suggestions?

• bc5 through bc8 are 4 eq with 4 unknowns, which if consistent, you could solve for the derivatives separate from the diffeqs. Other than x', you can't. – Bill Watts Dec 10 '17 at 3:33
• Welcome to Mathematica.SE! I hope you will become a regular contributor. To get started, 1) take the introductory tour now, 2) when you see good questions and answers, vote them up by clicking the gray triangles, because the credibility of the system is based on the reputation gained by users sharing their knowledge, 3) remember to accept the answer, if any, that solves your problem, by clicking the checkmark sign, and 4) give help too, by answering questions in your areas of expertise. – bbgodfrey Dec 11 '17 at 2:55

NDSolve cannot solve the equations in the question, because they are ill-posed as written. As suggested by the first error message cited in the question, it cannot obtain expressions for the fourth derivatives of x and y. Specifically,

Solve[{eq1, eq2}, {x''''[s], y''''[s]}]
(* {} *)


So, there is no solution for {x''''[s], y''''[s]}. To see why this is so, extract the coefficients of these derivatives.

CoefficientArrays[Subtract @@@ {eq1, eq2}, {x''''[s], y''''[s]}] // Last;
Simplify[Normal[%]/(x'[s]^2 + y'[s]^2)/(2 λ)]
(* {{y'[s]^2, -x'[s] y'[s]}, {x'[s] y'[s], -x'[s]^2}} *)

Det[%]
(* 0 *)


This suggests that an algebraic identity may exist among the dependent variables or their derivatives. In any case, the difficulty lies with the mathematics of the problem, not with its attempted Mathematica solution.

• Yes, you can't uncouple $x$ and $y$ here. Your highest order terms are derivatives of the curvature. I'd suggest you work with stretch and curvature as your variables instead. – KraZug Dec 11 '17 at 14:31
• I think you dropped a minus sign in your output from Simplify; the first component should be -y'[s]^2. (The matrix you have in your answer currently is non-singular in general.) – Michael Seifert Dec 11 '17 at 15:08
• @MichaelSeifert Indeed, I did. Typo corrected now. Thanks. – bbgodfrey Dec 11 '17 at 15:36