필터 지우기
필터 지우기

How to do Feedback Loop on Simulink with different frequinces

조회 수: 1 (최근 30일)
Esin Derin
Esin Derin 2022년 6월 23일
댓글: Paul 2022년 6월 24일
Hello, I'm trying to build a Simulink for a open and closed loop. I have to put harmonic input signal (instead of step) with amplitude 3. Input the signal into closed and open system. And found the amplitude of the output signal for both systems. Then I have to change the signal frequency 0.1 Hz to 100 Hz with increasing step ( 0.1Hz, 0.2 Hz, 0.4 Hz .... )
Attached here, you can find my diagram.

채택된 답변

Sam Chak
Sam Chak 2022년 6월 24일
편집: Sam Chak 2022년 6월 24일
First, you need to construct the frequency {0.1, 0.2, 0.4, 0.8, 1.6, ...} based on the following sequence that depends on the integer variable , which is constructed using a summation of Step functions. Note that mathematically, the sequence won't arrive exactly at 100 Hz, but 102.4 Hz.
Next, construct the Input Sine wave with varying sequential frequency.
The overall system looks like this. The step times of the 11 Step function blocks are implied in the Block names.
Then, run the simulation and plot the outputs.

추가 답변 (1개)

Paul
Paul 2022년 6월 24일
I'm assuming the question is how to run the same simulation multiple times for different frequencies. With this assumption ....
1. Replace the block labeled Sine Wave Function with the Sine Wave block
2. Double click the Sine Wave block, set the Amplitude parameter to 3, set the Frequency parameter to: freqHz*2*pi (enter it exactly that way).
3. In the Matlab workspace, or in a script, implement
freqvec = [0.1 0.2 0.4]; % choose whatever frequencies are needed
for ii = 1:numel(freqvec)
freqHz = freqvec(ii);
out = sim('Esin'); % use the actual name of the .slx file
% do whatever processing is needed on out
end
Depending on what you're actually doing, the model and/or the code above might have to be modified, but this should be enough to give the basic idea.
I believe there is also a doc page that explains alternatives methods for running multiple simulations for a parameter sweep.
  댓글 수: 2
Paul
Paul 2022년 6월 24일
I missed a step:
Add two To Workspace blocks and connect them to the same signals that are feeding the scopes.

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

카테고리

Help CenterFile Exchange에서 Scopes and Data Logging에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by