clear all
close all

T = 4.4;  %s
m = 100;  %kg
F = 3000*4.45;  %N
b = 12000;  %N/m/s

w = 2*pi/T;

X = -F/(m*w^2-1i*b*w)

Fmag = abs(F);
Xmag = abs(X)

t = 0:2*T/1000:2*T;

FF = real(F*exp(1i*w*t));
XX = real(X*exp(1i*w*t));
XXdot = real(X*1i*w*exp(1i*w*t));
figure
subplot(3,1,1)
[ah1,h11,h12] = plotyy(t,FF,t,XXdot);

subplot(3,1,2)
Pin = FF.*XXdot;
Pout = b*XXdot.*XXdot;
[ah2,h21,h22] = plotyy(t,Pin,t,Pout);



uicontrol('Style', 'slider',...
        'Min',0,'Max',5000,'Value',m,...
        'Position', [400 20 120 20],...
        'Callback', {@SetInertiaSliderBarCallback,h12,h21,h22,t,F,b,w});
    
    
    
    
    
    