Getting as close as possible to a solution (system of equations)?

  • Context: Graduate 
  • Thread starter Thread starter tjosan
  • Start date Start date
  • Tags Tags
    System of equations
Click For Summary

Discussion Overview

The discussion revolves around solving a system of equations with the goal of minimizing the absolute values of the equations' outputs when no exact solution exists. Participants explore methods for calculating values of variables while adhering to constraints on positivity and the relationships between constants.

Discussion Character

  • Exploratory
  • Mathematical reasoning
  • Debate/contested

Main Points Raised

  • One participant presents a system of equations and seeks to minimize the absolute values of the outputs, suggesting a method involving iterative adjustments to variables.
  • Another participant proposes a loose procedure for approaching the problem, detailing steps to solve for certain variables first and then evaluate the overall outputs.
  • It is noted that the approach differs from least squares best fit, which minimizes the squares of the outputs instead of their absolute values.
  • A later reply mentions a preference for least squares due to its simplicity in implementation, particularly using matrix manipulation in Excel.
  • One participant expresses curiosity about whether there exists a formula or matrix operation analogous to least squares for minimizing the sum of absolute values of the outputs.
  • Another participant identifies a potential formula involving matrix inversion but notes the need to omit one row for optimal results, suggesting multiple calculations to determine the best outcome.

Areas of Agreement / Disagreement

Participants do not reach a consensus on the best method for minimizing the absolute values of the outputs. Multiple approaches are discussed, and there is uncertainty regarding the existence of a straightforward formula for this specific minimization problem.

Contextual Notes

Participants express varying levels of comfort with different mathematical techniques, and there are unresolved questions about the implications of omitting rows in matrix calculations. The discussion reflects a range of assumptions about the relationships between constants and variables.

tjosan
Messages
32
Reaction score
2
Hi,

I have a set of equations that look like this:

y1 = k1*x1 + k2*x2 - A1 = 0
y2 = k3*x1 + k4*x3 - A2 = 0
y3 = k5*x2 + k6*x4 - A3 = 0
y4 = k7*x3 - A4 = 0
y5 = k8*x4 - A5 = 0

k1 to k8 are known positive constants. A1 to A5 are known positive constants (I will use different values for A1 to A5 depending on the cirumstances).

Assuming this system does not have any solution, how do I calculate the values of x1 to x4 such that y1 to y5 come as close to 0 as possible? All constants must be positive.
 
Physics news on Phys.org
tjosan said:
Hi,

I have a set of equations that look like this:

y1 = k1*x1 + k2*x2 - A1 = 0
y2 = k3*x1 + k4*x3 - A2 = 0
y3 = k5*x2 + k6*x4 - A3 = 0
y4 = k7*x3 - A4 = 0
y5 = k8*x4 - A5 = 0

k1 to k8 are known positive constants. A1 to A5 are known positive constants (I will use different values for A1 to A5 depending on the cirumstances).

Assuming this system does not have any solution, how do I calculate the values of x1 to x4 such that y1 to y5 come as close to 0 as possible? All constants must be positive.
Apparently you are looking to minimize (abs(y1)+abs(y2)+abs(y3)+abs(y4)+abs(y5)). This is in contrast to least squares best fit where you would look to minimize (Y1^2+Y2^2+Y3^2+Y4^2+Y5^2).

The way you are doing it, the exact formula must take into consideration which k's are greater than which other k's.
But here is a loose procedure.

1) Solve for x3 and x4 using y4 and y5
2) Solve for x1 and x2 using y2 and y3, but keep x1 and x2 non-negative.
3) Evaluate all Y's
4) For each X, evaluate the changes to Sum(Y's) when X is increased and, for non-zero X, when X is decreased. So you have as many as 8 cases. In each case, the change to Sum(Y's) will be a sum or difference of some of the k's.
5) If none of these creates a net advantage, you are done.
6) Pick the X change that creates the fastest improvement, and apply that change to X until X reaches 0 or one of the Y's reaches 0.
7) Go back to step 3. This loop only ends in step 5.
 
  • Like
Likes   Reactions: tjosan
Thank you I will try it out!

The constants are in this order:
k5>k6>k3>k8>k4>k2>k1>k7
 
.Scott said:
Apparently you are looking to minimize (abs(y1)+abs(y2)+abs(y3)+abs(y4)+abs(y5)). This is in contrast to least squares best fit where you would look to minimize (Y1^2+Y2^2+Y3^2+Y4^2+Y5^2).

The way you are doing it, the exact formula must take into consideration which k's are greater than which other k's.
But here is a loose procedure.

1) Solve for x3 and x4 using y4 and y5
2) Solve for x1 and x2 using y2 and y3, but keep x1 and x2 non-negative.
3) Evaluate all Y's
4) For each X, evaluate the changes to Sum(Y's) when X is increased and, for non-zero X, when X is decreased. So you have as many as 8 cases. In each case, the change to Sum(Y's) will be a sum or difference of some of the k's.
5) If none of these creates a net advantage, you are done.
6) Pick the X change that creates the fastest improvement, and apply that change to X until X reaches 0 or one of the Y's reaches 0.
7) Go back to step 3. This loop only ends in step 5.

So I ended up going with least squares instead becase it was much easier (just manipulating matrices in excel). But I wonder if there is any formula for minimizing (abs(y1)+abs(y2)+abs(y3)+abs(y4)+abs(y5))? Is there any matrix operations similar to that of the least squares method?
 
I found the formula: A^-1*b. But I need to omit one row (thus make 5 different calculations and pick the best).
 

Similar threads

  • · Replies 2 ·
Replies
2
Views
1K
  • · Replies 3 ·
Replies
3
Views
3K
  • · Replies 10 ·
Replies
10
Views
1K
  • · Replies 14 ·
Replies
14
Views
4K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 10 ·
Replies
10
Views
3K
Replies
1
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 11 ·
Replies
11
Views
6K