Permalink
Switch branches/tags
Nothing to show
Commits on Feb 26, 2012
  1. Add some coverage back with simplecov

    eregon committed Feb 26, 2012
    * Simply run `COVERAGE=1 rspec .` and see coverage/index.html
  2. Add symbolic.gemspec to itself

    eregon committed Feb 26, 2012
    * `rake gemspec` did it when re-run
  3. use RSpec 2 in the Rakefile too

    eregon committed Feb 26, 2012
    * faster and cleaner to run specs directly with `rspec .`
  4. Fix the lack of parenthesis when some complex summand is shown

    eregon committed Feb 26, 2012
    * 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. clean .gitignore

    eregon committed Feb 7, 2012
    - #9
Commits on Feb 4, 2012
  1. Tell we require Ruby 1.9

    eregon committed Feb 4, 2012
    See #8
Commits on Mar 28, 2011
  1. Can now make multiple substitutions using a hash (similar syntax to M…

    lnmaurer committed Mar 28, 2011
    …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. Update specs to RSpec 2 and clean a few examples

    eregon committed Jan 27, 2011
    * Sorry for the horrible diff
    * But you can see better with git diff --color-words=.
  2. Begin to migrate spec to rspec 2

    eregon committed Jan 27, 2011
    * Tests can be run with `rspec .`
Commits on Oct 17, 2010
  1. Update README again

    lnmaurer committed Oct 17, 2010
  2. Updated README

    lnmaurer committed Oct 17, 2010
  3. Added case to Summands.simplify. Previously, you could run in to trou…

    lnmaurer committed Oct 17, 2010
    …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. Fixed == in Expression and added it to FunctionWrapper.

    lnmaurer committed Oct 17, 2010
    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. Moving and refactoring the method to get the 'simple_name' of a Modul…

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

    Leon N. Maurer
    Leon N. Maurer committed Apr 27, 2010
    2) Fixed error in math.rb file when using ruby 1.9
  2. 1)Fixed bug in factor.subs

    Leon Maurer
    Leon Maurer committed Apr 27, 2010
    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
    Leon Maurer committed Mar 28, 2010
  2. Derivitves to math functions are now expressions.

    Leon Maurer
    Leon Maurer committed Mar 28, 2010
Commits on Mar 27, 2010
  1. Added absolute value function, moved 'require's to end of symbolic.rb…

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

    Leon Maurer
    Leon Maurer committed Mar 14, 2010
    Added module Symbolic::Constants and added PI constant.
  2. Fixed bug that prevented Math functions from getting operations or me…

    Leon Maurer
    Leon Maurer committed Mar 14, 2010
    …thods.
Commits on Mar 13, 2010
  1. Can now use Expressions for derivitives of Functions.

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

    Leon Maurer
    Leon Maurer committed Mar 12, 2010
  2. Merge branch 'master' into newfunc. This brings constants, and a modi…

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

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

    Leon N. Maurer
    Leon N. Maurer committed Mar 11, 2010
  2. Completed rewrite of Function class and Math module. The two are no l…

    Leon N. Maurer
    Leon N. Maurer committed Mar 11, 2010
    …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
    Leon N. Maurer committed Mar 11, 2010
  4. Started work on new function setup.

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

    Leon N. Maurer
    Leon N. Maurer committed Mar 10, 2010