MATLAB: MATLAB symbolic solve function is taking a very long time

symbolic solve

Hello,
I have a non-linear system of symbolic equations. There are six equations and I need to solve for six unknowns. However, these equations have so many terms even after using 'simplify' command of MATLAB.
Previously, I was working with four equations and four unknowns. First, I tried to solve for each unknown separately. i.e. solve first equation for x_1 in terms of x_2,…x_4. Substitute the expression for x_1 in the rest of equations. Then, find x_2 using second equation and continue this way till all four variables are found. This was taking a longer time than solving all four equations at once.
Now when I try to solve six equations for six variables, none of the methods work any longer. I waited for hours for MATLAB to solve this system of equations. But it doesn't seem to work. Any help would be greatly appreciated.
Thanks, Rupa
I Was

Best Answer

You don't show what you actually have. What you don't realize is that things go to hell exponentially fast here. Even if a solution exists (which is fairly rare for nonlinear symbolic systems) it will take a seriously LONG time. Those many terms expand and multiply to the point that you will probably not succeed.
You talk about a nonlinear system. You may also be under the wheels of mathematical impossibility. For example, even simple low order polynomial systems, when you start to add equations, grow in effective order. For example, consider two quadratic polynomial equations in two unknowns. You can solve for one variable in terms of the other and then substitute. But that results in a single equation that is higher degree than quadratic. Now do this with 6 variables. Each time you eliminate one of the variables (in sort of a Gaussian elimination scheme) the order of the equations that remain grow. Very quickly, the order of what remains is higher than a 4th degree polynomial. At that point, MATLAB may keep on trying, but it will just keep on spinning its wheels, since there is NO general solution to the roots of a higher than 4th degree polynomial.
Odds are this is what you have done, so I predict that no matter what, you will never get a solution. Again, all a guess, since we don't see your actual problem.