Liking cljdoc? Tell your friends :D

diman logo

diman

Clojars Project

A Clojure library for applying dimensional analysis.

Motivation for diman.

Current Features

  • Create dimensional formulae.
  • Create dimensional equations.
  • Implement principle of dimensional homogeneity; Perform consistency checks.
  • Derive dimensionless products.

Usage

The easiest way to get all the built-in functions is to be in the default namespace (in-ns 'diman.default). Then, (println default-functions) to list all the available functions.

For Clojure Noobs

Since Leiningen is one of the easiest way to use Clojure, I recommend using Leiningen to run diman. Once Leiningen is installed you can use diman in two ways; by cloning this diman repo and starting up a repl (Read-eval-print loop) inside the cloned directory cd ~/diman, and by making diman as a dependency to your clojure project.

1. Running diman by cloning the repo

Once you have cloned the repository do cd ~/path/to/diman, then

lein repl

By default you should already be in the default namespace, that is, there is no need to (in-ns 'diman.default). To list all the essential functions (and therefore all the functions for the tutorials) do (println default-functions).

2. Running diman as a dependency (recommended)

Assuming you already have a clojure project or you can create one with the command lein new <project-name>, then diman can be added as a dependency in the project.clj file by doing

...
:dependencies [[org.clojure/clojure "1.10.3"]
               [com.neuralgraphs/diman "x.y.z"]]
...

To go through the tutorials, startup a repl (lein repl) inside the created project (cd /path/to/<project-name>) load the diman libraries as follows

(require '[diman.dimensions :refer [base_dimensions standard_formula update-sformula]]
         '[diman.formula :refer [formula-term formula-eqn-side formula-eqn-side-manifold]]
         '[diman.analyze :refer [dimnames consistent?]]
         '[diman.buckingham [dimensional-matrix :refer [generate-dimmat]]
                            [homogeneous-equation :refer [get-augmented-matrix solve get-solution-matrix]]
                            [dimensionless-product :refer [get-dimensionless-products get-pi-expression]]]
         '[diman [core :refer [view-matrix]]]
         '[diman.linalg.matfun [rank :refer [rank]]])

These are all the diman libraries essential for dimensional analysis (you may copy-paste the above inside the repl).

To load specific diman libraries in specific namespace under the new project do

(ns <project-name>.<your-namespace>
  (:require [diman.analyze :refer [dimnames consistent?]]))

Contributing to diman

Thank you for your interest in contributing to diman. Please refer to the guidelines on how to contribute.

License

Copyright © 2021 Lungsi Ngwua

Distributed under BSD 3-Clause "New" or "Revised" License.

Can you improve this documentation? These fine people already did:
lungsi & Lungsi Ngwua
Edit on GitHub

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close