alimaye / sun-fan-delta-model

GNU General Public License v3.0
0 stars 0 forks source link

Should be elementwise multiplication? #44

Closed amoodie closed 3 years ago

amoodie commented 3 years ago

Getting some weird results sometimes, with the channel width computation here.

    grid.B = (alpha_b^(-(3+2*p)/2))*(alpha_r^-1)*(grid.S.alongFlow.^(1+p))*((grid.Qw/(sqrt(g*D)*D^2)))*D; % width

I think it may be that the calculation is falling back to matrix multiplication, which does not raise an error because our domain is square (nrows==ncols), but this should be element-wise multiplication, right? I think it is at least safe to explicitly name it as element-wise:

    grid.B = (alpha_b^(-(3+2*p)/2))*(alpha_r^-1).*(grid.S.alongFlow.^(1+p)).*((grid.Qw/(sqrt(g*D)*D^2)))*D; % width

Agree?

alimaye commented 3 years ago

Agreed

alimaye commented 3 years ago

Reopened pending bug fix