xarray-simlab | Xarray extension and framework for computer model
kandi X-RAY | xarray-simlab Summary
kandi X-RAY | xarray-simlab Summary
Xarray extension and framework for computer model simulations
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Returns a dict of the command class to use
- Return the value of key
- Get project root directory
- Create a ConfigParser from a root
- Defines a variable
- Normalize encoding
- Convert a group to a tuple
- Convert a list of dimensions to a tuple
- Create a foreign variable
- Get all input variables
- Create runtime executors for each step
- Define an object
- Get the dependencies of all processes
- Get information about the model
- Scans the setup py file
- Transpose the input dataset back into another
- Resolve module name
- Ensures that there are intent conflicts
- Creates a property for a given variable
- Create a dictionary of variables
- Get the keywords from a git version file
- Execute the given stage
- Create the versioneer config file
- Define on demand
- Make a property variable variable
- Create a Process class from a class
xarray-simlab Key Features
xarray-simlab Examples and Code Snippets
Community Discussions
Trending Discussions on xarray-simlab
QUESTION
I have been looking for a while, but could not find the answer to this specific question anywhere, sorry if it is a duplicate!
I have started to build a python package based on the xarray-simlab framework with the goal to provide a modular toolbox for building reproducible and flexible marine ecosystem models. Xarray-simlab at the moment only supports explicit step-sizes to solve the model functions. In order to solve complex models more safely & efficiently, I have instead started using GEKKO as a solver backend, as the model syntax seems well suited. (Note: At the moment I will only need functionality to solve the model equations over time, but I would like to make use of GEKKO's optimization functionality to fit model parameters to field or lab data at later stages.)
The current prototype of the package creates a xsimlab process class that passes the GEKKO model instance
m
to all sub-processes. Process classes that inherit the model instance initialize m.SV
, m.Param
or define m.Intermediates
based on the processes added to the model & parameters (incl. SV dimensions) supplied at runtime. In the next step all initialized intermediates are accumulated to the affected state variables in m.Equations
. Once successfully solved, GEKKO variables are repackaged into a xarray data structure, that includes relevant metadata and can be analysed further. The package prototype can solve basic models using IMODE=7, but I have come across one issue related to the time steps of that solver:
I was expecting functionality similar to scipy's odeint, with adaptive time step evaluation, but obviously this does not seem to be the case and instead it evaluates the model at the discrete time-steps supplied.
The package is still under heavy development, and there are plenty of features that I am still trying to improve, so below is a minimal code example of a simple chemostat model. The model describes a phytoplankton state variable growing on a nutrient in a simplified flow-through system. The nutrient flows in at a constant rate, and phytoplankton dies and is lost from the system at a constant rate:
...ANSWER
Answered 2020-Jul-06 at 22:54Try to increase the number of nodes per segment with:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install xarray-simlab
You can use xarray-simlab like any standard Python library. You will need to make sure that you have a development environment consisting of a Python distribution including header files, a compiler, pip, and git installed. Make sure that your pip, setuptools, and wheel are up to date. When using pip it is generally recommended to install packages in a virtual environment to avoid changes to the system.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page