# Error message when running NDSolveValue

I am trying to solve a set of differential equations but keep getting an error. See message below

"NDSolveValue::ndnum: Encountered non-numerical value for a derivative at t=0"

The system that I am trying to solve is the following:

e=.16
g=.4
w=.97


I set it up as follows:

sol=NDSolveValue[{y1'[t]==y2[t],y2'[t]==-((2/L[t]) L'[t]+g L[t]) y2[t]-(1/L[t]) Sin[y1[t]],L'[t]==7 e w Sin^6[w t+9 pi/8] Cos[w t+ 9 pi/8],y1==-1,y2==1},y1[t],y2[t],L[t]},{t,0,30}]

ParametricPlot[{y1[t],y2[t]},{t,0,30},AxesLabel->{"y1[t]","y2[t]"}]

• hi, user41071, can you check the line with NDSolve? It doesn't seem correct to me, but I didn't want to edit it and get it completely wrong.
– mgm
Jun 17 '16 at 9:10
• It should also be NDSolveValue instead of NDSolvevalue. Note the capital "V". Jun 17 '16 at 9:15
• hi, user41071, you forgot a initial condition for L[t]. Jun 17 '16 at 9:18

e = .16;
g = .4;
w = .97;


You must add a initial condition, assume: L=1

sol = NDSolveValue[{y1'[t] == y2[t],
y2'[t] == -((2/L[t]) L'[t] + g L[t]) y2[t] - (1/L[t]) Sin[y1[t]],
L'[t] == 7 e w Sin[w t + 9 Pi/8]^6* Cos[w t + 9 Pi/8],
y1 == -1, y2 == 1, L == 1}, {y1, y2, L}, {t, 0, 30}];

ParametricPlot[{sol[][t], sol[][t]}, {t, 0, 30},
AxesLabel -> {"y1[t]", "y2[t]"}] 