How to solve mass spring damper over frequency (differential equation)?
10 ビュー (過去 30 日間)
古いコメントを表示
This is a mass-spring-damper system equation with a function dependent on frequency (M, R, & K in parethesis).
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/314676/image.png)
f = 50:450; % Hz
M = 23.3;
K = 3.61 * 10^7;
R = 1360;
P = -1 * (2 * pi * f);
ic = 2 * pi * 50; % rad/s
The figure shows the linear impedance frequency response of the system defined by the equation.
How do you go from the differential equation to the figure?
I've seen differential equation solvers using time & displacement, but no luck on just frequency response.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/314679/image.png)
4 件のコメント
Rafael Hernandez-Walls
2020 年 6 月 12 日
You need initial condition for the displacement and for the velocity. Then you need write the ODE in two equations of first orden. Lke this
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/314684/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/314687/image.png)
and solve using ode45
回答 (2 件)
Gifari Zulkarnaen
2020 年 6 月 12 日
Equation of motion is time-dependant equation. Perhaps what you mean is Response Spectrum (frequency-based response data)? This is calculation for acceleration response spectrum:
clear
close all
f = 50:10:450; % Hz
M = 23.3;
K = 3.61*10^7;
R = 1360;
RS = zeros(1,length(f));
for i=1:length(f)
tspan = [0 1]; % Frequency range
Y0 = zeros(2,1); % Initial zero condition
[t,Y] = ode45(@(t,Y) StateEqOfMotion(t,Y,M,K,R,f(i)),tspan,Y0); % ODE
% Output Y is in term of displacement and velocity
a = Y(:,2)./t; % Acceleration
RS(i) = max(abs(a)); % Acceleration response spectrum
end
plot(f,RS)
% ODE function of State Equation
function dYdt = StateEqOfMotion(t,Y,M,K,R,f)
P = -cos(t*f);
x = Y(1);
v = Y(2);
a = (-(R*v+K*x)+P)/M;
dYdt = [v; a];
end
The result is still different with what your graph, but maybe this can give insight
0 件のコメント
Swami
2024 年 9 月 17 日
clear
close all
f = 50:10:450; % Hz
M = 23.3;
K = 3.61*10^7;
R = 1360;
RS = zeros(1,length(f));
for i=1:length(f)
tspan = [0 1]; % Frequency range
Y0 = zeros(2,1); % Initial zero condition
[t,Y] = ode45(@(t,Y) StateEqOfMotion(t,Y,M,K,R,f(i)),tspan,Y0); % ODE
% Output Y is in term of displacement and velocity
a = Y(:,2)./t; % Acceleration
RS(i) = max(abs(a)); % Acceleration response spectrum
end
plot(f,RS)
% ODE function of State Equation
function dYdt = StateEqOfMotion(t,Y,M,K,R,f)
P = -cos(t*f);
x = Y(1);
v = Y(2);
a = (-(R*v+K*x)+P)/M;
dYdt = [v; a];
end
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Numerical Integration and Differential Equations についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!