Simulink 5: Fundamentos

by

 

15 Jan 2003 (Updated )

Companion Software for "Simulink 5: Fundamentos".

fbungie (t, y, flag, m, k, b)
% yp = fbungie (t,y,flag,m,k,b)
% y(1)' = y(2)
% y(2)' = g-(k/m)*y(1)-(b/m)*y(2)
% m = parametros(1) = massa
% k = parametros(2) = coeficiente de elasticidade
% b = parametros(3) = coeficiente de tracao
function yp = fbungie (t, y, flag, m, k, b)
g = -9.8;     % aceleracao da gravidade
K = k/m;
B = b/m;
yp=[y(2)              % y(1)' = y(2) 
    g-K*y(1)-B*y(2)]; % y(2)' = g-(k/m)*y(1)-(b/m)*y(2)

Contact us