Coder Social home page Coder Social logo

wknoben / marrmot Goto Github PK

View Code? Open in Web Editor NEW
106.0 106.0 53.0 32.75 MB

Modular Assessment of Rainfall-Runoff Models Toolbox - Matlab code for 47 conceptual hydrologic models

License: GNU General Public License v3.0

MATLAB 65.69% Jupyter Notebook 32.04% Python 2.20% Dockerfile 0.08%
hydrological-modelling hydrology matlab model-comparison rainfall-runoff-model

marrmot's People

Contributors

ltrotter avatar mustafakemalturkeri avatar rolfhut avatar sverhoeven avatar wknoben avatar yifatdzigan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

marrmot's Issues

JacobPattern error in `m_28_xinanjiang_12p_4s`

In m_28_xinanjiang_12p_4s:

flux_e  = evap_21(lm,c,S1,Ep,delta_t);
flux_r  = saturation_14(a,b,S1,wmax,flux_pi);
flux_rs = saturation_2(S2,smax,ex,flux_r);
flux_ri = saturation_2(S2,smax,ex,S2*ki);
flux_rg = saturation_2(S2,smax,ex,S2*kg);
flux_qs = flux_rb + flux_rs;
flux_qi = interflow_5(ci,S3);
flux_qg = baseflow_1(cg,S4);

% stores ODEs
dS1 = flux_pi - flux_e  - flux_r;
dS2 = flux_r  - flux_rs - flux_ri - flux_rg;
dS3 = flux_ri - flux_qi;
dS4 = flux_rg - flux_qg;

Hence, I think JacobPattern should be

obj.JacobPattern  = [1,0,0,0;
                     1,1,0,0;
                     0,1,1,0;
                     0,1,0,1];

Other than

obj.JacobPattern  = [1,0,0,0;
                     1,1,0,0;
                     0,1,1,0;
                     0,0,1,1];
% the last row error

https://github.com/wknoben/MARRMoT/blob/master/MARRMoT/Models/Model%20files/m_28_xinanjiang_12p_4s.m#L34

GR4J leads to odd threshold behaviour for certain parameter sets

grafik

Diagnosis:

  • x2 (water exchange parameter) is determined by relative fullness of store S2 (R in original GR4J paper), which is controlled by x3(maximum routing store depth)
  • Empty S2, no flow from x2; full S2, flow from x2 as x2's value
  • Perrin (2001) says: ". In absolute value, F cannot be greater than x2: x2 represents the maximum quantity of water that can be added (or released) to (from) each model flow component when the routing store level equals x3."
  • Theoretically, this works; if S2 never goes above x3, import based on x2 never goes above x2
  • In practice, if S2 goes over x3, we can end up in situation where water import via x2 goes up (because S2 > x3), which makes S2 go up further, etc.
  • At some point, an equilibrium will be reached where outflow from S2 through flux Qr is equal to import via x2

Why would S2 go over x3?

  • Numerical inaccuracies, rounding, etc
  • if x2 > x3

Possible solutions:

  • Extra constraint in recharge_2 to ensure that returned flow is at most equal to "flux"
  • Enforce a check that x2 cannot be greater than x3

parfor in my_cmaes.m throws an error!

When I run a model in parallel mode, I get the following error "The range of the parfor-loop variable 'k' must evaluate to a row vector of consecutive increasing integers"
Please help!
error

Low computing efficiency

In R, Xinanjiang model calibration only cost about 40s.
But in MARRMoT, the calibration is quite low efficiency. With the same forings, half hour passed, still no output.

Just wondering which part delays the computing efficiency? ODE or optimization function? Any idea?

Models sometimes return small-ish negative values

Numerical solutions don't always return physically realistic values.

Suggestion:

  • Remove constraints from individual flux functions
  • Build in constraints as part of the solver, where we (1) check if a new solution dumps a store into the negative; (2) if so, reduce all relevant fluxes by a scaled amount.

Big change, so probably should be saved for a large development push.

BMI interface returns wrong data types

Calling bmi methods via grcp4bmi and Docker is giving errors.

model.get_output_var_names() returns error with

Cell(['Fluxes leaving the model > flux_out', 'Internal fluxes > flux_in',
       'Storages (time = t) > S(t)', 'Water balance check > wb'],
      dtype=object) has type <class 'oct2py.io.Cell'>, but expected one of: (<class 'bytes'>, <class 'str'>)

model.get_value('flux_out') returns error with

Arrays with type {} cannot be transmitted through this GRPC channel

BMI var names inconsistent

get_input_var_names and get_value use different names. And var flux_out contiains 2 vars, should be split into 2 vars Q and Ea

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.