A math question

Post anything that doesn't belong in any other forum, including gaming and topics unrelated to motorsport. Site specific discussions should go in the site feedback forum.
timbo
timbo
111
Joined: 22 Oct 2007, 10:14

A math question

Post

Guys, I'm composing a set of tasks for a chemistry class, and one problem involves calculation of the simultaneous equations. The problem is that they look easy, they have a definitive solution (which can be calculated iterationally) but if I try to solve them analytically, I come up with something like 0x=0. I guess the problem is that one number in the solution is 0.
They look like this
a1*x+b1*y+c1*z = A
a2*x+b2*y+c2*z = A
a3*x+b3*y+c3*z = A
(A is the same in all equations, c3=0 and y is also 0)
Is there a way to solve such equations easily?

piast9
piast9
20
Joined: 16 Mar 2010, 00:39

Re: A math question

Post


timbo
timbo
111
Joined: 22 Oct 2007, 10:14

Re: A math question

Post

I know that method, of course. Problem is it seems like the equations are not sufficiently defined, as I keep coming back to 0*x=0 when trying to solve that.

superdread
superdread
16
Joined: 25 Jul 2012, 22:04

Re: A math question

Post

how is y set to be 0?
that makes little sense, because with only two variables (x and z) and 3 equations and if these equations are linear independent they must contradict each other and you get no solution (that's called overdefining your problem)

Caito
Caito
13
Joined: 16 Jun 2009, 05:30
Location: Switzerland

Re: A math question

Post

Well, one way to compute the solution is actually really easy.

You need to know what you're facing.That's a linear equation system with 3 variables. Each equation represents a plane.

Now we need to know what kind of solutions you could be facing. You could have a single (x,y,z) value, all planes meet at only one point. You could also have a line, 3 planes intersecting at a line. Like x=2y+3, or y=3z. Your answer could be a whole plane (for example x+y+z=1) or there could be no valid answers at all. This could happen if all planes where parallel. Or the 3 planes would form a triangle as seen from "above", they meet in pairs, but the three never meet.

I'm just guessing you're in the case you have a single answer, a point, (x,y,z).
You can solve it by simply solving for x in one equation, putting that in equation 2, solving for y, putting that in equation x and solving for z. You could add, divide, multiply, substract member to member the equations. Gaussian elimination, as told, which is equivalent to the last form, but in an algorithmic way. You can use Cramers rule, Cholesky, LU, etc. This last ones seem too complicated for your case.


So, all this bla bla. If you want to do this systematically, or with a computer(MatLAB, Octave, etc) I'd just put it in matrix form and solve. That would require det(A) different from zero, which would be your case if my guess was right.

This is your system:
http://www.wolframalpha.com/input/?i=+% ... %7BA%7D%7D

Which you solve by multiplying by the inverse of a1,b1,c1.. on the left side. Which exists if the det(a1,b1,c1..) is not zero. And you're left with the following
http://www.wolframalpha.com/input/?i=%7 ... %7BA%7D%7D


Wolfram even solved it for you. Hope that clears out your problem.. or maybe it generated more. Just let me know.


PS:

If y=0, then you only have a two unknown system, with 3 equations. It is overdetermined.
From equation 3:
a3*x+b3*0+0*z=A
which yields x=A/a3 which you can plug into equation 1 and 2, and check if you get the result. But by no means it's (0,0,0) if you defined y=0 and c3=0.
Come back 747, we miss you!!

timbo
timbo
111
Joined: 22 Oct 2007, 10:14

Re: A math question

Post

Thanks guys, so I kinda found where the problem was.
It seems that usual analytical methods don't work if all three A are equal.
So if the system is like this:
a1*x+b1*y+c1*z = B
a2*x+b2*y+c2*z = A
a3*x+b3*y+c3*z = A
then all is good.
It is still possible to get answer iterationally if with all three As though.
Haven't heard of such limitation.

piast9
piast9
20
Joined: 16 Mar 2010, 00:39

Re: A math question

Post

For sure the problem is not caused by all constants on the right hand side equal. Unless there's a zero you may divide each equation by that right hand side constant obtaining "1" in each row.

Probably if you have a problem then the equations are not linearly independent but then there's no solution for any of the methods. Could you give the exact example which doesn't work for you?

timbo
timbo
111
Joined: 22 Oct 2007, 10:14

Re: A math question

Post

For example:

0.5x+0.1y+0.4z=49
0.35x+0.125y+0.525z=49
0.98x+0.02y=49

piast9
piast9
20
Joined: 16 Mar 2010, 00:39

Re: A math question

Post

Here we go. Gauss elimination in matrix notation gives:

start:
0.5 0.1 0.4 49
0.35 0.125 0.525 49
0.98 0.02 0 49

multiply second and third row by 0.5/0.35 and 0.5/0.98 respectively:

0.5 0.1 0.4 49
0.5 0.178571 0.75 70
0.5 0.0102040 0 25

eliminate first variable from last two rows by subtracting first row from them:

0.5 0.1 0.4 49
0 0.07857 0.35 21
0 -0.089795 -0.4 -24

now multiply third row by 0.07857/(-0.089795)

0.5 0.1 0.4 49
0 0.07857 0.35 21
0 0.08757 0.35 21

And here we go. Using linear combinantion of equation we obtained two identical ones thus your equation system is not possible to solve. It would look nicer if you used common fractions instead of decimals but the result would be the same. I don't know how you could obtain any solution using iterative method.

timbo
timbo
111
Joined: 22 Oct 2007, 10:14

Re: A math question

Post

piast9 wrote: I don't know how you could obtain any solution using iterative method.
The solution is x=50, y=0, z=60.

I'm puzzled as to why this set can't seem to converge on anything analytically.

Caito
Caito
13
Joined: 16 Jun 2009, 05:30
Location: Switzerland

Re: A math question

Post

the rank of your matrix A is 2. That means you have only 2 independent equations, as told. You can't invert the matrix and have your solution as x=inv(A)*B, matrix A is singular.


See for example:
[49.719;13.789,56.904] is also a solution.

As I told you before, your problem is underdetermined. In this case you have infinite solutions.

You'll converge to something of the form x+y+z=1, and all the points that fulfill such relations are solutions to your equations. You won't converge to x=2,y=3,z=4.
Come back 747, we miss you!!

timbo
timbo
111
Joined: 22 Oct 2007, 10:14

Re: A math question

Post

Ah, thanx! It makes sense!