Matlab gives wrong solution of a nonlinear system of equations.
5 views (last 30 days)
Show older comments
F.O on 2 Jan 2020
Commented: F.O on 9 Jan 2020
I had bigger (6 equations) system of ODE and reduced it to the follwing system to check if we cand find equilibruim points .
syms x y1 y2 real;
syms m1 m2 epsilon1 epsilon2 positive;
syms omega11 omega12 omega 21 omefa22 positive;
syms b12 p12 gamma12 beta1 beta2 positive;
S = solve(eqns,[x,y1,y2], 'returnconditions', true);
However Matlab gave one solution in term of z and others in terms of parameters ,what does that mean and how I can use the results? Is (z,z1,z2) a free solution?
Is it possible to get z's in terms of parameters ?
The solution is in the attached file.
I also tried to check if the solution is satisfies the equations but find out that just the first and second do and others no.
Walter Roberson on 8 Jan 2020
The poster is not looking for results for any one set of specific numeric values for the 13 parameters: the poster is looking for the symbolic solution in 13 parameters and is looking for all of the solutions, not just one.
Unfortunately, some of the solution branches require solving polynomial of degree 5 and other branches require solving polynomial of degree 7.
It would perhaps be acceptable to state some of the variables in terms of the roots of high degree polynomials, but the poster also has a need to characterize all the conditions under which the solutions are valid. That is not exactly the same as solving the polynomial, but it does require characterizing the conditions under which the roots of the polynomial are real valued which appears to be approachable (with some work) for numeric coefficients but not so much for symbolic coefficients https://mathoverflow.net/questions/20946/criteria-to-determine-whether-a-real-coefficient-polynomial-has-real-root (symbolic eigenvalues are not realistically calculable for 5x5 or larger especially for coefficients as complicated as would be required here)
Walter Roberson on 7 Jan 2020
The answer to the question is, NO, it is not possible to get z in terms of the parameters.
... At least not if, like me, you only have 32 gigabytes of memory.
Your system generates many different branches of conditional cases. Working all of the cases through takes a lot of time to figure out how to proceed, and takes even more memory. I ended up having to kill the process after it started swapping my system.
I suspect you just might be able to get further if you were to remove some of the constraints to positive, as that would reduce the number of different cases to consider. You would then weed through through the results after you had the general framework.
More Answers (1)
James Browne on 7 Jan 2020
Looks like you have quite a bit going on there. I am not very familiar with doing symbolic maths with MATLAB, but I can tell you that you have a syntax error in the first line of your code.
Here is a link to the help page for the syms function:
Note that the input variables are separated by spaces in all of the examples, not commas. I am not really sure what this is causing MATLAB to do, but it does not seem to be working correctly and you can tell this by looking at your input arguments on line 1. They should all be highlighted in purple, like the examples on the help page, but only the variable "x" is highlighted, along with your variable type selection.
I would try deleting your commas and use spaces to separate your input aruments in the syms function on line 1.
Find more on Calculus in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!