Matlab gives wrong solution of a nonlinear system of equations.

5 visualizzazioni (ultimi 30 giorni)
I had bigger (6 equations) system of ODE and reduced it to the follwing system to check if we cand find equilibruim points .
The code:
syms x y1 y2 real;
assume (x>=0,y1>=0,y2>=0);
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.
  3 Commenti
F.O il 8 Gen 2020
@darova I am solving the steady state system not ODE system here. Analytical solution using dsolve is not possible because I tried.
Walter Roberson
Walter Roberson il 8 Gen 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 (symbolic eigenvalues are not realistically calculable for 5x5 or larger especially for coefficients as complicated as would be required here)

Accedi per commentare.

Risposta accettata

Walter Roberson
Walter Roberson il 7 Gen 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.
  6 Commenti
F.O il 8 Gen 2020
Modificato: F.O il 8 Gen 2020
10 after nondimensionallizing
F.O il 9 Gen 2020
I tried to replace (b12*y2)/(p12*y2+y1) by just b12*y2 and (gamma12*y1)/(p12*y2+y1) by gamma12*y1 i.e using linear functional response but still got parametrized solution in case of imposing condition and error in case not imposing any condition.

Accedi per commentare.

Più risposte (1)

James Browne
James Browne il 7 Gen 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.
  1 Commento
F.O il 7 Gen 2020
it is a typo here sorry. In my atual code I don't have comma. I will edit the question.

Accedi per commentare.




Community Treasure Hunt

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

Start Hunting!

Translated by