Giter Site home page Giter Site logo

pybuck's Introduction

Overview

Documentation Status Build Status codecov

This package supports dimensional analysis in Python. See the application guide for more examples of using pybuck. A quick tour follows below.

Install

Clone repo and run python setup.py install.

Example usage

Use compact syntax to record the physical dimensions of quantities.

from pybuck import *

df_dim = col_matrix(
    rho = dict(M=1, L=-3),
    U   = dict(L=1, T=-1),
    D   = dict(L=1),
    mu  = dict(M=1, L=-1, T=-1),
    eps = dict(L=1)
)
df_dim
  rowname  rho  U  D  mu  eps
0       T    0 -1  0  -1    0
1       M    1  0  0   1    0
2       L   -3  1  1  -1    1

Use the dimension matrix df_dim to check the physical dimensions of quantities.

df_weights = col_matrix(q = dict(rho=1, U=2))
df_res = inner(df_dim, df_weights)
transpose(df_res)
  rowname  L  M  T
0       q -1  1 -2

Use nondim to compute the canonical non-dimensionalizing factor [Theorem 8.1, 1].

df_flowrate = col_matrix(Q = dict(M=1, L=-3, T=-1))
df_nondim = nondim(df_flowrate, df_dim)
print(inner(df_dim, df_nondim))
df_nondim
  rowname         Q
0     rho  0.571429
1       U  0.571429
2       D -0.714286
3      mu  0.428571
4     eps -0.714286

See the demo for a quick look at package functionality.

References

[1] Z. del Rosario, M. Lee, and G. Iaccarino, "Lurking Variable Detection via Dimensional Analysis" (2019) SIAM/ASA Journal on Uncertainty Quantification

pybuck's People

Contributors

zdelrosario avatar

Stargazers

Deping Huang avatar yzhan avatar

Watchers

James Cloos avatar  avatar

Forkers

yuziyuzihan

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.