function dy = state3(t,y);
global a b c m_0 d L p g y_og a_0
dy=zeros(6,1);
y_og=((m_0-c*t)*(L-(m_0-c*t)/p))/(2*((1+d)*m_0-c*t));
dy(1)=y(4);
dy(2)=y(5);
dy(3)=y(6);
dy(4)=(b*t*cos((y(3)+(a*t+a_0))*pi/180)-sign(y(4))*0.1*(y(4))^2)/((1+d)*m_0-c*t);
dy(5)=(b*t*sin((y(3)+(a*t+a_0))*pi/180)-sign(y(5))*0.1*(y(5))^2)/((1+d)*m_0-c*t)-g;
dy(6)=((sign(y(4))*0.1*(y(4))^2*sin((y(3))*pi/180)-sign(y(5))*0.1*(y(5))^2*cos((y(3))*pi/180))*y_og-b*t*sin((a*t+a_0)*pi/180)*L/2)/(m_0*d*(L^2/12+(y_og)^2)+(m_0-c*t)^3/((p^2)*12)+(m_0-c*t)*(L/2-(m_0-c*t)/(2*p^2)-y_og));