Custom Universal Methods to resolve any equation on python

Hi. Need methodes to resolving any equations by python (without libs).
For e.g. for such complicated equations as Chladni Patterns:
N*sin(a*x)*sin(b*y)+M*sin(c*y)*sin(d*x)=0,
Or some like this:
sin(a*x)*cos(b*x)+cos(b*y)*sin(c*x)=0,
Or some like that:
sin(x^3)=sin(y^2)/cos(z^3),
or any had this view:
f(y,x,z)=f(x,y,z).
Need help! :smiling_face_with_tear:

If you want to do this without libraries, you’re going to have to write it all yourself, which would be a big job. Why not try using what already exists?

Just need method’s names, which used for that. And after then I I’m going to write it all myself. Only names… It’s not hard. Please…

Just need method’s names, which used for that.

Do you mean the names of existing tools, to refer to? A standard option would scipy.fsolve and related functions. AFAIK they are actually implemented under the hood in FORTRAN (numerical analysis is, in fact, hard).

If you really need to implement a numerical root-solver in pure Python then you’d probably want to look into Newton’s Method, which, while not great, can be written in a dozen lines of Python and is probably the simplest thing possible that could plausibly be considered useful (assuming your functions are differentiable and you can supply derivative functions for them).

A large team and 17 years of development say it is.

However, don’t let us put you off experimenting. First phase is probably to write a parser that builds an AST. I would try the built-in compile method and Python ast module on a few expressions, but they only compile Python source, so you need your own grammar for maths.

1 Like

There’s Sage:

You can see what library it uses: Packages and Features