1

I am working on a project to create a generic equation solver... envision this to take the form of 25-30 equations that will be saved in a table- variable names along with the operators.

I would then call this table for solving any equation with a missing variable and it would move operators/ other pieces to the other side of the missing variable

e.g. 2x+ 3y=z and if x were missing variable. I would call equation with values for y and z and it would convert to solve for x=(z-3y)/2

equations could be linear, polynomial, binary(yes/no result)...

i am not sure if i can get any light-weight library available or whether this needs to built from scratch... any pointers or guidance will be appreciated

2 Answers 2

1

See Maxima.

I rather like it for my symbolic computation needs.

2
  • can you share more detail- do you invoke maxima libraries from your code?
    – raghu
    Sep 29, 2010 at 12:15
  • @raghu: No, I typically directly code in it. It's written in Common Lisp, so with some work you should be able to interface it out to at least stdin/out. Sep 29, 2010 at 14:34
0

If such a general black-box algorithm could be made accurate, robust and stable, pigs could fly. Solutions can be nonexistent, multiple, parametrized, etc.

Even for linear equations it gets tricky to do it right.

Your best bet is some form of Newton algorithm, but generally you tailor it to your problem at hand.

EDIT: I didn't see you wanted something symbolic, rather than numerical. It's another bag of worms.

7
  • That would be spelled "tailor". Sorry. :-/ Sep 3, 2010 at 17:18
  • ah ok. Fixed. I'm not a native english speaker, but definitely a mathematician... Talyor is much more natural to me than tailor (however rich he be). Sep 3, 2010 at 17:20
  • I guess i haven't explained my need properly- not expecting pigs to fly... at one level, all i need is an ability to store a equation comprising of a few variables, and then be able to solve it, if one variable is missing. The 25-30 equations are NOT a system of equations. I will use only one equation at a time. And error checks made in advance before reaching here. If its still a tough problem, will need to revisit approach... at present, solving it through elaborate process
    – raghu
    Sep 3, 2010 at 17:40
  • For one variable, there are a lot of robust numerical methods. Do you want symbolic or numerical solving of your 1-unknown equation ? Sep 3, 2010 at 19:27
  • Clearly am out of my depths... not sure of difference between symbolic and numerical solving. i would have values for all but the missing element and would somehow have to move operators and variabls to other side of equation. I felt this would be a standard algorithm if I knew where to look- could you pls point me to right direction to look. thanks
    – raghu
    Sep 4, 2010 at 2:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.