开发者

algorithm to solve related equations

开发者 https://www.devze.com 2023-01-14 03:50 出处:网络
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 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 equati开发者_运维技巧on 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


See Maxima.

I rather like it for my symbolic computation needs.


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消