Study of oscillations and how to solve in MATLAB

69 Ansichten (letzte 30 Tage)
Khang Ngo
Khang Ngo am 15 Mai 2021
Bearbeitet: Khang Ngo am 17 Mai 2021
The oscillation of any body due to elastic force can be described by the differential equation:
y''+b*y'+(w0^2)*y =F*cos(w*t)
In which, y is oscillation displacement, b is damped coefficient, w0 is angular frequency of free oscillation, w is angular frequency of stimulating force.
This project requires students to use Matlab to solve above equation to study harmonic oscillation (no damped, no stimulated force: b = F = 0), damped oscillation (b not equal 0, F = 0), stimulated oscilation (b not equal 0, F not equal 0).
Task
- Examine the command dsolve to solve differential equation in MATLAB symbolic calculation.
- Write Matlab program to solve and plot the graph depending on time (with initial conditions y(0) = 5; y’(0) = 0):
a) harmonic oscillation (w0 = 3; b = F = 0; t = 20s)
b) damped oscillation (w0 = 10; b = 0.01, 0.1, 1.0, 10.0 ; F = 0; t = 20s) % many values of b
c) stimulated oscilation (w0 = 10; b = 0.1 ; F = 10; w= 10.0, 5.0, 3.0, 0.0; t = 150s ) % many values of w
- Discuss about the obtained results.
Please somebody can help me deal with this problem, and explain me why we have this solution, I am a newbie and trying to improve my skill day by day.Thank you.

Antworten (1)

Sulaymon Eshkabilov
Sulaymon Eshkabilov am 15 Mai 2021
This is a quite straight forward exercise. Follow these steps and run your different case scenarios:
syms y(t)
Dy = diff(y, t);
D2y = diff(Dy, t);
b = 0; F = 0; w0=3; % Harmonic MOTION. Free motion: no damping and no force applied
w=10;
SOL = dsolve(D2y==F*cos(w0*t)-b*Dy-y*w0^2, y(0)==0, Dy(0)==5);
fplot(SOL, [0, 20]), shg
%% Similarly simulate the other cases, as well. And compare your sim. results and discuss.
Good luck
  4 Kommentare
Khang Ngo
Khang Ngo am 17 Mai 2021
Bearbeitet: Khang Ngo am 17 Mai 2021
syms y(t)
Dy = diff(y, t);
D2y = diff(Dy, t);
%% Case 3. Forced Motion:
w0 = 10; b = 0.1; F = 10; w = [10.0, 5.0, 3.0, 0.0]; t = 150;
SOL1 = dsolve(D2y==F*cos(w(1)*t)-b*Dy-y*w0^2, y(0)==5, Dy(0)==0);
[time1, Y1]=fplot(SOL1, [0, 150]);
plot(time1, Y1, 'k-'), hold on
xlabel('t'), ylabel('y(t)'), grid on
SOL2 = dsolve(D2y==F*cos(w(2)*t)-b*Dy-y*w0^2, y(0)==5, Dy(0)==0);
[time2, Y2]=fplot(SOL2, [0, 150]);
plot(time2, Y2, 'r--')
SOL3 = dsolve(D2y==F*cos(w(3)*t)-b*Dy-y*w0^2, y(0)==5, Dy(0)==0);
[time3, Y3]=fplot(SOL3, [0, 150]);
plot(time3, Y3, 'b-.')
SOL4 = dsolve(D2y==F*cos(w(3)*t)-b*Dy-y*w0^2, y(0)==5, Dy(0)==0);
[time4, Y4]=fplot(SOL4, [0, 150]);
plot(time4, Y4, 'g:', 'linewidth', 2)
legend('w = 10.0', 'w=5.0', 'w=3.0', 'w=0.0')
Khang Ngo
Khang Ngo am 17 Mai 2021
Bearbeitet: Khang Ngo am 17 Mai 2021
Does it right for the third case?
And why it has only 3 lines, I thought it has 4 instead.
Answer my question please. ^3^

Melden Sie sich an, um zu kommentieren.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by