Code Monkey home page Code Monkey logo

lorenz96.jl's Introduction

Lorenz96.jl - A type-flexible Lorenz 1996 model

CI DOI

attractor

Lorenz96.jl simulates the Lorenz 96 system with one level (two and three level version planned) for any given number type, as long as conversions (to and from Float64) and arithmetics (+,-,*) are defined - the scaled equations are written division-free. Output always in Float64.

Also supports mixed precision: Different number types can be defined for prognostic variables and calculations on the right-hand side, with automatic conversion on every time step.

Usage

using Lorenz96
X = L96()

simulates the Lorenz system with Float64 and standard parameters. Providing the type (which has to be a subtype of AbstractFloat), returns the simulation calculated in that type (though output in Float64)

using SoftPosit
X = L96(Posit32)

Change parameters by specifying optional arguments

X = L96(Float32,N=100_000,n=36,X=zeros(36),F=8.0,s=1.0=0.01,Δt=0.01,scheme="RK4")

with N the number of time steps, n number of variables, X the initial conditions, F the forcing constant, s a scaling factor of the equations (that will be undone for storage), η the perturbation that is added on X₁ for the default X, Δt the time step, and scheme the time integration scheme. α is additional parameter that increases the friction for α>1.

For mixed precision you also specify a type Tprog as the second argument, which is the type used for the prognostic variables

X = L96(Float16,Float32)

Here, the prognostic variables are kept at single-precision (Float32), but calculations on the right-hand side are performed in half-precision (Float16).

Equations

The Lorenz system is scaled with s and therefore the prognostic variables are actually sX -> X. The RHS then reads with s_inv = 1/s

dX_i/dt = (X_i+1 - X_i-2)*X_i-1*s_inv - α*X_i + F

Installation

Lorenz96.jl is registered so simply do

] add Lorenz96

where ] opens the package manager

lorenz96.jl's People

Contributors

milankl avatar

Stargazers

ebigram avatar Vladimir avatar Pierre Navaro avatar  avatar  avatar Sam Hatfield avatar

Watchers

James Cloos avatar

lorenz96.jl's Issues

TagBot trigger issue

This issue is used to trigger TagBot; feel free to unsubscribe.

If you haven't already, you should update your TagBot.yml to include issue comment triggers.
Please see this post on Discourse for instructions and more details.

If you'd like for me to do this for you, comment TagBot fix on this issue.
I'll open a PR within a few hours, please be patient!

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.