Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
branch: master
Commits on Feb 26, 2012
  1. @eregon

    Add some coverage back with simplecov

    eregon authored
    * Simply run `COVERAGE=1 rspec .` and see coverage/index.html
  2. @eregon

    Add symbolic.gemspec to itself

    eregon authored
    * `rake gemspec` did it when re-run
  3. @eregon

    use RSpec 2 in the Rakefile too

    eregon authored
    * faster and cleaner to run specs directly with `rspec .`
  4. @eregon
  5. @eregon

    Fix the lack of parenthesis when some complex summand is shown

    eregon authored
    * Make another #to_s spec fail, but global state is better
    * The optimization is not full either (behavior withs floats need to be reviewed)
    * Fix #10 - but more work need to be done
Commits on Feb 7, 2012
  1. @eregon

    clean .gitignore

    eregon authored
    - #9
Commits on Feb 4, 2012
  1. @eregon

    Tell we require Ruby 1.9

    eregon authored
    See #8
Commits on Mar 28, 2011
  1. @lnmaurer

    Can now make multiple substitutions using a hash (similar syntax to M…

    lnmaurer authored
    …athematica). For example: (x+y+z).subs({x=>2*y,z=>y**2}) results in y**2+3*y
Commits on Jan 27, 2011
  1. @eregon
  2. @eregon
  3. @eregon
  4. @eregon
  5. @eregon

    Update specs to RSpec 2 and clean a few examples

    eregon authored
    * Sorry for the horrible diff
    * But you can see better with git diff --color-words=.
  6. @eregon

    Begin to migrate spec to rspec 2

    eregon authored
    * Tests can be run with `rspec .`
Commits on Oct 17, 2010
  1. @lnmaurer

    Update README again

    lnmaurer authored
  2. @lnmaurer

    Updated README

    lnmaurer authored
  3. @lnmaurer

    Added case to Summands.simplify. Previously, you could run in to trou…

    lnmaurer authored
    …ble adding things together:
    
    irb(main):005:0> x/y + x/y
    => Symbolic(x/y+x/y)
    irb(main):006:0> x**2 + y**2 +x**2
    => Symbolic(x**2+x**2+y**2)
    
    Those are true, but have obvious simplifications. Now, things work much more nicely:
    
    irb(main):001:0> require 'symbolic'
    => true
    irb(main):002:0> x = var(:name=>'x')
    => Symbolic(x)
    irb(main):003:0> y = var(:name=>'y')
    => Symbolic(y)
    irb(main):004:0> x+y
    => Symbolic(y+x)
    irb(main):005:0> x/y + x/y
    => Symbolic(2*x/y)
    irb(main):006:0> x/y + x/y + 3*x/y
    => Symbolic(5*x/y)
    irb(main):007:0> x + x/y + x/y + 3*x/y
    => Symbolic(5*x/y+x)
    irb(main):008:0> x + x/y + x/y + 3*x/y + y
    => Symbolic(y+5*x/y+x)
    irb(main):009:0> x + x/y + x/y + 3*x/y + y + 3
    => Symbolic(y+5*x/y+x+3)
    irb(main):010:0> x**2+y**2+x**2
    => Symbolic(2*x**2+y**2)
    irb(main):011:0> x + x/y + x/y + 3*x/y + y + 3 + x**2 + y**2 + x**2
    => Symbolic(y+2*x**2+y**2+x+5*x/y+3)
    
    Also, I broke up the code for Expression.== in to two pieces -- Expression.symbolic_equal and Expression.numeric_equal
  4. @lnmaurer

    Fixed == in Expression and added it to FunctionWrapper.

    lnmaurer authored
    Expression.== used to use Hash.==, which relied on  Object.==. This meant it only checked it the two objects were the same object (it compared 'object_id's) -- it didn't check for mathematical equivilence. This lead to problems like:
    
    irb(main):004:0> (1+x/y) == (1+x/y)
    => false
    
    Because the Factors in the summands were not the same object, although they are mathematically equal.
    
    This commit fixes that. Here are some examples showing == working correctly:
    
    irb(main):001:0> require 'symbolic'
    => true
    irb(main):002:0> x = var(:name=>'x')
    => Symbolic(x)
    irb(main):003:0> y = var(:name=>'y')
    => Symbolic(y)
    irb(main):004:0> (1+x/y) == (1+x/y)
    => true
    irb(main):005:0> (1+x/y) == (1+x/y+1)
    => false
    irb(main):006:0> (1+x/y) == (x+1+x/y)
    => false
    irb(main):007:0> (1+x/y+x) == (x+1+x/y)
    => true
    irb(main):008:0> Symbolic::Math::Cos[x+y] == Symbolic::Math::Cos[x+y]
    => true
    irb(main):009:0> Symbolic::Math::Cos[x+y] == Symbolic::Math::Cos[x]
    => false
    irb(main):010:0> Symbolic::Math::Cos[2*(x+y)] == Symbolic::Math::Cos[2*x+2*y]
Commits on May 22, 2010
  1. @eregon

    Moving and refactoring the method to get the 'simple_name' of a Modul…

    eregon authored
    …e into extensions/module.rb
Commits on Apr 27, 2010
  1. 1) Added 'e' constant and unicode characters.

    Leon N. Maurer authored
    2) Fixed error in math.rb file when using ruby 1.9
  2. 1)Fixed bug in factor.subs

    Leon Maurer authored
    2)Added new functionality to Sum
    3)Seperated substitution and evaluation in to different functions. Still more work to be done, but the idea is that substitution needn't result in a numeric. That happens when value is called.
Commits on Mar 28, 2010
  1. Merge branch 'newfunc'

    Leon Maurer authored
  2. Derivitves to math functions are now expressions.

    Leon Maurer authored
Commits on Mar 27, 2010
  1. @lnmaurer

    Added absolute value function, moved 'require's to end of symbolic.rb…

    lnmaurer authored Leon Maurer committed
    …, and ordered them so that it all works.
Commits on Mar 14, 2010
  1. Fix to Function's derivative method.

    Leon Maurer authored
    Added module Symbolic::Constants and added PI constant.
Commits on Mar 13, 2010
  1. Can now use Expressions for derivitives of Functions.

    Leon Maurer authored
Commits on Mar 12, 2010
  1. Forgot the constant class on the last commit. Whoops.

    Leon Maurer authored
  2. Merge branch 'master' into newfunc. This brings constants, and a modi…

    Leon Maurer authored
    …fied subs function.
    
    Conflicts:
    	lib/symbolic/function.rb
  3. Added class for constants. Added an option to 'subs' functions to rep…

    Leon Maurer authored
    …lace variables and constants with their values during substitution.
Commits on Mar 11, 2010
  1. Fixed uneeded require.

    Leon N. Maurer authored
  2. Completed rewrite of Function class and Math module. The two are no l…

    Leon N. Maurer authored
    …onger tied together -- you can make your own functions with ease. Here's an example for making a Heaviside step function:
    
    irb(main):001:0> require 'lib/symbolic'
    => true
    irb(main):002:0> Hstep = Symbolic::Function.new('hstep',nil){|arg| arg > 0 ? 1 : 0}
    => #<Symbolic::Function:0x7f0ec09436f0 @operation=#<Proc:0x00007f0ec0943b50@(irb):2>, @name="hstep", @deriv=nil>
    irb(main):003:0> Hstep[1]
    => 1
    irb(main):004:0> Hstep[-2]
    => 0
    irb(main):005:0> x = var(:name =>'x')
    => Symbolic(x)
    irb(main):006:0> x*Hstep[x]
    => Symbolic(x*(hstep(x)))
    irb(main):007:0> (x*Hstep[x]).subs(x,2)
    => 2
    
    To do this, the function class has been broken in to two classes -- Function and FunctionWrapper. The first holds the function and its derivitve, the second holds a function and its argument.
    
    Functions return a FunctionWrapper when given an argument. In the above example, Hstep is a function but Hstep[x] returns a FunctionWrapper that combines the function -- Hstep -- with the argument -- x.
    
    FunctionWrappers can be used in symbolic expressions. Functions cannot.
  3. Inital refactoring of Funcion class.

    Leon N. Maurer authored
  4. Started work on new function setup.

    Leon Maurer authored
Commits on Mar 10, 2010
  1. Fixed bug in taylor expansion function.

    Leon N. Maurer authored
Something went wrong with that request. Please try again.