[Scilab-users] CLSS Problem. System doesnt behave as expected.

A Khorshidi akhorshidi at live.com
Fri May 16 17:41:32 CEST 2014


Hi. 

It seems that your model is not valid. I think you wanna simulate the
equation of the motion of a 1-dof robot arm or a simple pendulum. Therefore,
the correct model can be derived from Euler's law as below (You've not
considered the effect of gravity correctly):

 mL^2(thetadoubledot) + gLsin(theta) = Tau

However if you wanna simulate your given model, then state equations become: 
x1=theta --> xdot1=thetadot=x2
x2=thetadot --> xdot1=thetadoubledot=x1/L + Tau/mL^2

So, correct the matrix B as below: B=[0, 1/mL^2]


Instead of using Xcos, you can simulate the model in Scilab environment by
using ode function. That is the response that you should expect to see in
Xcos simulations.

clc, clear
L=1; m=1; Tau=1;  
function xdot=Model(t, x) 
    xdot(1)= x(2); 
    xdot(2)= sin(x(1))/L + Tau/(m*L^2); 
endfunction 
theta0=0; tethadot0=0; t0=0; 
t=0:.01:10; 
x0=[theta0; tethadot0]; 
y=ode("rk",x0,t0,t, Model); 
subplot(211) 
plot(t, y(1,:))  
set(gca(),"grid",[1 1]*color('gray')); xtitle('$\theta(t)$', 'Time (s)',
'Angle (rad)'); 
subplot(212) 
plot(t,y(2,:))  
set(gca(),"grid",[1 1]*color('gray')); 
xtitle('$\dot{\Theta}(t)$', 'Time (s)', ' Angular Velocity (rad/s)');



To simulate the non-linear system in Xcos, you should use the "EXPRESSION"
block to handle mathematical functions (e.g. sin(theta)). Therefore, your
non-linear scheme also appears wrong. 


HTH
Mehran
_





--
View this message in context: http://mailinglists.scilab.org/CLSS-Problem-System-doesnt-behave-as-expected-tp4030506p4030513.html
Sent from the Scilab users - Mailing Lists Archives mailing list archive at Nabble.com.



More information about the users mailing list