
Variable Gain Value Dependent on input in Simulink.
조회 수: 22 (최근 30일)
이전 댓글 표시
I am modelling a four wheeled vehicle in simulink using Newtons 2nd law
I wish to change the damping coefficient, currently a gain block, dependant on the input into the block.
Any ideas would be grateful, Thank you.
댓글 수: 0
채택된 답변
ES
2017년 3월 22일
no. This is not what i mean.
First if you have only two possible gains, then best way to do it is as below

My original answer was If you have more than two possible value for gain, instead of cascading many simple switches, you can have one multiport switch. Then based on the value of input, the multiport switch will produce the gain as output. .
댓글 수: 2
Ludo Houben
2023년 6월 20일
Hi ES
Is it possible to connect the CsR_High or CsR signal, which are used in the Gain block, to an inport? If yes, how to do this? Many thanks
Ludo
추가 답변 (1개)
ES
2017년 3월 21일
what is "dependant on the input into the block"? If you want to change the gain from workspace, you can do so by specifying a workspace variable as gain in the block parameter. If you want to change the gain according to the value of input, you will have to model it.
For example if input is >0.5, pass it through a gain block with gain =100. else if input is <0.5, pass it through a gain block with gain =120. You can use a multiport switch to do this.
댓글 수: 2
James Richard
2019년 10월 14일
Could you please give me an example of variable gain by using the multiport switch? I have read the documentation and still haven't understand.
참고 항목
카테고리
Help Center 및 File Exchange에서 Automotive Applications에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
