Question

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

Was it helpful?

Solution

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.

OTHER TIPS

See Maxima.

I rather like it for my symbolic computation needs.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top