Coder Social home page Coder Social logo

vakyume's Introduction

Vakyume

A Python Library for Vacuum Design

Inspired by the 1986 edition of Process Vacuum System Design and Operation by James L. Ryans and Daniel L. Roper, this project offers functions related to engineering vacuums.

We revisit the history of low pressure devices, recreating the example calculations programatically. Furthermore, a supplementary decorator is developed to calculate arbitrary missing values for a given formula.

In a nutshell, we demonstrate how to take a textbook's equations and turn it into a complete equation solver for all permutations.

Later, we convert the Python code to C++ for optimization.

Kwarg Solver Decorator

As long as one keyword argument is not given, its value is calculated

E.g.

@kwarg_solver
def einstein(...):
	"""e = m * c ** 2"""
	return ...

einstein(e = 1000) # returns m, (1000 / 8.98755179 e16), ~1.11265 e -14
einstein(m = 1000) # returns e, 1000 * 8.98755179 e16, ~8.98755179 e19

Transcription Phase

  • Transcription of Formulae
  • Develop universal format for these notes
  • Confirm adherence to strict format
  • Filling in physics constants

Implementation Phase

  • Use sympy to arbitrary solve all equations for one variable ๐Ÿ๐Ÿ“๐ŸŽŠ
  • Implement solver-decorator
  • Create arbitrary solver demo that scrolls through various calculations, for fun!

Integration Phase

  • Separate the python library that converts equations to dynamic classes
  • Use c++-imports to speed up python library
  • Make class decorator to ensure invariants on kwarg_solver
  • Metacode Motherlode, the class that does it all

Namely, kwarg_solver is a decorator that requires for x kwargs default to zero, there are x auxiliary functions of the form vanilla__a, vanilla__b, etc.., vanilla__z. Implement this as a class decorator.

Finally, metacode motherlode :

UniversalSolver({"eqn_name" : "name of method", "eqn": "normal form of equation"}) -> UniversalSolver({"eqn_name" : "Einstein", "eqn": "0 = m * 8.98755179e16 - e"}) -> class Einstein: @kwarg_solver def einstein(s, e: float = None, m: float = None, **kwargs): return # decorator skips return def einstein__m(s, e: float): return e / 8.98755179e16 def einstein__e(s, m: float) -> float: return m * 8.98755179e16

You get returned a generated class code that solves the equation for parameters Einstein().einstein(e = 1000)# Instantly returns ~1.11265 e -14

Structure:

    1. Original notes, Python equations
    1. Python class creation
    1. Testing of all existing methods, filling in unresolved equation-stubs or deferring
    1. Conversion to C++
    1. Testing in C++ all calls
    1. Speed tests over compute space

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.