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

MATLAB unable to solve 6 equations :S

  1. Jun 15, 2010 #1
    I was solving questions on engineering mechanics
    I came up with 6 equations and 6 unkowns

    I used the solve function, but its not giving me the proper answer (it works very will with 3 unknowns and 3 equations)

    This is my input

    syms AX AY BX BZ CY CZ
    Fx = sym('AX + BY = -125');
    Fy = sym('AY + CY = 59');
    Fz = sym('BZ + CZ = 388.87');

    Mx = sym('-0.3*BZ - 0.4*AY = -212.2');
    My = sym('0.5*CZ + 0.4*AX = 0');
    Mz = sym('-0.5*CY + 0.3*BX + 0.5*AX = 0');

    [AX,AY,BX,BZ,CY,CZ] = solve(Fx,Fy,Fz,Mx,My,Mz)
    This is my output

    AX =


    AY =


    BX =


    BZ =


    CY =


    CZ =


    How is that happening?
  2. jcsd
  3. Jun 16, 2010 #2
    or is it that some other function has to be used other than solve?
  4. Jun 21, 2010 #3
    6 equations and 7 unknowns? You don't declare B_y in your initial syms statement, but it probably gets declared when it's used below. Maybe the coffee hasn't kicked in for me yet so feel free to tell me I'm an idiot :D, but thats what pops out to me right now.
  5. Jun 21, 2010 #4
    oops i just realized i have 7 unknowns :S :S :S
    and also that i forgot to declare BY.
    something wrong with the equations...

    lol, my exam is over for engineering mechanics :P, im not going back to check for the correct stuff now.
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook