1. Not finding help here? Sign up for a free 30min tutor trial with Chegg Tutors
    Dismiss Notice
Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

4 Equations and 4 Unknowns

  1. Aug 5, 2013 #1

    A&X

    User Avatar

    1. The problem statement, all variables and given/known data

    Hello,

    Although this could be labeled as an EE problem, this is more of an Algebra problem. Anyways, I am having a very hard time solving for the following 4 equations with 4 unknonws.

    269.0 = R1*(R2+R3+R4)/(R1+R2+R3+R4)

    267.8 = R2*(R1+R3+R4)/(R1+R2+R3+R4)

    265.8 = R3*(R1+R2+R4)/(R1+R2+R3+R4)

    267.3 = R4*(R1+R2+R3)/(R1+R2+R3+R4)



    2. Relevant equations

    Can I set R2 & R3 = 0 to make it easier to simplify it?



    3. The attempt at a solution

    This is what I was able to narrow it down to:

    R4=267.3(R1+R2+R3)/(R1+R2+R3-267.3)
    R3=268.8(R1+R2+R4)/(R1+R2+R4-268.8)
    R2=267.8(R1+R3+R4)/(R1+R3+R4-267.8)
    R1=269.0(R2+R3+R4)/(R2+R3+R4-269.0)

    I don't know what to do from here on now. When I tried replacing R1 into R2, R2 into R3, etc. it just kept getting messier and it didn't lead to anything promising.

    So I figured I set R2 & R3 = 0 to make it easier, but I don't know if I am allowed to do that. Can someone please lead me to the right direction?

    Your help is much appreciated,

    Thank you.
     
  2. jcsd
  3. Aug 5, 2013 #2

    jedishrfu

    Staff: Mentor

    I guess I'd try a numerical solution (ie write a program) trying all combinations of r1, r2, r3 and r4 within a given range. I can't see any way to reduce it algebraically and I don't think assuming r2=r3=0 will help either.

    What if you tried multiplying both sides by (r1+r2+r3+r4) and then tried doing linear algebra on it to cancel righthand side terms like r2*r3 vs r3*r2 (subtract eqn3 from eqn2 ...)? I didn't try it but it probably still gets messy.
     
  4. Aug 5, 2013 #3
    I don't think there is a way to do it analytically.

    Run it through your favorite computer program, there are many solutions.
     
  5. Aug 5, 2013 #4

    A&X

    User Avatar

    Thank you for all the response.

    Using Matlab to solve, I think this is what the code would be:

    [R1,R2,R3,R4]=solve('R1=269.0(R2+R3+R4)/(R2+R3+R4-269.0)','R2=267.8(R1+R3+R4)/(R1+R3+R4-267.8)','R3=268.8(R1+R2+R4)/(R1+R2+R4-268.8)','R4=267.3(R1+R2+R3)/(R1+R2+R3-267.3)','R1','R2','R3','R4')

    However, I do not have access to matlab at the moment to check. Correct me if I am wrong
     
  6. Aug 5, 2013 #5

    jedishrfu

    Staff: Mentor

    Okay, MATLAB says:

    Undefined function 'solve' for input arguments of type 'char'.
     
  7. Aug 5, 2013 #6

    rcgldr

    User Avatar
    Homework Helper

    I created a program to search for values with minimum least square difference, to 4 digits I get:

    R1 = 359.6940
    R2 = 357.2815
    R3 = 353.2965
    R4 = 356.2810

    but this doesn't actually solve the 4 equations.
     
  8. Aug 5, 2013 #7

    gneill

    User Avatar

    Staff: Mentor

    It is a numerical solution. There are many cases in practice where sets of equations are intractable algebraically and numerical solutions are required.
     
  9. Aug 5, 2013 #8
    I have a different way of approaching this problem that may work. Rewrite the first equation as:
    [tex]269.0 = R1*(R2+R3+R4)/(R1+R2+R3+R4)=R1*(R1+R2+R3+R4-R1)/(R1+R2+R3+R4)[/tex][tex]269.0=R1-\frac{(R1)^2}{(R1+R2+R3+R4)}[/tex]
    Next:
    [tex]\frac{269.0}{(R1+R2+R3+R4)}=\frac{R1}{(R1+R2+R3+R4)}-\frac{(R1)^2}{(R1+R2+R3+R4)^2}[/tex]
    Equivalently:
    [tex]\frac{269.0}{y}=x_1-(x_1)^2[/tex]
    where y=(R1+R2+R3+R4) and [itex]x_1=\frac{R1}{(R1+R2+R3+R4)}=\frac{R1}{y}[/itex]
    From the other equations, we have:
    [tex]\frac{267.8}{y}=x_2-(x_2)^2[/tex][tex]\frac{265.8}{y}=x_3-(x_3)^2[/tex][tex]\frac{267.3}{y}=x_4-(x_4)^2[/tex]
    Clearly, [itex]x_1+x_2+x_3+x_4=1[/itex]
    If we solve the first equation for x1 in terms of y, we obtain:
    [tex]x_1=\frac{1-\sqrt{1-\frac{(4)(269.0)}{y}}}{2}[/tex]
    (I'm guessing that the minus sign is the correct one to use.)
    We obtain similar equations for x2, x3, and x4. If we add the four solutions for the x's together, we eliminate the x's using [itex]x_1+x_2+x_3+x_4=1[/itex], and obtain a single equation in one unknown for y.
     
  10. Aug 6, 2013 #9

    rcgldr

    User Avatar
    Homework Helper

    an equation with 4 roots, which could be another issue.

    Here is the source code to the program I used:
    Code (Text):

    /* 269.0 = R1*(R2+R3+R4)/(R1+R2+R3+R4) */
    /* 267.8 = R2*(R1+R3+R4)/(R1+R2+R3+R4) */
    /* 265.8 = R3*(R1+R2+R4)/(R1+R2+R3+R4) */
    /* 267.3 = R4*(R1+R2+R3)/(R1+R2+R3+R4) */

    #include <stdio.h>
    #include <math.h>

    static double A[4] =            /* equation values, actual */
        {269.0, 267.8, 265.8, 267.3};
    static double B[4], C[4];       /* equation values, best, current */
    static double R[4], S[4];       /* variables, best, current */
    static double SMIN[4], SMAX[4]; /* range for current variables */
    static double BLSQ, CLSQ;       /* least squares, best, current */
    static double DS;               /* delta step */

    int main(void)
    {
        BLSQ = 100000000.;          /* init best least squares to large value */
        DS   = 1000.;               /* init delta step */
        R[0] = 1000.;               /* init variables */
        R[1] = 1000.;
        R[2] = 1000.;
        R[3] = 1000.;
        while(DS > .0000005){
            SMIN[0] = R[0]-DS;      /* set ranges */
            SMIN[1] = R[1]-DS;
            SMIN[2] = R[2]-DS;
            SMIN[3] = R[3]-DS;
            SMAX[0] = R[0]+DS;
            SMAX[1] = R[1]+DS;
            SMAX[2] = R[2]+DS;
            SMAX[3] = R[3]+DS;
            DS /= 10.;
            for(S[0] = SMIN[0]; S[0] <= SMAX[0]; S[0] += DS){    
                for(S[1] = SMIN[1]; S[1] <= SMAX[1]; S[1] += DS){    
                    for(S[2] = SMIN[2]; S[2] <= SMAX[2]; S[2] += DS){    
                        for(S[3] = SMIN[3]; S[3] <= SMAX[3]; S[3] += DS){    
                            C[0] = S[0]*(S[1]+S[2]+S[3])/(S[0]+S[1]+S[2]+S[3]);
                            C[1] = S[1]*(S[0]+S[2]+S[3])/(S[0]+S[1]+S[2]+S[3]);
                            C[2] = S[2]*(S[0]+S[1]+S[3])/(S[0]+S[1]+S[2]+S[3]);
                            C[3] = S[3]*(S[0]+S[1]+S[2])/(S[0]+S[1]+S[2]+S[3]);
                            CLSQ =  (A[0]-C[0])*(A[0]-C[0]) +
                                    (A[1]-C[1])*(A[1]-C[1]) +
                                    (A[2]-C[2])*(A[2]-C[2]) +
                                    (A[3]-C[3])*(A[3]-C[3]);
                            if(CLSQ < BLSQ){    /* if new best */
                                BLSQ = CLSQ;    /*   update params */
                                B[0] = C[0];
                                B[1] = C[1];
                                B[2] = C[2];
                                B[3] = C[3];
                                R[0] = S[0];
                                R[1] = S[1];
                                R[2] = S[2];
                                R[3] = S[3];
                            }
                        }
                    }
                }
            }
            printf("A = %12.7lf %12.7lf %12.7lf %12.7lf\n",A[0],A[1],A[2],A[3]);
            printf("B = %12.7lf %12.7lf %12.7lf %12.7lf\n",B[0],B[1],B[2],B[3]);
            printf("R = %12.7lf %12.7lf %12.7lf %12.7lf\n",R[0],R[1],R[2],R[3]);
            printf("\n");
        }
        return(0);
    }
     
     
    Last edited: Aug 6, 2013
  11. Aug 6, 2013 #10
    Mathematica is able to find exact solutions, but they are VERY complicated. Here is an example of just one solution for R1:

    attachment.php?attachmentid=60705&stc=1&d=1375767430.jpg

    Numerically, here is a solution good to quite a few decimal places, with the four expressions evaluated with the solution, showing its accuracy:

    attachment.php?attachmentid=60706&stc=1&d=1375767430.png
     

    Attached Files:

  12. Aug 6, 2013 #11
    This physical problem is going to have only one physically realistic answer. I can obtain a very accurate numerical solution to that answer by hand with very little effort. From my previous post, the algebraic equation I get for y is as follows:
    [tex]\sqrt{\frac{1}{4}-\frac{(269.0)}{y}}+\sqrt{\frac{1}{4}-\frac{(267.8)}{y}}+\sqrt{\frac{1}{4}-\frac{(265.8)}{y}}+\sqrt{\frac{1}{4}-\frac{(267.3)}{y}}=1[/tex]
    To solve this numerically, all I need is a good initial guess for y:
    [tex]y^{(0)}=\frac{4s}{3}[/tex]
    where s = (269.0+267.8+265.8+267.3)
    and then I write:
    [tex]y=\frac{4s}{3}+δ[/tex]
    where δ is the parameter I will be solving for.
    I also write:
    [tex]269.0=\frac{s}{4}+(269.0-\frac{s}{4})[/tex]
    where [itex](269.0-\frac{s}{4})[/itex] is small compared to s/4
    I write similar equations for the other three values. I then substitute into the equation for y, and linearize with respect to δ. I then solve the simple linear equation for δ. I guarantee this will give an accurate answer for y.
     
  13. Aug 6, 2013 #12

    epenguin

    User Avatar
    Homework Helper
    Gold Member

    Because the LHS all nearly equal, if you are doing it by successive approximations R1=R2=R3=R4 will give you an R s that are all close to a solution.

    They will probably be the engineering one, not obvious whether it is the only one
     
  14. Aug 6, 2013 #13

    A&X

    User Avatar

    Thank you all for all the inputs. This problem is for a strain gage with values in a closed bridge with 4 measurements (for those who were curious what this problem was about).

    Here's how I was able to solve it using Matlab:

    >>equ1='269.0-R1*(R2+R3+R4)/(R1+R2+R3+R4)';
    >>equ2='267.8-R2*(R1+R3+R4)/(R1+R2+R3+R4)';
    >>equ3='265.8- R3*(R1+R2+R4)/(R1+R2+R3+R4)';
    >>equ4='267.3 - R4*(R1+R2+R3)/(R1+R2+R3+R4)';
    >>sol=solve(equ1,equ2,equ3,equ4);
    >>R1=sol.R1
    >>R2=sol.R2
    >>R3=sol.R3
    >>R4=sol.R4

    R1 =

    359.69396536017785860423709040818
    1.3507021132304585888310244089084
    -0.15281241991439544414763284998392
    1.8490642922477590181409957542694


    R2 =

    357.28145453217212584831447055658
    -1.3544948044533407508506455121324
    0.15238453051809368598400290995311
    1.8449211357365443870556345198613


    R3 =

    353.29653057117303395043663397118
    -1.3494402487364598096284603749859
    -0.1519010380142547092615828782759
    -1.8507933465933516936061609699429


    R4 =

    356.28105339639228188360351205007
    1.3464165716255193771005390620164
    0.15224216764211807620525039756688
    -1.8559902351679833508578661774425

    And since R's cannot be negative, the only possible solution would be:
    R1= 359.69396536017785860423709040818
    R2=357.28145453217212584831447055658
    R3=353.29653057117303395043663397118
    R4=356.28105339639228188360351205007
     
  15. Aug 7, 2013 #14
    For whatever it's worth, I completed the linearized analysis of this problem that I outlined in my two previous posts in this thread. The final analytic results came out very simple, and the calculations can be readily done on a hand calculator:
    [tex]R_j=2L_j-\frac{(L_1+L_2+L_3+L_4)}{6}[/tex]
    where, in this example,

    L1=269.0
    L2=267.8
    L3=265.8
    L4=267.3

    The results agree with the Matlab values to one unit in the fifth significant figure.

    Chet
     
  16. Aug 7, 2013 #15

    A&X

    User Avatar

    I checked your formula with different values for L's and compared with the matlab code and it is actually pretty accurate.

    In fact, with this formula I can make a spreadsheet on excel which is much more user friendly. Thank you Chestermiller!
     
  17. Aug 7, 2013 #16

    A&X

    User Avatar

    By the way Chestermiller, I tried following your work and I was able to follow along for the most part. However, one step you did that i cannot figure it out how you did it is the third step.

    How do you go from: 269.0=R1∗(R1+R2+R3+R4−R1)/(R1+R2+R3+R4)
    To: 269.0= R1− (R1)^2/(R1+R2+R3+R4)
     
  18. Aug 7, 2013 #17
    You are going to kick yourself when you see this.
    [tex]269.0=R1\frac{(R1+R2+R3+R4−R1)}{(R1+R2+R3+R4)}=R1\left(\frac{(R1+R2+R3+R4)}{(R1+R2+R3+R4)}-\frac{R1}{(R1+R2+R3+R4)}\right)[/tex]
    Chet
     
  19. Aug 7, 2013 #18

    A&X

    User Avatar

    Wow...how emberassing of me :shy:
     
  20. Aug 7, 2013 #19

    rcgldr

    User Avatar
    Homework Helper

    I tried this and there are some differences, but it could be the the formula is correct, and that the L values have a relationship that doesn't quite match the stated values due to just 4 digits of precision. The first set of values are what I get from my program and match the matlab results to 10 digits. The second set of values are what I get from the linear formula:

    Code (Text):

    R =  359.6939654  357.2814545  353.2965306  356.2810534
    L =  269.0000000  267.8000000  265.8000000  267.3000000

    R =  359.6833333  357.2833333  353.2833333  356.2833333
    L =  268.9934789  267.7997038  265.7921330  267.2999141
     
    If you substitute the L's for the R's in the original equation, say just the first one, does it work out?

    L1 = R1*(R2+R3+R4) / (R1+R2+R3+R4) = (2*L1 - (L1+L2+L3+L4)/6)(...) / (...) ?
     
    Last edited: Aug 7, 2013
  21. Aug 7, 2013 #20
    The equation I gave is an approximate solution to the equations, obtained by linearizing them. I'm sure you will agree that getting a solution that is accurate to 4 significant figures isn't too bad, especially since the input data is only accurate to 4 significant figures and since the approximate solution is so simple to implement (not requiring a computer).

    Chet
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Have something to add?
Draft saved Draft deleted



Similar Discussions: 4 Equations and 4 Unknowns
  1. 4 point bending (Replies: 1)

Loading...