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](https://www.mathworks.com/help/matlab/math/solve-bvp-with-unknown-parameter.html#responsive_offcanvas)


[scipy.integrate.solve\_bvp](https://docs.scipy.org/doc/scipy/reference/generated/scipy.integrate.solve_bvp.html#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.


  

  


How to solve an ODE with an unknown parameter but given y values at three points
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](https://people.sc.fsu.edu/%7Ejburkardt/f77_src/colnew/colnew.html) to do similar work.
If someone has experience on this, please help me.


[ADD]


I also found a newer solver [`BVP_SOLVER`](https://cs.smu.ca/%7Emuir/BVP_SOLVER_Webpage.shtml). 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.


