solve complex equations in MATLAB (Variable Equations)
Show older comments
I have some equations which include some parameters and variables. Each variable defines and also exists in other equations. these are my equations:
syms Pof s Pon teta landa PIon PIof PISC
Pof = (s * y - teta + T * teta - landa + Pi * landa + alpha * p + Pon * b1 + w * b2)/(2 * b2);
s = -(y * (w - Pof))/q;
Pon = (q * s * y + 2 * w * y - 2 * w * y^2 + 2 * q * alpha + 2 * q * Pi * landa - q * teta + 3 * q * T * teta - q * landa + q * Pi * landa - q * alpha * p - 2 * y * Pof + 2 * y^2 * Pof + C * q * b1 + q * w * b2)/(2 * q * b1);
teta = (C - 3 * C * T - Pon + 3 * T * Pon)/2 * q;
landa = (-1/2) * (-1 + Pi) * (C - Pon);
Don = (1-p) * alpha - b1 * Pon + b2 * Pof - (1-y) * s + T * teta + landa * Pi;
Dof = p * alpha - b1 * Pof + b2 * Pon + y * s - (1-T) * teta - landa * (1-Pi);
PIon = (Pon-C) * Don - (1/2) * n * teta^2 - (1/2) * q * landa^2;
PIof = (Pof-w) * Dof - (1/2) * L * s^2;
PISC = PIon + PIof;
How I can solve these in order to get a numeric answer for each variable? (I don't want parametric answers)
1 Comment
John D'Errico
on 3 Feb 2022
You have 10 equations, and apparently only 8 unknowns. So your problem is overdetermined. There will be no exact numerical solution.
In fact though, I can see at least a few additional variables that have no definition. Do they have values? That is, I see these:
C, T, Pi, p, b1, w, b2, y, q alpha, Don, Dof
Probably a few others that i missed. If they have no numerical values, then it is impossible to obtain ANY nunmerical solution, since you will have undetermined coefficients.
Regardless, the fact that you have 10 equations and only 8 unknowns still precludes an exact solution, unless some of those equations are effectively redundant.
Finally, could you solve that over-determined ystem using a nonlinear solver? For example, fsolve or lsqnonlin will try to minimize the residual error to the set of equations.
Answers (0)
Categories
Find more on Number Theory in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!