# A question on parametrically solving systems of equalities and inequalities

Posted 3 months ago
569 Views
|
3 Replies
|
0 Total Likes
|
 Dear Members of the community, I am experimenting with Solve[] for the solutions of systems of equalities and inequalities containing parameters. For example Solve[10 x1 + 3 L1 - L2 - L3 == 0 && L1 (3 x1 - y1 - y2) == 0 && L2 (-x1 + 1/10 y2 + 0.25 y3) == 0 && L3 (0.2 - x1) == 0 && 3 x1 - y1 - y2 <= 0 && -x1 + 0.1 y2 + 0.25 y3 <= 0 && 0.2 - x1 <= 0 && L1 >= 0 && L2 >= 0 && L3 >= 0, {x1, L1, L2, L3}, Reals] My variables are { x1,L1,L2,L3} and I am including the parameters {y1,y2,y3}. Mathematica seems to handle this rather complicated solution but also displays the following message:Solve::ratnz: Solve was unable to solve the system with inexact coefficients. The answer was obtained by solving a corresponding exact system and numericizing the result.Could someone help me to interpret this?Is there information concerning the number of parameters I could include in the set of equations? In this case, the functionality given by Solve[] seems very powerful, but not many examples can be found that consider parametric solutions. I will appreciate any help. CheersJesus Answer
3 Replies
Sort By:
Posted 3 months ago
 Jesus,The message is only a warning. You have numbers that are floats in your expression (for example, 0.1 and 0.25). The message will go away if you make these numbers fractions like 1/4 or give them exact precision such as 0.25` (prime symbol to designate precision). Mathematica does this for you, solves the expression and converts the answer back to floats. The warning is there because it is possible for small errors to crop in if you use floating point numbers.Regards,Neil Answer
Posted 3 months ago
 Jesus, Is there information concerning the number of parameters I could include in the set of equations? There is no limit to the number of parameters (subject to memory and time limits). I have solved equations with huge numbers of parameters. The key is whether or not Solve can separate out the expressions for the variables. For example non-linear equations can sometimes be difficult or impossible so you might have to resort to numerical methods. Also, I have run into situations where I have created complicated expressions in Mathematica and found that computing the answer using the analytic expression was more computationally expensive than numerically solving it! (this was certainly a surprise).Regards,Neil Answer
Posted 3 months ago
 Dear Neil,Thank you. It is amazing how many manipulations can be done by Mathematica over polynomials. I am interested in symbolic expressions that could be approximated off-line over a region. Usually, even complicated expressions can be reduced to simple ones if one resigns to unbound limits of variables and parameters.Thank you again for your fast reply.CheersJesus Answer
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments