Hi,
I have a question about inputs in Simulink.
I have a model which contains a control inside, and it does some iterations before getting the desired target value. I need to give the input to the system, then it iterates until it reaches the target; afterwards, I need to give the system the following input.
In practice, I want to provide the system with the next input of myinput array only after it has reached the target value for the previous input.
Which is the best way of handling this issue in Simulink?
I apologize if my question is trivial, but I am learning how to use Simulink and I am not an expert.
Thanks in advance,
Emanuele

 채택된 답변

Fangjun Jiang
Fangjun Jiang 2020년 7월 10일

0 개 추천

A simplified example. Make two inputs, one is 5 and one is 10. Inside, Compare output to the first input (5) , if less, pass 5, else, pass 10 (the second input).

댓글 수: 7

Emanuele Piatti
Emanuele Piatti 2020년 7월 11일
Hi,
first of all, I thank you for your help.
Regarding your example, my doubt is about passing the next input when the convergence (with a certain precision) for the previous one is verified.
When you say "pass" the input, which is a practical way of giving an input only after a certain condition is verified (for example, the convergence of the previous input is completed)?
Thank you in advance!
Fangjun Jiang
Fangjun Jiang 2020년 7월 11일
I meant to say the Switch block. The condition is the control signal, which controls to pass down either the first or the second input.
Emanuele Piatti
Emanuele Piatti 2020년 7월 12일
Since I need to pass multiple inouts, one at the time, how can I make it automatic?
Fangjun Jiang
Fangjun Jiang 2020년 7월 13일
In that case, use a 1-D Lookup Table block, for example
table data set as 10:10:50
Breakpoints set as 1:5
Algorithm Interpolation method set as Flat
For any input value <2, the output is 10
for value between 2 and 3, the output is 20,
...
Emanuele Piatti
Emanuele Piatti 2020년 7월 14일
First of all, I want to thank you for the time you are spending to help me.
I still have one doubt: how can I relate the breakpoints of the Look-Up Table to the output of my controlled system? I mean: I give the system an input (with the Look-Up Table), then it iterates until reaching the desired target value; once this is done, how can I automatically set the new input to the Look-Up Table as 2 (3, 4 and so on)?
Fangjun Jiang
Fangjun Jiang 2020년 7월 14일
feed the output of your system (the desired target signal) to the input of the Lookup Table. When the value is anything <2 (2 is your target value), the output of the Table is 10 (which is your first input). When the value reaches 2, the output of the Table is 20 (which is your "the following input").
If your input is some kind of dynamic, you can make the Table output to be an index number such as 1, 2, 3 and then use this index number to control a Multiport Switch block.
Emanuele Piatti
Emanuele Piatti 2020년 7월 17일
Thank you very much, you have been very helpful.

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

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Additional Math and Discrete에 대해 자세히 알아보기

제품

질문:

2020년 7월 10일

댓글:

2020년 7월 17일

Community Treasure Hunt

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

Start Hunting!

Translated by