First plot x y.

4 ビュー (過去 30 日間)
Luca
Luca 2018 年 6 月 8 日
編集済み: Luca 2018 年 6 月 9 日
Hello, I'm trying to learn Simulink
and I would like to visualize the graph of the thickness of the boundary layer according to the Reynolds number. What am I doing wrong? Thanks in advance.

採用された回答

Aquatris
Aquatris 2018 年 6 月 9 日
Why do you want to do it in simulink but not in script? Given the simplicity of the thing you want, script is a better option. Simulink is more convenient when trying to solve time dependent equations. To explain the observed behaviour, I am gonna guess the Re1 block you have contains a vector. Re1 block is a constant block so no matter what, it outputs the same values. That is why you have flat lines in your scope where the values corresponds to elements of Re1 block as well as the output of Lc block. The Scope uses time values for x-axis, and when you supply two inputs to it, both are shown in y-axis with different colors. In your case, both signals are vectors, hence you have a lot of flat lines. What you are trying to do, this is my guess and is not clear in your question, is for Re1 block to spit out different scalar values in each time step so that you can create a nice xy plot. For simulink you can try something like this;
However, the same thing is much easier in script;
Re1 = 0:0.1:20;
Lc = 1; output = sqrt(1./Re1)*Lc;
plot(Re1,output),axis([0 10 0 10])

その他の回答 (2 件)

Luca
Luca 2018 年 6 月 9 日
編集済み: Luca 2018 年 6 月 9 日
Thanks. Re is a vector like this [100000:100000:6000000]. Why isnt your vector too? It is [..][..]?
Ps I know, a script is easier.
  1 件のコメント
Aquatris
Aquatris 2018 年 6 月 9 日
編集済み: Aquatris 2018 年 6 月 9 日
It is still a vector but a time dependent one. The block does not spit out all the data at once, but instead uses the time to determine which value of the vector to spit. I used time = 0:0.1:10 and Re = 0:0.1:10, which are the vectors within the "from workspace" block. This means that at time = 0, Re = 0, a scalar not a vector. I am not sure what your goal is with this one that is why I just presented a method. Hope this helps.

サインインしてコメントする。


Luca
Luca 2018 年 6 月 9 日
編集済み: Luca 2018 年 6 月 9 日
Time variable is not important at this moment.
I m studying a stationary fluid which the thickness of the boundary layer depends on the velocity of the flow expressed in Re. The behavior of this thickness is independent of time. Thikness=f(Re) not Thikness=f(Re,t).
I will try your blocks. Thanks

カテゴリ

Help Center および File ExchangeGeneral Applications についてさらに検索

製品


リリース

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by