1
$\begingroup$

I am trying to solve a class of problems, which are basically about a solution to a system of non-linear equations subject to the constraint that some subset of solutions must be non-decreasing. I have been steadily increasing the number of equations (of the class that I am interested in) and the number of unknowns. So when I have 9 equations and 12 unknowns, Mathematica provides me rather quickly (about 3 min, on a MacBook Pro) a set of real solutions. My code for this is:

F={{f1, 0, 0, 0, 0, 0, 0, 0, 0}, {f2, f1, 0, 0, 0, 0, 0, 0, 0}, {f3, f2,
f1, 0, 0, 0, 0, 0, 0}, {f4, f3, f2, f1, 0, 0, 0, 0, 0}, {0, f4, f3,
f2, f1, 0, 0, 0, 0}, {0, 0, f4, f3, f2, f1, 0, 0, 0}, {0, 0, 0, f4,
f3, f2, f1, 0, 0}, {0, 0, 0, 0, f4, f3, f2, f1, 0}, {0, 0, 0, 0, 0,
f4, f3, f2, f1}}  


u = {u1, u2, u3, u4, u5, u6, u7, u8, u9}    

b = {0.1, 0.3, 0.6, 0.62, 0.65, 0.7, 0.75, 0.8, 1}

Reduce[b == F.u && 1 == f4 && f4 >=f3 >= f2 >= f1 >= 0 && u1 >= 0 && u2 >= 0 && u3 >= 0 
&& u4 >= 0 && u5 >= 0 && u6 >= 0 && u7 >= 0 && u8 >= 0 && u9 >= 0, 
{f1, f2, f3, f4, u1, u2, u3, u4, u5, u6, u7, u8, u9}, Reals]  

I don't provide the set of solutions here, it is a bit lengthy, and anyhow is irrelevant for the question.

However, when I increase my problem to the "next step", by adding just one more equation and one more unknown "u10" it does not work. Nothing happens for more than 12 hours already.

So here is the code:

F2={{f1, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {f2, f1, 0, 0, 0, 0, 0, 0, 0, 
0}, {f3, f2, f1, 0, 0, 0, 0, 0, 0, 0}, {f4, f3, f2, f1, 0, 0, 0, 0, 
0, 0}, {0, f4, f3, f2, f1, 0, 0, 0, 0, 0}, {0, 0, f4, f3, f2, f1, 0,
0, 0, 0}, {0, 0, 0, f4, f3, f2, f1, 0, 0, 0}, {0, 0, 0, 0, f4, f3, 
f2, f1, 0, 0}, {0, 0, 0, 0, 0, f4, f3, f2, f1, 0}, {0, 0, 0, 0, 0, 
0, f4, f3, f2, f1}}

u2 = {u1, u2, u3, u4, u5, u6, u7, u8, u9, u10}
b2 = {0.1, 0.3, 0.6, 0.62, 0.65, 0.7, 0.72, 0.75, 0.8, 1}

Reduce[b2 == F2.u2 && u1 >= 0 && 1 == f4 && f4 >= f3 >= f3 >=  f2 >= f1 >= 0 
&& u2 >= 0 && u3 >= 0 && u4 >= 0 && u5 >= 0 && u6 >= 0 && u7 >= 0 && 
u8 >= 0 && u9 >= 0 && u10 >= 0, {f1, f2, f3, f4, u1, u2, 
u3, u4, u5, u6, u7, u8, u9, u10}, Reals]

I am just wondering, why the complexity has increased so much for Mathematica. And what would be a more efficient/feasible way to solve this latter system? Maybe there is a trick?

Thanks a lot!

$\endgroup$
  • $\begingroup$ "For underdetermined systems, LinearSolve will return one of the possible solutions; Solve will return a general solution. »" LinearSolve[F2, b2] $\endgroup$ – Dr. belisarius Oct 3 '15 at 22:09
  • $\begingroup$ Thanks, but LinearSolve does not help me much. As I have also all values that are in F or F2 matrices as unknowns! That is why it is a non-linear system of equations, even if it looks like a linear one. $\endgroup$ – Kass Oct 3 '15 at 22:23
  • $\begingroup$ It is possible that your computation is running out of memory, in which case it may start transferring data to and from disk, which is extremely slow. With Windows, you can watch the use of resources with Task Manager. $\endgroup$ – bbgodfrey Oct 4 '15 at 0:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.