Question: Solving ODE with moving boundary conditions

I am trying to solve a nonlinear second order ODE with a parameter to be determined. I can set up most of the problem but I am having trouble trying to tell the computer the following boundary condition,

 

diff(f(x),x) = -K on f(x)=0.

 

(K will be inputted and is not to be solved for) As i said before, the other boundary conditions are fine and the numerical solution works if i use different boundary conditions. 

 

For other boundary conditions (for example df/dx = 0 at x=0) I write in the form 

D(f)(0)=0

 

I hope this makes sense and someone has a solution. Thanks in advance.

 

Matt

Please Wait...