View Single Post
Old 01-15-2013, 12:15 AM   #6
qqwref
stepmania archaeologist
Retired StaffFFR Simfile AuthorFFR Veteran
 
qqwref's Avatar
 
Join Date: Aug 2005
Age: 34
Posts: 4,090
Default Re: [differential equations] stuck on a problem

For the linear equation one, first we set it up as a matrix equation of the form A*x=b:

Code:
[  1 -6  0  0 ]   [x1]   [5]
[  0  1 -4  1 ]   [x2]   [0]
[ -1  6  1  5 ] * [x3] = [3]
[  0 -1  5  4 ]   [x4]   [0]
To get a solution, the procedure is basically
- Find a row with the first variable, then delete some multiple of that row from every other row with that variable in it, so the first variable isn't in any other rows. Make sure to delete from both A and b, but not x.
- Find a row with the second variable and without the first variable, then delete some multiple of that row from every other row, so the second variable isn't in any other rows.
- Continue like that (always finding a row with the next variable, but with none of the variables you already did). Ideally you will end up with only one non-0 number in A in each row. However, if you are able to make one row of A completely zeroed, your equation has either zero solutions or multiple solutions.

So for this example, let's first eliminate x1 in all rows except the first, by adding the first row to the third row:
Code:
[  1 -6  0  0 ]   [x1]   [5]
[  0  1 -4  1 ]   [x2]   [0]
[  0  0  1  5 ] * [x3] = [8]
[  0 -1  5  4 ]   [x4]   [0]
Now let's take the second row, which has x2 but not x1. We add 6 times the second row to the first row, and add the second row to the fourth row:
Code:
[  1  0 -24 6 ]   [x1]   [5]
[  0  1 -4  1 ]   [x2]   [0]
[  0  0  1  5 ] * [x3] = [8]
[  0  0  1  5 ]   [x4]   [0]
Now let's take the third row, which has x3 but not x1 or x5. Add 4 times the third row to the second row, and 24 times the third row to the first row. Subtract the third row from the fourth row.
Code:
[  1  0  0 126]   [x1]   [197]
[  0  1  0 21 ]   [x2]   [ 32]
[  0  0  1  5 ] * [x3] = [  8]
[  0  0  0  0 ]   [x4]   [ -8]
Okay, so now our equations are x1 + 126*x4 = 197, x2 + 21*x4 = 32, x3+5*x4 = 8, and 0 = -8, assuming I did the arithmetic right. That last equation (0 = -8) is obviously impossible so this set of equations has no solutions! Too bad.



HOWEVER, if the numbers had been a little different, we might have ended up with something like this:
Code:
[  1  0  0  0 ]   [x1]   [5]
[  0  1  0  0 ]   [x2]   [6]
[  0  0  1  0 ] * [x3] = [3]
[  0  0  0  1 ]   [x4]   [7]
in which case there is one unique solution, which is just x = b, or in other words, x1 = 5, x2 = 6, x3 = 3, x4 = 7.
__________________
Best AAA: Policy In The Sky [Oni] (81)
Best SDG: PANTS (86)
Best FC: Future Invasion (93)

Last edited by qqwref; 01-15-2013 at 12:17 AM..
qqwref is offline   Reply With Quote