Mathematica Using mathematica to reduce a system of n equations and m variables

AI Thread Summary
The discussion centers on solving a system of six equations with thirteen variables, aiming to reduce it to seven free parameters. The original poster is using Mathematica's Reduce function but is experiencing significant delays. Participants suggest that the system may be under-determined, meaning there are too many variables relative to the number of equations, which complicates reduction. They discuss the possibility of selecting free variables and assigning numeric values to simplify the system. Additionally, it is noted that Mathematica can identify contradictions in equations, which could be a factor in the slow processing time. Suggestions include using the Eliminate function to potentially reduce the number of variables or equations, although this may lead to increased complexity. The conversation emphasizes the importance of understanding the relationships between variables and equations to effectively manage the system.
McLaren Rulez
Messages
289
Reaction score
3
Hi guys,

I have a system of six equations and thirteen variables. I would like to reduce it to seven free parameters. I used Reduce to solve it but it is taking really long (one full day and no output yet) and I think there must be a better way. Here is my code

Code:
Y = {{y1}, {y2}, {y3}} 
T = {{t11, t12, t13}, {t21, t22, t23}, {t31, t32, t33}} 
K = k*IdentityMatrix[3]

M = Y.Transpose[Y] + T.Transpose[T] - K %This is a symmetric matrix

Reduce[M[[1]][[1]]==0&&M[[1]][[2]]==0&&M[[1]][[3]]==0&&M[[2]][[2]]==0&&M[[2]][[3]]==0&&M[[3]][[3]]==0, Reals]

What should I do to speed this up? I'm sure if I spent a few hours, I could do it by hand but surely, there is a simple way to do it in Mathematica or other software? Thanks!
 
Physics news on Phys.org
Well, it's been a while; but, how do you figure you can reduce this system?

I don't know Mathematica, nor what you are doing there.

From what I remember, you seem to have a system of "too many" unknowns and "too few" equations. If those variables of yours are true state variables (i.e., they are linearly independent from each other), I am afraid there is nothing you can do to reduce your system; instead, you simply have too many solutions and you need to figure out which one you want.
 
If I give you n variables and m constraints, you can get n-m independent variables. My thirteen variables are not independent (they are related to each other by six equations). I want to reduce is to 13-6=7 independent variables.

A simplistic example of three variables and two equations: x+y+z=2 and x-y=3, you can give me one independent variable, say x. Thus we have x, y=x-3 and z=5-2x.
 
Oh. I see. I kind of understand, now. But I saw 2 equations and 3 unknowns before and I still see 2 equations and 3 unknowns afterwards; except that, now, you have 1 variable that you have chosen to call "free" but needs to be set to something and what remains becomes a square, solvable system.

So, for an under-determined system like this one, can you just pick any unknowns as your "free" variables?

And, without manipulating your original equations, can't you simply assign numeric values to the picked "free" variables, plug the values in and let the system become square and solvable? May not be as elegant...
 
Maybe this is what is happening. In general,you might still have a subset of equations that is contradictory. Then additional variables will not turn an unsolvable problem into a solvable one unless you change that subset of equations. But you would think that the program would quickly spot that problem and tell you.

EQ1: x1=1
EQ2: x1=2
EQ3: x2+x3+x4+x5 = 0
 
It is a real system (I didn't make the equations up) so it shouldn't be contradictory. You are also right that Mathematica will immediately spot a contradiction because I artificially changed the code to try that.

gsal, the point is not to solve the system. The point is to reduce the system from having thirteen variables and six constraints to seven variables and no constraints. Then, any values for those seven variables represents a valid state of the system.
 
McLaren Rulez said:
It is a real system (I didn't make the equations up) so it shouldn't be contradictory.
I see. So it is hard to explain why Mathematica is hung up. It seems like a small set of linear equations should be easy for it. Is your computer memory large enough? I have no other ideas.
You are also right that Mathematica will immediately spot a contradiction because I artificially changed the code to try that.
Good to know. Thanks.
 
If you look at the first two rows of M you can immediately see the value of k

Code:
k == t11^2 + t12^2 + t13^2 + y1^2 == t21^2 + t22^2 + t23^2 + y2^2

That reduces the number of variables and number of equations by one.
 
You can also experiment with Eliminate. That can sometimes get rid of one variable, and sometimes one equation, but the remaining equations are often considerably more complicated. If the result wasn't too much more complicated then you can sometimes more quickly solve the smaller system and backtrack to get the value of the eliminated variable. And you can try eliminating more than one variable, but the increasing complexity may take much longer than the original problem.
 

Similar threads

Replies
19
Views
2K
Replies
1
Views
2K
Replies
6
Views
4K
Replies
6
Views
3K
Replies
1
Views
2K
Replies
4
Views
5K
Back
Top