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[2], 1/Sqrt[2]};
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[0] == r0[[1]];
bc2 = x[1] == r0[[2]];
bc3 = y[0] == r1[[1]];
bc4 = y[1] == r1[[2]];
bc5 = x'[0] == u[[1]] *Sqrt[x'[0]^2 + y'[0]^2];
bc6 = x'[1] == v[[1]] *Sqrt[x'[1]^2 + y'[1]^2];
bc7 = y'[0] == u[[2]] * Sqrt[x'[0]^2 + y'[0]^2];
bc8 = y'[1] == v[[2]]*Sqrt[x'[1]^2 + y'[1]^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''[0] == xdd0, y''[0] == ydd0,
x'''[0] == xddd0, y'''[0] == 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?
x'[0]
, you can't. $\endgroup$