Effacer les filtres
Effacer les filtres

Matlab solve cannot find explicit solutionsfor symbolic equation.

2 vues (au cours des 30 derniers jours)
Athulya Ram Sreedharan Nair
Athulya Ram Sreedharan Nair le 10 Août 2020
I have a system of 12 equations, and I want to find the fixed point when all equations = 0. Here is my code:
clear x1 x2 x3 x4 x5 x6 r1 r2 r3 r4 r5 r6 f1 f2 f3 f4 f5 f6 c p alpha beta b
syms x1 x2 x3 x4 x5 x6 r1 r2 r3 r4 r5 r6 f1 f2 f3 f4 f5 f6 c p alpha beta b %all symbols
%now define the ODEs
x1dot = f1*x1 - p*x1*(r1 + beta*r2 + beta*r4);
x2dot = f2*x2 - p*x2*(r2);
x3dot = f3*x3 - p*x3*(r3 + beta*r2);
x4dot = f4*x4 - p*x4*(beta*r1 + r4 + beta*r5);
x5dot = f5*x5 - p*x5*(r5);
x6dot = f6*x6 - p*x6*(beta*r5 + r6);
r1dot = c*((x1*r1/(r1+alpha*r2+alpha*r4)) + (alpha*x4*r1/(r4+alpha*r1+alpha*r5))) - b*r1;
r2dot = c*((alpha*x1*r2/(r1+alpha*r2+alpha*r4)) + x2 + (alpha*x3*r2/(r3+alpha*r2))) - b*r2;
r3dot = c*((x3*r3/(alpha*r2+r3))) - b*r3;
r4dot = c*((alpha*x1*r4/(r1+alpha*r2+alpha*r4)) + (x4*r4/(r4+alpha*r1+alpha*r5))) - b*r4;
r5dot = c*((alpha*x4*r5/(r4+alpha*r1+alpha*r5)) + x5 + (alpha*x6*r5/(alpha*r5+r6))) - b*r5;
r6dot = c*(x6*r6/(alpha*r5+r6)) - b*r6;
%define system of ODEs as the function
fun = [x1dot, x2dot, x3dot, x4dot, x5dot, x6dot, r1dot, r2dot, r3dot, r4dot, r5dot, r6dot];
%To compute the fixed points, solve function == 0
S = solve(x1dot == 0, x2dot == 0, x3dot == 0, x4dot == 0, x5dot == 0, x6dot == 0, r1dot == 0, r2dot == 0, r3dot == 0, r4dot == 0, r5dot == 0, r6dot == 0, [x1 x2 x3 x4 x5 x6 r1 r2 r3 r4 r5 r6]);
I can find the solutions by hand. Also, I have used the same code to find fixed points of similar system of equations, so I'm not sure what's wrong. Can someone please help me figure out what's wrong here?
Interestingly, this code works for the following system of equations:
x1dot = f1*x1 - p*x1*(r1 + beta*r2 + beta*r5);
x2dot = f2*x2 - p*x2*(r2);
x3dot = f3*x3 - p*x3*(r3 + beta*r2);
x4dot = f4*x4 - p*x4*(beta*r2 + r4 + beta*r5);
x5dot = f5*x5 - p*x5*(r5);
x6dot = f6*x6 - p*x6*(beta*r5 + r6);
r1dot = c*(x1*r1/(r1+alpha*r2+alpha*r5)) - b*r1;
r2dot = c*((alpha*x1*r2/(r1+alpha*r2+alpha*r5)) + x2 + (alpha*x3*r2/(r3+alpha*r2)) + (alpha*x4*r2/(alpha*r2+r4+alpha*r5))) - b*r2;
r3dot = c*((x3*r3/(alpha*r2+r3))) - b*r3;
r4dot = c*(x4*r4/(r4+alpha*r2+alpha*r5)) - b*r4;
r5dot = c*((alpha*x1*r5/(r1+alpha*r2+alpha*r5)) + (alpha*x4*r5/(alpha*r2+r4+alpha*r5)) + x5 + (alpha*x6*r5/(alpha*r5+r6))) - b*r5;
r6dot = c*(x6*r6/(alpha*r5+r6)) - b*r6;
which is very similar, and has the same number of variables. In fact this code gives me more than 100 solutions and the conidtions associated with them.
Thank you!
  1 commentaire
hosein Javan
hosein Javan le 10 Août 2020
ur system is nonlinear. no doubt "solve" cannot do this because of its highly nonlinearity. if you can calculate the solution formula then why using solve? another limitaion of solve is that it cannot solve high order equations even try a linear system with symbolic, it halts. if you mange to solve numerically, use "vpasolve".

Connectez-vous pour commenter.

Réponses (0)

Catégories

En savoir plus sur Symbolic Math Toolbox dans Help Center et File Exchange

Produits


Version

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by