Giter VIP home page Giter VIP logo

galileo's Introduction

Galileo

Galileo is the genesis of a symbolic and numerical math tool written in Scala; a Computer Algebra System (CAS). It's similar to matlab or octave, but has many features of maple and mathematica as well in the sense that it supports variables and symbolic calculations.

Differentiating features:

  • Support for tensor operations and differential geometry operations (Christoffel symbols, Ricci and Riemann tensors)
  • Powerful simplification rules (accessible using the simplify command)
  • Symbolic matrix manipulation (you can invert a matrix containing symbols)
  • Support for logic operations
  • Basic framework for rules driven proofs is available (e.g. prove(1/x==x^(-1)))

Installation and running

Galileo uses the 'sbt' build system. After cloning the repository, running

sbt run

will launch the galileo interactive shell.

Galileo also provides a de-facto Scala API for symbolic math, the best way to explore its use is by looking at the test scripts.

Basics

Working with numbers

galileo>5
5
galileo>5+6
11

By default, galileo does not evaluate fractions. The 'eval' command can be used to force the evaluation.

galileo>5/4
5/4
galileo>eval(5/4)
1.25

Working with variables

galileo>x+7
x+7
galileo>x=3
3
galileo>x+7
10

Complex numbers

galileo>2+3*i
3*j+2
galileo>j*j
-1

Manipulation of expressions

The commands 'simplify', 'factor' and 'expand' can be used to manipulate expressions.

Logic operations

galileo>true && false
false
galileo>or(false,true)
true

Basic calculus

galileo>deriv(x^2,x)
2*x 

Matrices and tensors

Matrix manipulation

galileo>A=[a b;c d]
a    b
c    d
galileo>[L,U,P]=lu(A)
L	=
1.0	0.0	
c/a	1.0	

U	=
a	b	
0.0	(-1.0)*b*c/a+d	

P	=
1.0	0.0
0.0	1.0
galileo>L*U
a	b
c	d
galileo>P*A
a	b
c	d
galileo>A=[3 4;5 b]
3.0	4.0
5.0	b
galileo>inv(A)
(-1.0)*b/((-3.0)*b+20.0)	3.0*b/(5.0*((-3.0)*b+20.0))+1.0/5.0
5.0/((-3.0)*b+20.0)	(-15.0)/(5.0*((-3.0)*b+20.0))
galileo> simplify(ans)
(-1.0)*b/((-3.0)*b+20.0)	3.0*b/((-15.0)*b+100.0)+1.0/5.0
5.0/((-3.0)*b+20.0)	(-15.0)/((-15.0)*b+100.0)

Tensor manipulation

galileo> m=metric.generate(three-sphere)
Metric(Tensor(List(TensorIndex(Lower,3), TensorIndex(Lower,3)),List(r^2.0, 0.0, 0.0, 0.0, r^2.0*sin(psi)^2.0, 0.0, 0.0, 0.0, r^2.0*sin(psi)^2.0*sin(theta)^2.0)),List(psi, theta, phi ))
galileo> simplify(einsteintensor(m))
Tensor(List(TensorIndex(Lower,3), TensorIndex(Lower,3)),List(-1.0, 0.0, 0.0, 0.0, (-1.0)*sin(psi)^2.0, 0.0, 0.0, 0.0, sin(psi)^2.0*sin(theta)^2.0+(-1.0)*cos(psi)^2.0*sin(theta)^2.0+(-3.0)*sin(psi)^2.0*sin(theta)^2.0+sin(theta)^2.0))

galileo's People

Contributors

cascala avatar

Stargazers

 avatar

Watchers

James Cloos avatar  avatar  avatar

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.