Dismiss Notice
Guest, I have a big favor to ask you. We've been working very hard to establish ourselves on social media. If you like/follow our pages it would be a HUGE help to us. SoSH on Facebook and Inside the Pylon Thanks! Nip

Software for Solving System of 8 Simultaneous Equations

Discussion in 'BYTE ME: Technology discussion' started by djbayko, Feb 24, 2018.

  1. djbayko

    djbayko Member SoSH Member

    Messages:
    6,587
    Does anyone know of any free software that is powerful enough to solve a system of 8 equations and 8 unknowns? Alternatively, does anyone have any paid software that can do it for me? This is a one-time need. All of the installable / online solvers that I've used in the past can only handle up to 6 equations.

    Equations:
    p=R_1*M_1-R_1
    p=R_2*M_2-R_2
    p=R_3*M_3-R_3
    p=R_4*M_4-R_4
    p=R_5*M_5-R_5
    p=R_6*M_6-R_6
    p=R_7*M_7-R_7
    p=R_8*M_8-R_8
    R_1+R_2+R_3+R_4+R_5+R_6+R_7+R_8=S

    Looking to Solve For:
    p
    R_1
    R_2
    R_3
    R_4
    R_5
    R_6
    R_7
    R_8
     
  2. Capnswill

    Capnswill Member SoSH Member

    Messages:
    162
  3. swiftaw

    swiftaw Member SoSH Member

    Messages:
    1,731
    Will wolframalpha do it?
     
  4. djbayko

    djbayko Member SoSH Member

    Messages:
    6,587
    Thanks. I already found Octave, but I was having trouble translating my equations into the matrix format required by the program. I guess the software I've used in the past allowed you to paste in the equations as-is, and it would interpret them for you.

     
  5. swiftaw

    swiftaw Member SoSH Member

    Messages:
    1,731
    Although, looking this, it should be easily solvable by hand (if I’m reading it right).

    You have that R_i = p/(M_i-1) for i=1,...,8

    Let C_i =1/(M_i - 1)

    So you have C_1*p + C_2*p + ... + C_8*p = S

    So p = S/(C_1 + ... + C_8)

    Which you can then plug into the first equation to find the R’s
     
  6. Mr. Wednesday

    Mr. Wednesday lurker

    Messages:
    946
    If you don't mind writing out the matrices, Excel has matrix multiply and matrix inverse functions, so you could use that too.
     
  7. djbayko

    djbayko Member SoSH Member

    Messages:
    6,587
    Brilliant!

    Thank you so much. Now I can stop watching these math software tutorials :)

    Problem solved </thread>
     
  8. Capnswill

    Capnswill Member SoSH Member

    Messages:
    162
    This ought to work in octave, obviously don't set M_1 .. M_8 as rand though

    M_1 = rand(1);
    M_2 = rand(1);
    M_3 = rand(1);
    M_4 = rand(1);
    M_5 = rand(1);
    M_6 = rand(1);
    M_7 = rand(1);
    M_8 = rand(1);
    S = rand(1);

    A = [[diag([M_1-1,M_2-1,M_3-1,M_4-1,M_5-1,M_6-1,M_7-1,M_8-1]),-ones(8,1)];[ones(1,8),0]];
    b = [zeros(8,1); S];

    soln = A \ b;
    R_1 = soln(1)
    R_2 = soln(2)
    R_3 = soln(3)
    R_4 = soln(4)
    R_5 = soln(5)
    R_6 = soln(6)
    R_7 = soln(7)
    R_8 = soln(8)
    p = soln(9)

    Though solving by hand also works.
     
  9. jhp64

    jhp64 Member SoSH Member

    Messages:
    143
    For the record, SageMath is free software that will solve this sort of thing. It has a cloud-based interface called CoCalc, so you don't actually have to install anything.
     
  10. TenCentBeerNight

    TenCentBeerNight Member SoSH Member

    Messages:
    5

Share This Page