Solving for a 3D point in a 5D graph given 3 pairs of 2D points.

208 Views Asked by At

I am attempting to solve the values $C$, $D$, and $S$, given three pairs of $[M,R]$.

$$R = \frac {M}{C - MDC + DC\left(MS\right)^2}$$

I have been able to solve for a related equation (or rather, where $S = 0$) with two pairs of $[M,R]$

$$R = \frac {M}{C - MDC}$$

I solved $D$ by setting the formula to 1, then setting $F(M,R,D,C)$ to be $F(M_1,R_1,D,C) = F(M_2,R_2,D,C)$:

$$\frac {RC - MRDC}{M} = 1$$

$$\frac {R_1C - M_1R_1DC}{M_1} = \frac {R_2C - M_2R_2DC}{M_2}$$

$D = \frac {M_1R_2 - M_2R_1}{M_2M_1R_2 - M_2M_1R_1}$ and thus $C = \frac {M_1}{R_1 - M_1R_1D}$, noting that I could also use $[M_2,R_2]$ just as easily to find $C$.

Attempting the same trick with the S version of the formula gets me:

$$\frac {R_1C - M_1R_1DC + M_1^2R_1DCS^2}{M_1} = \frac {R_2C - M_2R_2DC + M_2^2R_2DCS^2}{M_2} = \frac {R_3C - M_3R_3DC + M_3^2R_3DCS^2}{M_3}$$

I got to $D$ by realizing that pluging in $[M_1,R_1]$ and $[M_2,R_2]$ was enough to get me two 2D slices of the $S$less version, and then it was just a matter of finding at what 2D point $[C,D]$ those slices intersect. I feel it should be the same with the full version, just getting three 3D slices and finding what 3D point $[C,D,S]$ those slices intersect.

I'm afraid it may end up being all for naught as those 3D slices may end up intersecting at 0, 1, or many points. I could eliminate some of those points with some outside constraints. $M$,$R$, and $D$ are magnitudes, thus can't be negative. The hyper simplified version of the formula $R = \frac {M}{C}$ won't allow $C$ to be negative due to the above constraints.

As far as I can tell, I need to solve for $S$, which I can then use to find $D$ via $D = \frac {M_1R_2 - M_2R_1}{M_2M_1R_2 - M_2M_1R_1 + M_2M_1^2R_1S^2 - M_2^2M_1R_2S^2}$ and then $C$ via $C = \frac {M_1}{R_1 - M_1R_1D + M_1^2R_1DS^2}$.

Am I even on the right track to solving the equation?

1

There are 1 best solutions below

3
On BEST ANSWER

I am rewriting the problem as $$\left. y = \dfrac{x}{C_0+C_1 x+C_2 x^2} \right\}\;(C_0+C_1 x+C_2 x^2)y = x$$ with the constants $C_0=C$, $C_1=-C D$ and $C_2=C D S^2$ and $x=M$, $y=R$

You want to find the coefficients $C_0$, $C_1$, and $C_2$ given 3 pairs of $(x_i,y_i)$

This can be treated as a 3×3 linear system when the three points are used in $C_0 y_i + C_1 x_i y_i + C_2 x_i^2 y_i = x_i$

$$\begin{bmatrix} x_1 \\ x_2 \\ x_3 \end{bmatrix} = \begin{vmatrix} y_1 & x_1 y_1 & x_1^2 y_1 \\y_2 & x_2 y_2 & x_2^2 y_2 \\ y_3 & x_3 y_3 & x_3^2 y_3 \end{vmatrix} \begin{bmatrix} C_0 \\ C_1 \\ C_2 \end{bmatrix} $$

Once the coefficients are solved they solution is $$\begin{aligned} C &= C_0 & D &= -\frac{C_1}{C_0} & S^2 &= - \frac{C_2}{C_1} \end{aligned}$$

Using a symbolic solver I got

$$ \begin{aligned} C_0 &= \frac{x_1 x_2 x_3 (x_1 y_1 (y_2-y_3)+x_2 y_2 (y_3-y_1)+x_3 y_3 (y_1-y_2))}{y_1 y_2 y_3 (x_1-x_2) (x_1-x_3) (x_2-x_3)} \\ C_1 &= \frac{x_1 y_2 y_3 (x_3^2-x_2^2)-y_1 (x_3 y_2 (x_1^2-x_2^2)+x_2 y_3 (x_3^2-x_1^2))}{y_1 y_2 y_3 (x_1-x_2) (x_1-x_3) (x_2-x_3)} \\ C_2 &= \frac{x_2 x_3 y_1 (y_3-y_2)-x_1 x_2 y_3 (y_1-y_2)+x_1 x_3 y_2 (y_3-y_1)}{y_1 y_2 y_3 (x_1-x_2) (x_1-x_3) (x_2-x_3)} \end{aligned} $$

I used a symbolic algebra solver to check this result:

check