Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Solution of linear equation using Mathematica

  1. Aug 22, 2011 #1
    Please any one can help me for finding solution of linear equation by using mathematica,

    for example take us equations as,

    9x+10y+7z+18 w=8
    3x-3y-8z+88 w=0
    12x+9y-17z-14w=2
    x+y-2z+w=0

    Infect I have to use this thing in my code which will be good by using this thing,,,

    Any suggestion will be appreciated.
     
  2. jcsd
  3. Aug 22, 2011 #2
    Look carefully at the second example on this web page:

    http://reference.wolfram.com/mathematica/ref/Solve.html

    That shows how to do this with two equations and two unknowns.

    Mathematica is extremely demanding, but from the example (which is also available via Help in your Mathematica) you should be able to carefully substitute your four equations and variables and get the answer you need.
     
  4. Aug 22, 2011 #3
    my equations are bit complecated I tried that steps but could not get any solution should I V = {{H61, H62, H63, H64, H65}, {H71, H72, H73, H74, H75}, {k1*H31,
    k2*H32, k3*H33, k4*H34, k5*H35}, {H41, H42, H43, H44, H45}, {H11,
    H12, H13, H14, H15}};
    V. {x, y, q, e, r} == {-p, 0, 0, 0, f}
    Solve[V.{x, y, q, e, r} == {-p, 0, 0, 0, f}, {x, y, q, e, r}]


    result I got is
    {(-9.36962 - 0.00479499 I) e - (9.376 + 0.0287764 I) q - (9.43042 +
    0.00480491 I) r - (9.39997 + 0.0384002 I) x - (9.424 +
    0.0288234 I) y, (-15.9923 - 0.0012228 I) e - (15.994 +
    0.007308 I) q - (16.0075 + 0.0011772 I) r - (16.0001 +
    0.0096 I) x - (16.006 + 0.007092 I) y, (-8.12243*10^-25 -
    5.14424*10^-24 I) e - (4.87349*10^-24 +
    4.06129*10^-24 I) q - (8.12243*10^-25 - 5.14424*10^-24 I) r -
    6.49805*10^-24 x - (4.87349*10^-24 -
    4.06129*10^-24 I) y, (1.88504*10^-13 +
    5.37235*10^-20 I) e + (1.88504*10^-13 +
    2.5448*10^-19 I) q + (1.88504*10^-13 - 5.37235*10^-20 I) r +
    1.88504*10^-13 x + (1.88504*10^-13 -
    2.5448*10^-19 I) y, (-3.29661*10^-42 -
    1.03546*10^-63 I) e - (3.29661*10^-42 +
    1.25698*10^-63 I) q - (3.29661*10^-42 - 1.03546*10^-63 I) r -
    3.29661*10^-42 x - (3.29661*10^-42 - 1.25698*10^-63 I) y} == {-10,
    0, 0, 0, 0.5}
    and for solution is
    {}
     
  5. Aug 22, 2011 #4
    sorry all the above constants are predefined, means p,f,Hs are all defined
     
  6. Aug 22, 2011 #5
    If you can, just for the purpose of being able to get an answer to your question, create a small example notebook with

    H61=2; H62=4; H63=3.1; etc. containing all and exactly what you are trying to solve and
    getting rid of all unneeded information but keeping exactly what is needed for the problem

    and then copy exactly what you are trying to solve into a posting

    then I will try to make sense of what you are doing and show how to get a solution.

    I assume you can understand how difficult it would be if some student wandered into your office and said "I have some equations and some numbers and I can't solve it, but you can't see what I have, what do I do?"
     
  7. Aug 22, 2011 #6
    You are right I let me try for simple values and then I will be in touch,
    my constants are complexed values basically
    thanks alot,
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook