Coder Social home page Coder Social logo

allofphysicsgraph / proofofconcept Goto Github PK

View Code? Open in Web Editor NEW
20.0 12.0 6.0 114.18 MB

Physics Derivation Graph: mathematical connections among equations

Home Page: https://derivationmap.net/

License: Other

Python 24.89% Shell 0.52% Mathematica 0.06% Perl 1.24% Processing 0.48% JavaScript 5.76% HTML 39.52% CSS 0.15% TeX 2.49% Dockerfile 0.29% Jupyter Notebook 24.33% Makefile 0.27%
inference-rules graph python physics-derivation-graph graphviz latex html physics derivation

proofofconcept's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

proofofconcept's Issues

store data in RDF

Hi @bhpayne,

I just discovered your work and am really interested. I have been thinking about doing something of the same kind but without going as far as you have been. I consider tinkering a bit on what you have done to see if your approach and mine are compatible.

Here is what I have in mind, first.

I know a bit about RDF and I would rather store data in a RDF graph than in q non-RDF XML file.

If data was stored in a RDF file, it would be possible to extract it using RDFlib easily and use your code to compute (only adding a layer, so that the non-RDF XML files can be created).

But it would also be possible to work from the terminology side, first by writing an ontology for the concepts (OWL classes) used in the graph and then to compute on the data, taking advantage of the RDF-possiblities.

What do you think about it? These are just fresh thoughts, but they are the result of the reflexions I have had plus what I understood of your project.

If you want to have an idea of what I am specialising in (as a personal projet alongside my studies), take a look at http://jibe-b.github.io (but don't expect too much, for example I have not yet written anything about derivations graphs and what I mostly use these pages as a notebook).

Best,

jibe

orientation of the graph in the web interface

intuitive flow is from top-to-bottom or left-to-right. Current graph is spring-force model with gravity for centering.

To do: starting point should be at top or left, final expressions should be bottom or right.

breadth-first search

I've done a depth-first search on the nuances of various derivations. Rather than continuing this process (a tedious and large amount of work), do a breadth-first search.

What are all the governing equations for various branches of Physics? Edges would denote "a derivation exists"

hierarchical graph structure

realized that the Physics Derivation Graph is hierarchical:

  • symbols, operators
  • expressions, inference rules
  • steps
  • derivations
  • Physics Derivation Graph

This can probably be used for visualization, determining storage format

how to avoid a big ball of mud?

Brian Foote and Joseph Yoder, in the paper “Big Ball of Mud” assert that when a combination of pressure, risk aversion, inexperience, complexity, rate of change, and scale of a project all increase, so too does the big ball of mud.

Python error in interactive user prompt during creation of new derivation

selected declareInitialExpr
Latex expansion: latex here

existing derivation steps:
{'infrule': 'declareInitialExpr', 'input': [], 'infrule indx': 6545819, 'feed': [], 'output': [{'latex': 'W_{net out} = Q_{in} - Q_{out}', 'step indx output': 1872040, 'expr indx': 332248408}]}

number of input expressions: 0, number of feeds: 0, number of output expressions: 1

Choice for providing step content for output:
1 provide new Latex
2 use existing expression index from above list
selection [1]:

--> no selection from user; defaulting to
1
output expression Latex, 1 of 1: \eta_{thermal} = W_{net out}/Q_{in}

Resulting dic:
{'infrule': 'declareInitialExpr', 'input': [], 'feed': [], 'output': [{'latex': '\eta_{thermal} = W_{net out}/Q_{in}', 'expr indx': 432340984}]}
derivation name: thermal efficiency and work and heat
Traceback (most recent call last):
File "bin/interactive_user_prompt.py", line 643, in
list_of_expr,connection_expr_temp,list_of_feeds,connection_infrule_temp,output_path)
File "bin/interactive_user_prompt.py", line 164, in first_choice
connection_expr_temp,list_of_feeds,connection_infrule_temp,output_path)
File "bin/interactive_user_prompt.py", line 231, in start_new_derivation
connection_infrule_temp,list_of_feeds,output_path)
File "bin/interactive_user_prompt.py", line 345, in write_steps_to_file
step_ary=assign_temp_indx(step_ary)
File "bin/interactive_user_prompt.py", line 319, in assign_temp_indx
temp_indx_for_this_expr_indx = expr_indx_exists_in_ary(expr_indx,step_indx,step_ary)
File "bin/interactive_user_prompt.py", line 289, in expr_indx_exists_in_ary
if ((step_ary[step_indx]['output'][input_indx]['expr indx'] == test_indx) and
UnboundLocalError: local variable 'input_indx' referenced before assignment

List of candidate improvements to web-based visualization of graph features

  • interactive (rather than static)
  • labeled nodes
  • ability to add/remove edges
  • ability to add/remove nodes
  • ability to edit node labels
  • no overlap of labels
  • no overlap of nodes -- #176
  • zoom
  • collapsible nodes
  • low rendering lag
  • quickly find stable graph rendering using force-directed layout
  • edges are arrows (directed graph)
  • fisheye?
  • cluster fading
  • searchable graph
  • tool tips?
  • math as labels

define words used in this project

axiom

  • a statement or proposition that is regarded as being established, accepted, or self-evidently true.

postulate

  • suggest or assume the existence, fact, or truth of (something) as a basis for reasoning, discussion, or belief

derivation

  • the obtaining or developing of something from a source or origin.

theorem

  • a general proposition not self-evident but proved by a chain of reasoning; a truth established by means of accepted truths.
    lemma
  • a subsidiary or intermediate theorem in an argument or proof.

inference rule

  • a logical form consisting of a function which takes premises, analyzes their syntax, and returns a conclusion (or conclusions)
  • aka transformation rule

statement

  • aka "expression" in Mathematica
  • includes equations and inequalities
  • has LHS, RHS

terms

  • A+B

operators

  • +,x

products

  • A*B

convert LaTeX to semantically meaningful representation

Content in the Physics Derivation Graph is currently stored as LaTeX. LaTeX is not meaningful for computer algebra systems, so a semantically meaningful representation like Content MathML or SymPy or Sage would be better.

For new content, manually entry in Content MathML is burdensome. Therefore collecting expressions in LaTeX and converting to Content MathML is preferable.

color code nodes in the graph

There are types of nodes -- inference rules, expressions, feeds, initial, final. These could have distinct color borders to quickly distinguish nodes.

compare {mathematica, latex, sympy, mathml} for storing expressions a database

Produce a report comparing formats

what are we comparing?

  • presentation mathml, content mathml, mathematica, latex, abstract syntax tree

what is the evaluation?

  • can it describe all the notation necessary for physics
  • how easy is the input method? (character count)
  • can it be transformed to other representations

In general, we need to evaluate

  • ability to input
  • ability to transform between representations
  • ability to audit correctness

Not a problem:

  • storage

consumer cares about:

  • speed
  • ease of use
  • presentation
  • accessibility - multi-device, multi-OS
  • easy setup

To start, evaluate:

  • character count
  • rendering

store expressions as parse tree

"Programming in Mathematica is based on transforming trees. The built-in function TreeFormallows us to visually represent the tree backbone of Mathematica programs and data structures"
source:
http://blog.wolfram.com/2007/05/13/symbolic-programming-visualized/

I'd like to see whether Mathematica's treeform is an Abstract Syntax Tree or Parse Tree
http://stackoverflow.com/questions/5967888/whats-the-difference-between-parse-trees-and-abstract-syntax-trees
An easy test is to test the output of
Treeform[(a+b)+c]
if the output doesn't include paranethesis, then treeform is an AST.

To make this useful, see
https://mathematica.stackexchange.com/questions/29565/getting-a-usable-expression-tree

shebang line from Mac doesn't work on Linux

Currently all Python scripts start with a shebang line for Mac
#!/opt/local/bin/python
This doesn't work on Ubuntu

The motivation for using the shebang is to enable
./bin/<scriptname>.py

Without the shebang, need to call
python bin/<scriptname>.py

neato out of memory

neato failure to create cairo surface out of memory

ubuntu, fresh install

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.