Matlab gives wrong solution of a nonlinear system of equations.

조회 수: 5 (최근 30일)
F.O
F.O 2020년 1월 2일
댓글: F.O 2020년 1월 9일
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;
F2=x*(1-x-y1/(m1*y1+x)-y2/(m2*y2+x))==0;
F6=y1*(-epsilon1*(1+omega11*y1+omega12*y2)-(b12*y2)/(p12*y2+y1)+(beta1*x)/(m1*y1+x))==0;
F7=y2*(-epsilon2*(1+omega21*y1+omega22*y2)+(gamma12*y1)/(p12*y2+y1)+(beta2*x)/(m2*y2+x))==0;
eqns=[F2,F6,F7];
diary('SolutionOfEquation_Subsystem_NonDim_RDFR_Condition.txt')
S = solve(eqns,[x,y1,y2], 'returnconditions', true);
x=latex(S.x)
y1=latex(S.y1)
y2=latex(S.y2)
S.x
S.y1
S.y2
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
F.O
F.O 2020년 1월 8일
@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 2020년 1월 8일
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
Walter Roberson 2020년 1월 7일
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
F.O
F.O 2020년 1월 8일
편집: F.O 2020년 1월 8일
10 after nondimensionallizing
F.O
F.O 2020년 1월 9일
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.

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

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

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Number Theory에 대해 자세히 알아보기

제품


릴리스

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by