MATLAB symbolic solve function is taking a very long time

15 visualizaciones (últimos 30 días)
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
  1 comentario
Star Strider
Star Strider el 30 de Dic. de 2016
Posting your code would help.
It may be time to use a numeric solver.

Iniciar sesión para comentar.

Respuesta aceptada

John D'Errico
John D'Errico el 30 de Dic. de 2016
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.
  2 comentarios
Rupamathi Jaddivada
Rupamathi Jaddivada el 30 de Dic. de 2016
I can not post my equations considering the length of the equations. I'm not sure how should I explain my system of equations. I can just tell that the nonlinearity in the equations arises because there are several terms which are of the form (x_1*x_2, x_2*x_5^2, etc.). Also, the coefficient of each term is a very lengthy expression in terms of other symbolic variables. I think this might be one factor slowing down the symbolic solve.
I was hoping to know if there is a way I can reduce the complexity of these equations first (since simplify command is not very effective in this case) and then solve the system of equations.
Thanks, Rupa
Walter Roberson
Walter Roberson el 30 de Dic. de 2016
It is very unlikely that you would be able to get a closed form symbolic solution for that situation. You might get lucky and there might be an expression in terms of the roots of a large order polynomial, which would at least allow you to calculate the complete set of solutions.
More likely you are going to need to use vpasolve() to find a numeric solution.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Systems of Nonlinear Equations en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by