MATLAB unable to solve 6 equations :S

  • MATLAB
  • Thread starter sgvaibhav
  • Start date
  • Tags
    Matlab
In summary, the conversation involves a person attempting to solve a problem in engineering mechanics using a solve function. They have come up with six equations and six unknowns, but the function is not giving them the correct answer. Upon further examination, they realize they have seven unknowns and one of the equations may be incorrect. The conversation ends with the person stating that their exam for engineering mechanics is over and they will not be going back to check for the correct equations.
  • #1
sgvaibhav
68
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
  • #2
or is it that some other function has to be used other than solve?
 
  • #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 that's what pops out to me right now.
 
  • #4
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.
 
  • #5


I would first suggest checking your input and equations to make sure they are correct. It is possible that there may be an error in the equations or a typo in the input that is causing the unexpected output.

If the equations and input are correct, then it is possible that there may not be a unique solution to the system of equations. In this case, MATLAB may be giving you a general solution with some unknown variables. You can try using the "assume" function to specify any assumptions about the variables, which may help narrow down the solution.

It is also possible that the equations are not linearly independent, meaning that some of the equations can be derived from the others. In this case, the system may have infinite solutions or no solutions at all.

If none of these explanations seem to apply, it may be helpful to consult with a colleague or seek assistance from MATLAB support to further troubleshoot the issue.
 

Related to MATLAB unable to solve 6 equations :S

1. What does it mean when MATLAB is unable to solve 6 equations?

When MATLAB is unable to solve 6 equations, it means that the system of equations is either inconsistent (has no solution) or has infinitely many solutions. This could be caused by errors in the equations, such as typos or incorrect coefficients, or the equations may be too complex for MATLAB to handle.

2. How can I troubleshoot and solve this issue?

To troubleshoot and solve the issue of MATLAB being unable to solve 6 equations, you can try checking for any errors in the equations, simplifying the equations if possible, or using different solvers or methods in MATLAB. You can also try breaking the system of equations into smaller parts and solving them individually.

3. Can other factors affect MATLAB's ability to solve 6 equations?

Yes, there are other factors that can affect MATLAB's ability to solve 6 equations. These include the precision and range of the numbers used in the equations, the complexity of the equations, and the limitations of the computer's memory and processing power.

4. Are there any alternatives to using MATLAB for solving 6 equations?

Yes, there are other software programs and programming languages that can be used for solving a system of 6 equations. Some popular options include Python, Mathematica, and Maple. Each of these programs has its own strengths and limitations, so it may be helpful to research and compare them before choosing one for your specific problem.

5. Is it possible to manually solve 6 equations if MATLAB is unable to do so?

Yes, it is possible to manually solve a system of 6 equations, but it may be time-consuming and prone to human error. You can use methods such as substitution, elimination, or graphing to find the solutions. It may also be helpful to consult a math tutor or textbook for guidance on solving equations by hand.

Similar threads

  • Precalculus Mathematics Homework Help
Replies
3
Views
1K
  • Introductory Physics Homework Help
Replies
12
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
22
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
7
Views
3K
  • Engineering and Comp Sci Homework Help
Replies
3
Views
2K
  • Introductory Physics Homework Help
Replies
4
Views
7K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
4K
  • Differential Geometry
Replies
1
Views
4K
  • Precalculus Mathematics Homework Help
Replies
6
Views
2K
  • Introductory Physics Homework Help
Replies
6
Views
1K
Back
Top