C++ solving set of linear equations

Discussion in 'Programming' started by promotingspace.net, Oct 5, 2008.

  1. #1
    Hello
    Our professor has asked us to program a power load flow script.
    He said that we are not allowed to use MATLAB! so this is the problem and I don't know how calculate the jacobian matrix or matrix inverse or other calculations when I'm not allowed to use MATLAB
    I have some basic knowledge of C++ and want to write my script using C++
    The main problem is solving a set of linear equations with n variables and n equations
    I used to use MATLAB functions like ( inv => inverse ) to calculate inverse of a matrix and solve the equations. But now how can I solve a set of equations using C++?
    any help would be very appreciated.
     
    promotingspace.net, Oct 5, 2008 IP
  2. thewpdev

    thewpdev Well-Known Member

    Messages:
    137
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    103
    #2
    Pm sent :) Have a look and let me know .
     
    thewpdev, Oct 5, 2008 IP
  3. promotingspace.net

    promotingspace.net Peon

    Messages:
    361
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #3
    thanks for your attention. but i want to learn how to do this and i was asked to do it myself
     
    promotingspace.net, Oct 5, 2008 IP
  4. Testing whiz

    Testing whiz Peon

    Messages:
    14
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    I think you can calculate matrix value once you put it into the multidimensional array and follow the same formula which we use to find the metrix value on paper. Just fetch correct indexed element from the array and store the result in different variables.
     
    Testing whiz, Feb 3, 2010 IP
  5. TimothyJohn

    TimothyJohn Member

    Messages:
    786
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    35
    #5
    y=mx+c is the equation for linear i believe. Put it in a multidimensional array and use the variables to calculate your output :)
     
    TimothyJohn, Feb 3, 2010 IP