Differential Equations – How to Solve an ODE with Unknown Parameter Given y Values at Three Points

differential equations

I have a second-order ODE with an unknown parameter $p$,
$$\frac{y''}{(1+y'^{2})^{\frac{3}{2}}} -p – A(x-B)^2 =0,$$
where $x$ is the independent variable, $y$ is the unknown function, $p$ is unknown parameter to be determined, and $A$ and $B$ are known constants.

I am given $y$ values at three $x$ points, $y_0(x=x_0)$, $y_1(x=x_1)$ and $y_2(x=x_2)$.

I have seen some boundary value problem examples from MATLAB (bvp4c) or Scipy (solve_bvp), where the boundary conditions must be on the boundary exactly such as $y(a)$, $y(b)$, $y'(a)$.

Solve BVP with Unknown Parameter

scipy.integrate.solve_bvp

Is there a way to solve my above ODE equation given $y$ values not on two boundaries?

Currently I am using an optimizing method to search best solution of parameter p and $y'(x_0)$ by solving the IVP problem, but it is time consuming.

Could you kindly give me a more efficient way to solve it?
Thank you.

Best Answer

According to the suggestions from @AVK, I built the problem in MATLAB(but I have no MATLAB to test)

I have read that example and try to adapt it to my case .

$$ \frac{y''}{(1+y'^{2})^{\frac{3}{2}}} -p - A(x-B)^2 =0 $$

given

$$ \begin{equation} \begin{cases} y(x_a)=YA \\ y(x_c)=YC \\ y(x_b)=YB \end{cases}\, \end{equation} $$

where $ x_a \lt x_c \lt x_b$

Let $y_1=y,\quad y_2=y'$

$$ \begin{equation} \begin{cases} y_1'=y_2, \\ y_2'=(1+y_2^{2})^{\frac{3}{2}}\cdot (p + A(x-B)^2) =0 \end{cases}\, \end{equation} $$

function dydx = fcn(x,y,regin,p) % equation to solve
A = 0.001
B = 1.0e-3
dydx = zeros(2,1);
dydx = [y(2)
       (1+y(2)^2)^(3/2)*(p+A*(x-B)^2)];
end

I apply the following BCs.

function res = bcfcn(ya,yb,p) % boundary conditions
YA = 0.0
YB = 5.0
YC = 3.0
res = [ya(1,1)-YA   % y1(xa)=ya
       ya(1,2)-YC   % y1(xc)=yc  Continuity 
       yb(1,1)-YC   % y1(xc)=yc  Continuity 
       ya(2,2)-yb(2,1)   % y2(xc)=y2(xc)  Continuity 
       yb(1,2)-YB];  % y1(xb)=yb
end

initialization

xc = 1.0;
xa = 0.0;
xb = 2.0
p = 0.0
xmesh = [0 0.25 0.5 0.75 xc xc 1.25 1.5 1.75 2];
yinit = [0.0; 0.0];
solinit = bvpinit(xmesh,yinit,p); 

solve

sol = bvp5c(@fcn, @bcfcn, solinit);
fprintf('sol.parameters %7.3f.\n',...
            sol.parameters);

%check solution
ypred = deval(sol,[xa,xc,xb])

fprintf("%7.3f",ypred(1,:))

I don't know if it is correct. Because I have no MATLAB on hand, I just check it in mathworks online site. I want to try a Fortran solver COLNEW to do similar work. If someone has experience on this, please help me.

[ADD]

I also found a newer solver BVP_SOLVER. Though it is easier to use, it only supports two-point BVPs and separated BCs, it is not convenient to use on my problem.

[Update]

Finally, I have solved the problem(MP-BVP with unknown parameters) using COLNEW, which is really a great solver.

Related Question