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

  • A
  • Thread starter Thread starter tjosan
  • Start date Start date
  • Tags Tags
    System of equations
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 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).
 
I asked online questions about Proposition 2.1.1: The answer I got is the following: I have some questions about the answer I got. When the person answering says: ##1.## Is the map ##\mathfrak{q}\mapsto \mathfrak{q} A _\mathfrak{p}## from ##A\setminus \mathfrak{p}\to A_\mathfrak{p}##? But I don't understand what the author meant for the rest of the sentence in mathematical notation: ##2.## In the next statement where the author says: How is ##A\to...
The following are taken from the two sources, 1) from this online page and the book An Introduction to Module Theory by: Ibrahim Assem, Flavio U. Coelho. In the Abelian Categories chapter in the module theory text on page 157, right after presenting IV.2.21 Definition, the authors states "Image and coimage may or may not exist, but if they do, then they are unique up to isomorphism (because so are kernels and cokernels). Also in the reference url page above, the authors present two...
When decomposing a representation ##\rho## of a finite group ##G## into irreducible representations, we can find the number of times the representation contains a particular irrep ##\rho_0## through the character inner product $$ \langle \chi, \chi_0\rangle = \frac{1}{|G|} \sum_{g\in G} \chi(g) \chi_0(g)^*$$ where ##\chi## and ##\chi_0## are the characters of ##\rho## and ##\rho_0##, respectively. Since all group elements in the same conjugacy class have the same characters, this may be...
Back
Top