Download as pdf or txt
Download as pdf or txt
You are on page 1of 18

Scanned by CamScanner

Scanned by CamScanner

Scanned by CamScanner

Scanned by CamScanner

Scanned by CamScanner

Scanned by CamScanner

Scanned by CamScanner

Scanned by CamScanner

Scanned by CamScanner

Scanned by CamScanner

Scanned by CamScanner

Scanned by CamScanner

Scanned by CamScanner

Scanned by CamScanner

Problem no 3:
Hysteretic Damping :
% Function to solve exact solution- hysteric%
function ydot=hyexact(t,y)
w= 20; % Excitation frequency
wn=6; % natural frequency
c=6;
ydot=[y(2);(wn^2*sin(w*t))-(c./w*y(2))-(wn*y(1))];
end
% Function to solve equivalent model- hysteric%
function ydot=equiv(t,y)
w= 20; % Excitation frequency
wn=6; % natural frequency
z=0.15;
ydot=[y(2);(wn^2*sin(w*t))-(z*y(2))-(wn*y(1))];
end
% Code to plot equivalent model- hysteric%
%Plotting of exact model%
syms x0 ts z
x0=[0.2 0.5];
ts=[0 20];
z=1;
[t,y]=ode45(@hyexact,ts,x0);
figure(1);
plot(t,y(:,1),'r');
grid on;
hold on;
%Plotting of equivalent model%
[t,y]=ode45(@equiv,ts,x0);
figure(1);
xlabel('time ');
ylabel('Displacement');
plot(t,y(:,1),'b');
xlim([0 10]);
ylim([-1 1.2]);
grid on;
hold off;
legend('Exact model','Equivalent model')

Structural Damping Case


% Function to solve exact solution- Structural damping %
function xdot=strucexact(t,y)
wn=6; % Excitation frequency
w=20; % natural frequency
c=6; % natural frequency
ydot=[x(2);(( wn^2.*(sin(w*t)))-wn^2.*y(1))-(c*abs(y(1)).*sign(y(2)))];
end

% Function to solve equivalent model- hysteric%


function ydot=equiv(t,y)
w= 20; % Excitation frequency
wn=6; % natural frequency
z=0.016; % equivalent damping ratio
ydot=[y(2);(wn^2*sin(w*t))-(2*z*wn*y(2))-(wn*y(1))];
end

%Plotting of exact model%


syms x0 ts z
x0=[0.2 0.5];
ts=[0 20];
z=1;
[t,y]=ode45(@strucexact,ts,x0);
figure(1);
plot(t,y(:,1),'r');
grid on;
hold on;

%Plotting of equivalent model%


[t,y]=ode45(@equiv,ts,x0);
figure(1);
xlabel('time ');
ylabel('Displacement');
plot(t,y(:,1),'b');
xlim([0 10]);
ylim([-1 1.2]);
grid on;
hold off;
legend('Exact model','Equivalent model')

Problem 7:
Code for the problem 7:
syms x y t T F
clear all
f1=10;
f2=11;
f3=9;
A1=10;
A2=4;
A3=4;
subplot(2,1,1);
t=linspace(1,4,1000)
y=(10+8*cos(2*pi*t-(pi/3))).*cos(20*pi*t);
plot(t,y);

xlabel('Time Axis \rightarrow');


ylabel('Amplitude \rightarrow');title('Plot of signal');
pause(2);
A=[A1 A2 A3];
% Amplitudes for one-sided spectrum
F=[f1 f2 f3];
% Frequencies for one-sided spectrum
b=[A A(end:-1:1)];
% Vector of amplitudes for two-sided spectrum
freq=[F -F(end:-1:1)];
% vector of frequencies for one-sided spectrum
Amp=b.^2/4;
% Amplitude
%% Plotting part
subplot(2,1,2);
stem(freq,Amp);
grid on;
xlabel('\itFrequency(Hz) \rightarrow');
ylabel('|Xsig(f)| \rightarrow');

You might also like