Results 1 to 7 of 7

Thread: algorithm to simlify eqn

  1. #1

    Thread Starter
    New Member
    Join Date
    Dec 2003
    Location
    India
    Posts
    2

    algorithm to simlify eqn

    an anyone please help me to derive the
    algorithm to simplifying linear equation?

    For example, I have one eqn like, (3 X1+ 4
    X2 +5) /5 + (3 X1-7 X2 - 6)/6 = 2

    it should give 23 X1 - 11 X2 -60 =0;

    In general it should outputted complex
    equations in form of A X1 + B X2 +.... + c =0

    actually i am trying to develop an apllication which generates equation in complex mode like my examp but variables are not less than 10 and i need to simplify it to feed it in next module which takes eqn only as A X1 + B X2 +.... + c =0

    thanks in advance.
    Sandip

  2. #2
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    in that example you need distribute / over + and -, then sort out constants for each variable, you'd need a parser though and a reduction engine
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

  3. #3

    Thread Starter
    New Member
    Join Date
    Dec 2003
    Location
    India
    Posts
    2

    Can i get something more

    thanks,
    Got some idea. Can i get those required stuffs/ engine readily available or i have to develop those my own? If possible, if you can give some related codes or available sources/example, it will be a great to me .
    Thanks
    Sandip

  4. #4
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    easiest would be to use one already available like haskell google around for parsers calculators and equation solvers etc.. theres loads of stuff available.
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

  5. #5
    New Member
    Join Date
    Feb 2004
    Posts
    1
    I'm looking for the same thing, but am having no luck finding anything. Most of the things I've found are equation solvers that are better than the eval() function (ie fastmath), but not finding anything that will reduce a string into a simpler equation. Anybody know of some code to do this?
    Jason

  6. #6
    Lively Member
    Join Date
    Apr 2003
    Location
    Georgetown, Texas
    Posts
    114
    This is sort of not pertinent, but, just to keep things straight... You posted:


    For example, I have one eqn like, (3 X1+ 4X2 +5) /5 + (3 X1-7 X2 - 6)/6 = 2
    it should give 23 X1 - 11 X2 -60 =0
    Actually, the coefficient of X1 is 33, not 23. Perhaps a slip of the typing fingers?

  7. #7
    Conquistador
    Join Date
    Dec 1999
    Location
    Australia
    Posts
    4,527
    that's not really relevant.

    the equation illustrated his point, regardless of whether it was correct or not :P

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width