Currently I have an equation with boundary conditions as such, $A \frac{d^2\psi}{dx^2}= C_{F}F, \psi(\frac{1}{2})=0,\psi\:'(0)=0$ and I have to use a "shooting method" to find the Dirichlet boundary condition at $x=0$, shown below:
F = 96485.3321;
A = 5.312*10^-24;
CF = 1000;
fun[y_?NumericQ] := Module[{eqns, sol, ics, x, psi},
eqns = {A*D[psi[x], x, x] == CF*F};
ics = {psi[0] == y, psi'[x] == 0 /. x -> 0};
sol = NDSolve[{eqns, ics}, {psi[x]}, {x, 0, 1/2}][[1]];
psi[x] /. sol /. x -> 1/2]
ic = FindRoot[fun[x], {x, 0}]
but the FindRoot function gives an error:
FindRoot:Encountered a singular Jacobian at the point {x} = {0.}. Try perturbing the initial point(s).
Can anyone suggest a way to get around this? Thanks a lot.