Thread: Fractional Powers of a Matrix

  1. #1
    Registered User
    Join Date
    Aug 2011
    Posts
    3

    Fractional Powers of a Matrix

    Hi everyone ,
    I want to calculate fractional power of a matrix. How i will do it ? Is there any library related to matrix in c or c++?

    with regards
    bibhu .

  2. #2
    Banned
    Join Date
    Aug 2010
    Location
    Ontario Canada
    Posts
    9,547
    Yes there is and it's on sale this week for only $1500.00...

    Alternatively you could sit down and actually read up on arrays and figure out the 30 or so lines of code it would take for yourself.

    When handed a challenge don't go chasing libraries or prefabricated code... THINK about the task until you understand it, work out a solution, write the code, test the program... a very simple 4 step process.

    So, get started on this by yourself. Get your code as far along as you can. If you run into trouble post your code here --using code tags-- and we'll see what we can do.

    Homework Policy

  3. #3
    Registered User
    Join Date
    Aug 2011
    Posts
    3
    thanks for reply.
    Can you tell me how to start ?
    If the power is an integer the i may try to multiply the matrix that much of time but it is a fraction.So can you tell any algorithm so that i can start.

  4. #4
    Banned
    Join Date
    Aug 2010
    Location
    Ontario Canada
    Posts
    9,547
    What, you can't multiply fractions?

    Look it's all just numbers... why is this any harder than integers?
    Just make a matrix of float... as in float array[10][10] instead of int array[10][10]... load your matrix, then treat the numbers as numbers...

    Work the problem as I described... THINK, PLAN, DO, TEST... Don't be expecting us to do it for you.

  5. #5
    Registered User
    Join Date
    Aug 2011
    Posts
    3
    Actually my power is in fraction means if A is a matrix then i have to calculate A^0.5

  6. #6
    Banned
    Join Date
    Aug 2010
    Location
    Ontario Canada
    Posts
    9,547
    Ok... one more time... Get started on your own. Work the problem, don't beg for libraries and code... THINK it through.

    If it's the math that has you stymied, try a math forum...

    If you get stuck on the code, post what you've got and we'll try to help...
    This board's policies do not let us post "canned" code.

  7. #7
    Registered User
    Join Date
    Jul 2011
    Posts
    14
    Hi, bibhukalyana.

    If you don't feel like figuring it out, you could take a look at a program called MATLAB, which is an amazing tool for dealing with matrices.

    However, if you do want to figure it out, commontater (despite what could be misunderstood as rudeness, he's just tired of people coming to the board trying to get their problems solved without any effort)
    provides great outline in implementing code (in fact in all of problem solving):

    1) Find out the purpose of the problem (you're done that)
    2) Find the resources you will need to solve the problem
    3) Implement your solution
    4) Test and improve.

    I have just started learning matrices and I have just started learning programming so even if I wanted to help, I wouldn't be able to without spending too much time.
    So, best of luck.

  8. #8
    and the Hat of Guessing tabstop's Avatar
    Join Date
    Nov 2007
    Posts
    14,336
    As mentioned, you're going to have to first discover how to find powers of a matrix. Interestingly, it doesn't involve multiplying matrices together a bunch of times.

    Matrix (mathematics) - Wikipedia, the free encyclopedia

  9. #9
    Registered User
    Join Date
    Jul 2011
    Posts
    14
    Quote Originally Posted by tabstop View Post
    As mentioned, you're going to have to first discover how to find powers of a matrix. Interestingly, it doesn't involve multiplying matrices together a bunch of times.

    Matrix (mathematics) - Wikipedia, the free encyclopedia
    It really doesn't lol.
    As far as I've researched on the internet, it is not possible to find fractional exponent of a matrix. But then, internet could be wrong.
    I'm really interested in commontater's solution in this because he said it only requires around 30 lines.
    That's beastly right there lol.
    I can't even code within 30 lines reducing the matrix in an echelon form lolll

  10. #10
    and the Hat of Guessing tabstop's Avatar
    Join Date
    Nov 2007
    Posts
    14,336
    Quote Originally Posted by kpark91 View Post
    It really doesn't lol.
    As far as I've researched on the internet, it is not possible to find fractional exponent of a matrix. But then, internet could be wrong.
    The link I posted shows how to find the fractional exponent of a matrix.

  11. #11
    Registered User
    Join Date
    Jul 2011
    Posts
    14
    I've looked at it...
    Where is it?
    All I see that is related to exponenet is
    An = (VDV−1)n = VDV−1VDV−1...VDV−1 = VDnV−1

    Do you mean if you want to find A^(n/m), you should first perform A^n (B) and then B^(1/m) ???

    Sorry for so many questions.
    I read the whole article (more like reading it to find the word fraction since I'm having some trouble understanding the theories lol) and I can't seem to find it O_o

  12. #12
    and the Hat of Guessing tabstop's Avatar
    Join Date
    Nov 2007
    Posts
    14,336
    That's the one. D is just a diagonal matrix, so raising it to a power means you just put the power on the numbers on the diagonal.

  13. #13
    Registered User
    Join Date
    Jul 2011
    Posts
    14
    Quote Originally Posted by tabstop View Post
    That's the one. D is just a diagonal matrix, so raising it to a power means you just put the power on the numbers on the diagonal.
    Ahhh I remember noww haha;;

    Thank you!

    sounds like I really need to review my lin.alg. before I head back to school O_o

  14. #14
    Registered User
    Join Date
    May 2011
    Location
    Around 8.3 light-minutes from the Sun
    Posts
    1,949
    Quote Originally Posted by bibhukalyana View Post
    Hi everyone ,
    I want to calculate fractional power of a matrix. How i will do it ?
    bibhu .
    I would start with a matrix......

    Quote Originally Posted by CommonTater View Post
    Yes there is and it's on sale this week for only $1500.00...
    And if you act now, and order by credit card........

    Quote Originally Posted by bibhukalyana View Post
    thanks for reply.
    Can you tell me how to start ?
    1. Learn how to do it on paper.
    2. Lesson 3 - Loops
    3. Lesson 8 - Arrays

    And as always, never be scared to look it up yourself.
    Quote Originally Posted by anduril462 View Post
    Now, please, for the love of all things good and holy, think about what you're doing! Don't just run around willy-nilly, coding like a drunk two-year-old....
    Quote Originally Posted by quzah View Post
    ..... Just don't be surprised when I say you aren't using standard C anymore, and as such,are off in your own little universe that I will completely disregard.
    Warning: Some or all of my posted code may be non-standard and as such should not be used and in no case looked at.

  15. #15
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,666
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Keeping the fractional part of a quotient
    By jacobsh47 in forum C Programming
    Replies: 3
    Last Post: 03-17-2011, 11:02 AM
  2. Sum of User Defined Matrix Powers
    By QuaX in forum C Programming
    Replies: 1
    Last Post: 04-19-2009, 11:33 PM
  3. Mathematics - Factoring Fractional Exponents
    By xddxogm3 in forum A Brief History of Cprogramming.com
    Replies: 16
    Last Post: 02-09-2005, 04:49 PM
  4. Calculating a fractional value.
    By subdene in forum C++ Programming
    Replies: 4
    Last Post: 10-12-2002, 10:06 PM
  5. Seperating Main And Fractional Numbers
    By Robert_Ingleby in forum C++ Programming
    Replies: 2
    Last Post: 10-22-2001, 07:18 AM