# NDSolve error when solving a BVP

I'm trying to solve the following BVP with unknown parameters (p and phi) using NDSolve over the period {Pi, 2 Pi}:

a = 0.86;b = 0.4363; c = 0.129; d = 3;q = 2; V = 5;

Ind = iL'[wt] (-a b V p[wt] Sech[b V iL[wt] p[wt]] Tanh[b V iL[wt] p[wt]] iL'[wt]-
c d V p[wt] Sech[d V iL[wt] p[wt]] Tanh[d V iL[wt] p[wt]] iL'[wt])+
(a Sech[b V iL[wt] p[wt]]+c Sech[d V iL[wt] p[wt]]) iL''[wt]

sol = NDSolve[{Ind/q + iL[wt] == -Sin[wt + phi[wt]], p'[wt] == 0, phi'[wt] == 0,
iL[Pi] == InverseFunction[(a ArcTan[Tanh[1/2 b p[\[Pi]] V #1]])/(b p[\[Pi]] V + 0.001) +
(c ArcTan[Tanh[1/2 d p[\[Pi]] V #1]])/(d p[\[Pi]] V + 0.001) &][(b d \[Pi] V -
2 a d ArcTan[Tanh[1/2 b V p[\[Pi]] Sin[phi[\[Pi]]]]] -
2 b c ArcTan[Tanh[1/2 d V p[\[Pi]] Sin[phi[\[Pi]]]]])/(2 b d V p[\[Pi]] + 0.001)],
iL'[Pi] == 1/(0.0001 + p[Pi] (a*Sech[b*iL[Pi] V p[Pi]] + c*Sech[d*iL[Pi] V p[Pi]])),
iL[2*Pi] == -Sin[phi[2*Pi]],
iL'[2*Pi] == 1/(0.001 + p[2*Pi] (a*Sech[b*iL[2*Pi] V p[Pi]] +
c*Sech[d*iL[2*Pi] V p[Pi]]))}, {iL, p, phi}, {wt, Pi, 2*Pi}];

Column[{Plot[{iL[wt],1 - (a*Sech[b*iL[wt]] + c*Sech[d*iL[wt]])*iL'[wt] V p[Pi]} /.
First[sol], {wt, Pi, 2*Pi}]}]
p[Pi] /. First[sol]
phi[Pi] /. First[sol]


I get the following error:

NDSolve::nlnum1: The function value {0. -InverseFunction[<<2>> Power[<<2>>]+<<2>> Power[<<2>>]&][20560.2],-10000.,1.34961,-1001.5} is not a list of numbers with dimensions {4} when the arguments are {0.,0.,0.,0.,1.34961,-1.49866,0.,0.}. >>

-
To get a numerical solution depending on parameters, you'll have to make iL depend on them, as in iL[wt,p,phi], and set up appropriate initial values. –  Michael E2 Jan 2 at 5:51
@Nasser, i have replaced Out[361] with Ind, now you should be able to run the code, thanks –  Sam Jan 2 at 10:50
@MichaelE2, the unknown parameters p and phi are already dependent on iL in the code, –  Sam Jan 2 at 10:52
Maybe I am stating the obvious here, but in the error message the InverseFunction is unevaluated, meaning that the inverse of the pure function could not be found. Perhaps there is another way to represent that? –  user21 Jan 2 at 18:52
@ruebenko I have tried to substitute random values into the inverse function and it gets evaluated. –  Sam Jan 3 at 15:51