Road Profile as Input in Simulink

조회 수: 7 (최근 30일)
Sergio Rueda
Sergio Rueda 2018년 10월 8일
댓글: Mert Buyukkopru 2022년 4월 4일
Hi, i just created a PSD Road Profile, using the following code.
k = 3; % Values For ISO Road C-D Roughness Classification, from 3 to 9
V=40; % Car Velocity Km/h
L = 250; % Length Of Road Profile (m)
N=L/(V/3.6)*100; % Number of data points
B = L/N ; % Sampling Interval (m)
dn = 1/L; % Frequency Band
n0 = 0.1; % Spatial Frequency (cycles/m)
n = dn : dn : N*dn; % Spatial Frequency Band
phi = 2*pi*rand(size(n)); % Random Phase Angle
Amp1 = sqrt(dn)*(2^k)*(1e-3)*(n0./n); % Amplitude for Road Class A-B
x = 0:B:L-B; % Abscissa Variable from 0 to L
hx = zeros(size(x));
for i=1:length(x)
hx(i) = sum(Amp1.*cos(2*pi*n*x(i)+ phi));
end
plot(x,hx)
Now, I need to use this road profile as input in a simulink half car suspension model that I have built. Hx and X are two 1x2250 arrays. Is there any way to do it? Thanks in advance.
  댓글 수: 1
Mert Buyukkopru
Mert Buyukkopru 2022년 4월 4일
You can use from workspace block to get road input (your h(x) ) from Matlab workspace. You also need to create time vector start from 0 until vehicle stop.

댓글을 달려면 로그인하십시오.

답변 (1개)

Haritha
Haritha 2018년 10월 24일
Create a call back function in Simulink by using model explorer.
  댓글 수: 1
Pankaj Chaurasia
Pankaj Chaurasia 2022년 2월 26일
I am having same doubt, and i have created a call back function, now how to use this call back function it is not having an output port and i want to use it as input sourse for my system kindly tell me...

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Simulink에 대해 자세히 알아보기

제품


릴리스

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by