R
RL
How do I calculate simultaneous equations?
....Niek Otten said:Can probably done using Solver. I'm more used to Goal seek, so I
rework to one variable
I use cell A2 for x and B2 for y.
Reworking 21x+6y=10:
x = (10-6y)/21
So the formula in A2 is:
=(10-6*B2)/21
++++++++++++++++++++++++++++++++++++++++++++++++=Niek Otten said:<This can be completely solved analytically>
I know, Harlan. Many complex problems can be solved analytically. We don't
need computers at all, apart from solving crossword
puzzles.
But I'm sure I'm not alone in preferring an iterative approach if there is
an easy one.
If the first equation would have been more complex, I wouldn't even have
tried.
Ten lines of algebra is ten lines of possible errors. It is for me. I'm
sure it is for some others. I'm certain it is for the many
who are not familiar with the algebraic approach.
I think your limit of 10 lines is just *your* figure. Nothing to do with
an objective limit.
I will not try to turn this forum into a math class.
I admit there are posters who are better helped with some education, like
in the many questions about percentages.
--
Kind regards,
Niek Otten
Microsoft MVP - Excel
| >Can probably done using Solver. I'm more used to Goal seek, so I
| >rework to one variable
| >
| >I use cell A2 for x and B2 for y.
| >
| >Reworking 21x+6y=10:
| >x = (10-6y)/21
| >So the formula in A2 is:
| >=(10-6*B2)/21
| ...
|
| Not enough algebra. This can be completely solved analytically. Just
| substitute your expression for x based on the first equation into the
| second equation. First simplify: 6y appears in both equations, so
| replace it with z = 6y.
|
| 21x + z = 10
| (7x - 20)^2 + (z + 10)^2 = 200
|
| z = 10 - 21x
|
| Then substitute the RHS for z in the second equation.
|
| (7x - 20)^2 + (10 - 21x + 10)^2 = 200
| (7x - 20)^2 + (20 - 21x)^2 = 200
| 49x^2 - 280x + 400 + 400 - 840x + 441x^2 = 200
| 490x^2 - 1120x + 800 = 200
| 49x^2 - 112x + 60 = 0
|
| So x has 2 solutions
|
| 56/49 + (3136/2401 - 60/49)^0.5 and 56/49 - (3136/2401 - 60/49)^0.5
|
| and y also has two solutions. Solver will only find one, depending on
| the initial state of the variable cell. Also, the Solver solution is
| approximate while the analytical solution is accurate to machine
| precision. Finally, as any who uses numerical analysis in their job
| will tell you, if all it takes is 10 or fewer lines of algebra to
| reach an exact solution, that ALWAYS preferable to ANY iterative
| approach.
Niek Otten said:<Goal Seek seems to permit far less user control>
I don't think so. Goal Seek takes its parameters from the Iteration
dialog: the max number of "iterations" and the maximum change,
which can be set to what Harlan called "machine precision".
Not that I want to restart the discussion about how desirable such a
solution is, just to indicate that accuracy should not be an
issue.
--
Kind regards,
Niek Otten
Microsoft MVP - Excel
| Solver's default settings greatly limit its accuracy, but I can usually
tweak
| it to get what I want. Goal Seek seems to permit far less user control.
| However, I suspect that most algorithms would perform poorly when asked
to
| numerically solve an n-dimensional problem that analytically reduces to
an
| n-k (k>0) dimensional problem. Do the analytical reduction as Harlan
| suggested, then apply appropriate methods to the problem that remains.
|
| If the algebra is tedious, download Maxima
| http://maxima.sourceforge.net
| which is a free symbolic math program. In Maxima,
| solve ([21*x+ 6*y = 10, (7*x-20)^2+(6*y+10)^2=200], [x,y]);
| returns the two solutions to the reduced quadratic equation
| [x=10/7,y=-10/3],[x=6/7,y=-4/3]
| With more complicated equations, you might get a reduction that actually
| requires a numerical solution, but with a clear picture of the actual
| dimensionality of the problem, Solver will perform much better.
|
| Jerry
|
| "David A. Heiser" wrote:
|
| > Using Solver to solve these equation sets is a disaster. You cannot
rely on
| > the accuracy of the results, which generally are only accurate to 2-3
| > decimal digits. Most of the time it is not accurate to any decimal
digit.
| > The algorithm is faulty.
| >
| > David Heiser
Niek Otten said:<This can be completely solved analytically>
I know, Harlan. Many complex problems can be solved analytically.
We don't need computers at all, . . .
....But I'm sure I'm not alone in preferring an iterative approach if
there is an easy one.
I think your limit of 10 lines is just *your* figure. Nothing to do
with an objective limit.
I will not try to turn this forum into a math class.
Niek Otten said:I don't think so. Goal Seek takes its parameters from the Iteration
dialog: the max number of "iterations" and the maximum change,
which can be set to what Harlan called "machine precision".
Not that I want to restart the discussion about how desirable such
a solution is, just to indicate that accuracy should not be an
issue.
Niek Otten said:<maximum change can't be set to machine precision>
Of course there is no such thing as "machine precision", but I used
your words because it's a nice way to describe precision of the
algorithms used.
....If I set Maximum change to 0.000000000000001 I get the same answer
as with your formula, in both cases (using Excel) with same number
of significant digits: 1.42857142857143. . . .