MATLAB: Second order differential equation

second order differential equation

I am trying to solve a second order differential equation using the code below, but whenever I insert the additional condition of diff(y(0),t,2) == g (g is a negative value by the way) into the equation, Matlab says: "Explicit solution could not be found." I know that this has a real, exact solution containing constants of c and g only. Should I be using another method? Thanks in advance.
syms c g y(t);
eqn = diff(y(t),t,2)== g+(c*(diff(y(t),t))*(diff(y(t),t)));
cond = [y(0) == 1000, diff(y(0),t) == 0];
ySol(t) = dsolve(eqn, cond)
v(t) = diff(ySol(t),t)
a(t) = diff(v(t),t)

Best Answer

syms c positive
syms g negative
eqn = diff(y(t),t,2)== g+(c*(diff(y(t),t))*(diff(y(t),t)));
cond = [y(0) == 1000, diff(y(0),t) == 0];
ySol(t) = dsolve(eqn, cond)
MATLAB finds four solutions.