9 views (last 30 days)

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.

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.

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.

Opportunities for recent engineering grads.

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

Start Hunting!
## 3 Comments

## Direct link to this comment

https://au.mathworks.com/matlabcentral/answers/498698-matlab-gives-wrong-solution-of-a-nonlinear-system-of-equations#comment_784101

⋮## Direct link to this comment

https://au.mathworks.com/matlabcentral/answers/498698-matlab-gives-wrong-solution-of-a-nonlinear-system-of-equations#comment_784101

## Direct link to this comment

https://au.mathworks.com/matlabcentral/answers/498698-matlab-gives-wrong-solution-of-a-nonlinear-system-of-equations#comment_784124

⋮## Direct link to this comment

https://au.mathworks.com/matlabcentral/answers/498698-matlab-gives-wrong-solution-of-a-nonlinear-system-of-equations#comment_784124

## Direct link to this comment

https://au.mathworks.com/matlabcentral/answers/498698-matlab-gives-wrong-solution-of-a-nonlinear-system-of-equations#comment_784278

⋮## Direct link to this comment

https://au.mathworks.com/matlabcentral/answers/498698-matlab-gives-wrong-solution-of-a-nonlinear-system-of-equations#comment_784278

Sign in to comment.