Question

GENERAL QUESTIONS FOR EVERYONE TO ANSWER INDIVIDUALLY 1) Type the code below in a new m-file in MATLAB and save it as vibrati

this is the first question

0 0
Add a comment Improve this question Transcribed image text
Answer #1

%%% Main File

tspan=[0 4];
%% initial displacement = 0.02m and initial velocity = 0 m/s
y0=[0.02;0];
[t,y]=ode45('vibration',tspan,y0);
plot(t,y(:,1));
grid on
xlabel('time')
ylabel('Displacement')
title('Displacement Vs Time')
legend ('m = 1kg, k = 100 N/M, b = 2, zeta = 0.1, ')
hold on;

%% function file

function yp = vibration(t,y)
m = 1; %% in kg
k = 100; %% in N/m
zeta = 0.1;
wn = sqrt(k/m); %% natural frequency
b = 2*zeta*wn*m
yp = [y(2);(-((b/m)*y(2))-((k/m)*y(1)))];

Displacement Vs Time 0.02 m = 1 kg, k = 100 NM. b-2, zeta = 0.1, 0.015 0.01 0.005 0.005 0.01 0.015 2 2.5 3 1.5 0.5 4 time

-3 x 10 20 Displacement Vs Time m-1kg, k100 N/M, b 20, zeta 1, 15 E 10 -5 2 2.5 3 1.5 0.5 4 time

-3 x 10 20 Displacement Vs Time m- 1kg, k 100 N/M, b 30, zeta- 1.5 15- 10 -5 2 2.5 3 time 1.5 0.5 4

4-

%%Main

%% initial displacement = 0.02m and initial velocity = 0 m/s
y0=[-0.01;0.5];
[t,y]=ode45('forced',tspan,y0);
plot(t,y(:,1));
grid on
xlabel('time')
ylabel('Displacement')
title('Displacement Vs Time')
legend ('f =10, w = 20 ')
hold on;

%% function

function yp = forced(t,y)
m = 1; %% in kg
k = 100; %% in N/m
zeta =0.1;
wn = sqrt(k/m); %% natural frequency
b = 2*zeta*wn*m
w = 2*wn
f = 10
yp = [y(2);(((f/m)*sin(w*t))-((b/m)*y(2))-((k/m)*y(1)))];

Displacement Vs Time 0.15 f=10, w = 20 0.1 , 는 0.05 0.051- -0.1 2 2.5 3 time 1.5 0.5 4

Add a comment
Know the answer?
Add Answer to:
this is the first question GENERAL QUESTIONS FOR EVERYONE TO ANSWER INDIVIDUALLY 1) Type the code below in a new m-f...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT