How to make a substitution-based equation solver?

  • Thread starter Thread starter OffTheRecord
  • Start date Start date
AI Thread Summary
The discussion centers on solving a fluid dynamics problem involving six non-linear equations with six unknowns, where some variables are interdependent. The user seeks to develop a program for substitution-based solutions, primarily using MATLAB but is also open to Python. They inquire about the availability of resources and whether this approach is common practice, expressing concern about potentially reinventing the wheel.Responses indicate that while there are resources for solving systems of equations, MATLAB is primarily a numerical computational platform and lacks the symbolic capabilities of software like Maple. Users suggest checking MATLAB's libraries for existing solvers but caution that specific routines may need to be implemented for non-linear relationships. An alternative approach discussed involves using the Maple engine to handle symbolic computations and then integrating the results back into MATLAB, which could be beneficial for complex or varied functions if access to Maple is available.
OffTheRecord
Messages
17
Reaction score
0
I have a fluid dynamics problem I need to solve. There are 6 equations, and 6 unknowns, but the form of the equations are non-linear. Some unknown variables are not only multiplied by coefficients, but also by other unknown variables. Thus, I can't just do a Gaussian elimination matrix. I'm trying to come up with a way to write a program that uses substitution to solve non-linear algebraic equations. (I'm using Matlab, but I'm also somewhat familiar with Python, if need be).

My question is this: is this a topic that has a wealth of information on it? Has it been done before, is it common practice? I need to know if I'm reinventing a wheel.

If I am reinventing the wheel that is a substitution-based equation solver, then does anyone know where I can find, say, a sample code that does this?
 
Physics news on Phys.org
Hmm. Well, not having maple at hand, I may never know. Anything similar in Matlab? Any way to create a solve function like that one?
 
MATLAB is not like Maple in that Maple is a symbolic platform, where-as MATLAB is more to do with a numerical computational platform.

You would have to check the libraries for MATLAB to see if they have general multi-equation (systems of equations or inequalities) solver routines. Personally, I think you might have to implement your own routines that do solutions for very specific kinds of relationships (polynomials etc), because again MATLAB is not designed to be a core symbolic computational platform like Maple.

What you might be able to do is to send commands to the Maple engine to execute and then pipe the results back to MATLAB. You can do this with a bit of programming know how and understanding of calling the Maple Engine, and to be frank, if you need to do this thing a lot for a wide range of functions, this would be the way to go if you have access to Maple already.
 
Back
Top