MATLAB unable to solve 6 equations :S

  • Context: MATLAB 
  • Thread starter Thread starter sgvaibhav
  • Start date Start date
  • Tags Tags
    Matlab
Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
3 replies · 4K views
sgvaibhav
Messages
65
Reaction score
0
Hi,
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 =

398.07916666666666666666666666667-1.6666666666666666666666666666667*AY



AY =

1.1111111111111111111111111111111*AY-565.13194444444444444444444444444



BX =

-523.07916666666666666666666666667+1.6666666666666666666666666666667*AY



BZ =

-1.3333333333333333333333333333333*AY+707.33333333333333333333333333333



CY =

-1.*AY+59.



CZ =

-318.46333333333333333333333333333+1.3333333333333333333333333333333*AY

___________________________________
How is that happening?
 
Physics news on Phys.org
or is it that some other function has to be used other than solve?
 
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 that's what pops out to me right now.
 
Cvan said:
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 that's what pops out to me right now.

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, I am not going back to check for the correct stuff now.