Giter Site home page Giter Site logo

crop.js's Introduction

crop.js

crop.js is a dynamic, deterministic generic crop (-rotation) and grassland growth model in JavaScript. It is a JS port of the soil, water and crop processes of MONICA (C++) code and an implementation of the grassland/pasture growth sub-model of SGS Pasture Model from the publicly available documentation.

Examples & Usage

var debug = true,
    verbose = true,
    weather = { // find complete description of optional or mandatory input data in src/configuration.js 
      tmin: [/*...your data...*/],
      tmax: [/*...your data...*/],
      precip: [/*...your data...*/]
    };

/* create a configuration */
var configuration = new crop.Configuration(weather, debug, verbose, 
    // optional callback
    function (dayOfSimulation, dateString, models, done) {
      var model, cropGrowth, soilTemperature, soilMoisture,
          soilOrganic, soilColumn, soilTransport;
          
      for (var m = 0; m < models.length; m++) {
        model = models[m];
        // access sub-models
        if (model.isCropPlanted())
          cropGrowth = model.cropGrowth();
        soilTemperature = model.soilTemperature();
        soilMoisture = model.soilMoisture();
        soilOrganic = model.soilOrganic();
        soilColumn = model.soilColumn()
        soilTransport = model.soilTransport();
        /* do stuff */
      }

    });

/* set up simulation, soil and crop parameters */
var simulation = {
      time: {
        startDate: '1996-01-01',
        endDate: '1997-12-31'
      },
      switches: {
        nitrogenResponseOn: true,
        waterDeficitResponseOn: true
      },
      init: {
        percentageFC: 1
      }
    },
    site: {
      latitude: 52.625,
      slope: 0,
      heightNN: 1,
      horizons: [{
        thickness: 2,
        organicMatter: 0.015,
        sand: 0.60,
        clay: 0.05,
        sceleton: 0.02
      }]
    },
    production: {
      crops: [{ /* a rotation or single crop: dates should not collide */
        model: 'generic',
        species: [
          {
            // see available crops at genericcrop.js and grassland.js
            // with varying parameter quality!
            name: 'winter rye'
          }
        ],
        sowingDate: '1996-10-01',
        plantDryWeight: 225,
        finalHarvestDate: '1997-07-01',
        tillageOperations: [],
        irrigations: [],
        organicFertilisers: [],
        mineralFertilisers: []
      }]
    };

/* run the simulation */
configuration.run(simulation, { site: site, production: production });

See also code and examples: http://jvail.github.io/crop.js/, https://zalf-lse.github.io/solid-dss/. A configuration's parameter description is available from here.

Model Genealogy

MONICA is based on HERMES and DAISY. HERMES is based on SUCROS. The grassland model is based on the SGS Pasture Model.

Nendel, C., M. Berg, K.C. Kersebaum, W. Mirschel, X. Specka, M. Wegehenkel, K.O. Wenkel, R. Wieland (2011). The MONICA model: Testing predictability for crop growth, soil moisture and nitrogen dynamics. Ecol. Model. 222 (9), 1614–1625.

Johnson I. R., Lodge G. M., White R. E. (2003). The Sustainable Grazing Systems Pasture Model: description, philosophy and application to the SGS National Experiment. Australian Journal of Experimental Agriculture 43, 711–728.

Aims

  • Replace MONICA's generic grass-legume model with a more sophisticated grassland model that is able to simulate mixtures of species.
  • Provide additional nutritional parameters (e.g. digestibility) for forage crops (e.g. maize, whole-crop silage) that may be consumend by animal (ruminants) models.
  • Add multi-model support to allow interaction of models (rotations, paddocks).
  • Add routines to interact with animal models (grazing).
  • Add other grassland species (or functional groups) if parameters are available.
  • Add simple rountines for automatic seed, harvest, fertilization, irrigation and tillage date predictions.
  • Simplify MONICA's input parameters, configuration and API.
  • Provide infrastructure and unified API to easily extend crop.js with custom crop growth models

Acknowledgements

The study has been supported by the TRY initiative on plant traits (http://www.try-db.org). The TRY initiative and database is hosted, developed and maintained by J. Kattge and G. Bönisch (Max Planck Institute for Biogeochemistry, Jena, Germany). TRY is currently supported by DIVERSITAS/Future Earth and the German Centre for Integrative Biodiversity Research (iDiv) Halle-Jena-Leipzig

The research leading to these results has received funding from the European Community’s Seventh Framework Programme (FP7/2007–2013) under grant agreement No. FP7-266367 (SOLID).

crop.js's People

Contributors

jvail avatar

Watchers

James Cloos avatar  avatar

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.