Control System with Feedback Loop
2 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
I'm trying to connect Simulink with Matlab codes but always get unable to load block diagram error. And I can't get gain and time constant from scope 2.If you could help, it would be wonderful.
%Feedback Loop
TransferF1=tf([4],[5 1]);
TransferF1=tf([4],[5 1]);
%Feedback Loop with different Frequinces
G=tf([4],[5 1]);
K=0;
Gcl=G/[1+K*G];
K1=5;
Gcl1=G/[1+K1*G];
K2=-1;
Gcl2=G/[1+K2*G];
K3=-0.5;
Gcl3=G/[1+K3*G];
ltiview('bode',Gcl,Gcl1,Gcl2,Gcl3)
freqvec = [0.1 0.2 0.4]; % choose whatever frequencies are needed
for ii = 1:numel(freqvec)
freqHz = freqvec(ii);
out = sim('kontrollab2diagram'); % use the actual name of the .slx file
% do whatever processing is needed on out
end
0 Commenti
Risposta accettata
Sam Chak
il 25 Giu 2022
Hi @Esin Derin
It can be very frustrating when one is not familiar with the MATLAB coding + Loop, and pressurized to complete the Lab report. When I look into the task, it does not require you to use Looping. Thus, I'd suggest you do something very simple like this to get very comfortable at modeling. Record the Scope output and paste it into your lab report. When you have free time later, slowly explore the program and additional features that you are interested in.
0 Commenti
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Dynamic System Models in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!