How can I restrict a parameter (turbulence intensity) to only positive values?
조회 수: 5 (최근 30일)
I have a code in which the parameter u3 which denotes the turbulence intensity oscillates from positive to negative for each iteration. Since negative turbulence does not have any physical meaning, I hence want to restrict the same to only positive values. I'm finding it difficult to restrict the same in the code.
Can someone guide me please for the above-mentioned.
Please run using the callme.m file.
Vilém Frynta 2023년 5월 8일
i took a peek at your code and it's massive. therefore i came just to say that if you have a value, where you only want the positive values, you can do this:
a = -5:1:5; % numbers from -5 to 5
idx = a > 0; % logical vectors, where the values are positive
a(idx) % vector 'a', where the values are positive
if you really want help, it's a good practice to copy-paste your code here, as it's easier to access compared to downloading the files, opening them in Matlab and running it.
추가 답변 (1개)
E. Cheynet 2023년 5월 9일
Rather than restricting the turbulence intensities to positive values only, I suggest to understand why the turbulence intensity is sometimes negative. Per definition, it should not happen. So there may be something wrong in the code.