Adeline CARNIS [Mon, 30 Sep 2013 08:27:47 +0000 (10:27 +0200)]
Change-Id: I3040ed63ee2b6981e78223436aa374d96c71ce1c

index f244441..cc3d8ee 100644 (file)
@@ -14,8 +14,8 @@ function [res,ires]=pendg(t,y,ydot)
xp         = ydot(1:3);
up         = ydot(4:6);
res(1:3)   = xp-u;
-    res(4)     = (M+m)*up(1)+m*l*cos(x(3))*up(3)-m*l*sin(x(3))*u(3)^2+lambda*fx(x(1),x(2))+k*u(1);
-    res(5)     = (M+m)*up(2)+m*l*sin(x(3))*up(3)+m*l*cos(x(3))*u(3)^2+(M+m)*g+lambda*fy(x(1),x(2))+k*u(2);
+    res(4)     = (M+m)*up(1)+m*l*cos(x(3))*up(3)-m*l*sin(x(3))*u(3).^2+lambda*fx(x(1),x(2))+k*u(1);
+    res(5)     = (M+m)*up(2)+m*l*sin(x(3))*up(3)+m*l*cos(x(3))*u(3).^2+(M+m)*g+lambda*fy(x(1),x(2))+k*u(2);
res(6)     = m*l*cos(x(3))*up(1)+m*l*sin(x(3))*up(2)+m*l^2*up(3)+m*g*sin(x(3));
res(7)     = -(fx(x(1),x(2))*u(1)+fy(x(1),x(2))*u(2));
ires       = 0;
@@ -49,7 +49,7 @@ function  H=build_sliding_pendulum ()

//the curve
vx=[xmin:0.1:xmax]';
-    vy=vx^2;
+    vy=vx.^2;
xpoly(vx,vy,"lines")
c=gce();
c.foreground=5;