Skip to content

Instantly share code, notes, and snippets.

@jdelacruz26
Last active February 19, 2018 01:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jdelacruz26/312adba2ce7af5b8de6b8caca75bbf49 to your computer and use it in GitHub Desktop.
Save jdelacruz26/312adba2ce7af5b8de6b8caca75bbf49 to your computer and use it in GitHub Desktop.
function yp=derivadanolin(t,y)
global L m P k c
yp(1,1)=y(3);
yp(2,1)=y(4);
yp(3,1)=(P*L*sin(y(1)-y(2))-k*y(1)-c*y(3)-0.5*m*L^2*y(4)^2*sin(y(1)-y(2))...
+1.5*k*cos(y(1)-y(2))*y(2)+1.5*c*cos(y(1)-y(2))*y(4)-1.5*y(3)^2*...
sin(y(1)-y(2))*0.5*m*L^2*cos(y(1)-y(2)))*(12/((16-9*(cos(y(1)-y(2)))^2)*m*L^2));
yp(4,1)=(0.5*m*L^2*y(3)^2*sin(y(1)-y(2))-k*y(2)-c*y(4)-0.5*m*L^2*yp(3)*cos(y(1)-y(2)))...
*(3/(m*L^2));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment