What is wrong with my 'if' function/

Hello,
In my script, I am trying to give a bucket an water inflow and an outflow if the bucket is located between two angles on a wheel (Lorenz Malkus water wheel is what i'm actually trying to program). For some reason, the script says, there isn't ever a bucket that has an inflow.
This is what I have as script now(this is just a part of the script):
if (Theta(th,j1) > ((7*pi)/16) && Theta(th,j1) < ((9*pi)/16))
h(th,j1)=h(th-1,j1) - ((A0/(pi .* Re .^ 2)) .* sqrt(2.*g.*h(th-1,j1))) .* dt + Q;
Theta is the angle in this problem, and it has an initial value (theta0)
th is the timestep, on th=1, theta = theta0, so we are trying to calculate theta on th=2 and so on.
j1 is the number of the bucket, if we have 4 buckets, j1 goes from 1 to 4.
h is the height of the water, and the part behind the - sign is the water that flows out of the bucket, Q is the inflow.
We are almost sure the fault is in the if-statement.
All help is welcome, Thanks a lot!

 採用された回答

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeSpecialized Power Systems についてさらに検索

質問済み:

Lex
2014 年 3 月 27 日

回答済み:

2014 年 3 月 27 日

Community Treasure Hunt

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

Start Hunting!

Translated by