필터 지우기
필터 지우기

how to form feedback loop to change input?

조회 수: 2 (최근 30일)
Shubham Mohan Tatpalliwar
Shubham Mohan Tatpalliwar 2018년 10월 17일
편집: Shubham Mohan Tatpalliwar 2018년 10월 18일
if true
% code
DrehzahlICE = 1000;
DrehzahlEMB = 1724
DrehzahlEMA = -258
DrehmomentAchsesoll= 324
DrehmomentICEmax=94
DrehmomentAchseist=DrehmomentICEmax*1.54*2.64
DrehmomentEMA = round(DrehmomentICEmax*0.53)
Drehmomentbrauch=DrehmomentAchsesoll-DrehmomentAchseist
LeistungEMA=(2*pi*DrehzahlEMA.*DrehmomentEMA)/60
LeistungEMB=-LeistungEMA;
DrehmomentEMB=(LeistungEMB*60)./(2*pi*DrehzahlEMB)
if Drehmomentbrauch<0 & DrehzahlEMA<0 & DrehmomentEMB>0
Dm=abs(Drehmomentbrauch)+ abs(DrehmomentEMB*3.07*2.64)-(DrehmomentEMA*2.64)
end
In this code (output)Dm=-13
but expected output is zero
That can be obtained by increasing first input i.e. DrehzahlICE=1000 to 1020
how can i take a feedback that Dm is not between -1 to 1
and DrehzahlICE should increase at the step of 1

채택된 답변

Adam
Adam 2018년 10월 17일
Put the relevant part of the code in a while loop with the condition
while Dm < -1 || Dm > 1
% Your main code here
DrehzahlICE = DrehzahlICE + 1
end
  댓글 수: 1
Shubham Mohan Tatpalliwar
Shubham Mohan Tatpalliwar 2018년 10월 18일
편집: Shubham Mohan Tatpalliwar 2018년 10월 18일
how should i to show only final answer

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by