MATLAB symbolic solve function is taking a very long time
15 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Rupamathi Jaddivada
el 30 de Dic. de 2016
Comentada: Walter Roberson
el 30 de Dic. de 2016
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
el 30 de Dic. de 2016
Posting your code would help.
It may be time to use a numeric solver.
Respuesta aceptada
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
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.
Más respuestas (0)
Ver también
Categorías
Más información sobre Systems of Nonlinear Equations en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!