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

In summary, the person is trying to reduce a system of six equations and thirteen variables to seven equations and no constraints. They state that it is a real system and that it should not be contradictory. They explain that Eliminate 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 they can sometimes more quickly solve the smaller system and backtrack to get the value of the eliminated variable.
  • #1
McLaren Rulez
292
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
  • #2
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.
 
  • #3
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.
 
  • #4
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...
 
  • #5
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
 
  • #6
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.
 
  • #7
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.
 
  • #8
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.
 
  • #9
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.
 

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

How can I use Mathematica to solve a system of equations?

To use Mathematica to solve a system of equations, you can use the built-in function Solve. This function takes in the equations and variables as parameters and returns a list of solutions.

Can Mathematica handle systems with a large number of equations and variables?

Yes, Mathematica is capable of handling systems with a large number of equations and variables. It has advanced algorithms and powerful computational capabilities that allow it to efficiently solve complex systems.

Is there a specific format I need to follow when entering the equations in Mathematica?

Yes, there are a few rules and conventions to follow when entering equations in Mathematica. Each equation should be written in the form equation = 0, and all variables should be defined beforehand using the Variables function.

Can Mathematica solve systems with both numerical and symbolic values?

Yes, Mathematica can handle both numerical and symbolic values in systems of equations. It also has the ability to switch between these two types of values, depending on the needs of the user.

Are there any alternative methods for reducing a system of equations and variables in Mathematica?

Yes, there are alternative methods for reducing a system of equations and variables in Mathematica. Some other useful functions for solving systems include Reduce and NSolve. Additionally, there are various third-party packages and add-ons that offer different approaches to solving systems of equations.

Similar threads

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