×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Solving multiple equations using Matlab

Solving multiple equations using Matlab

Solving multiple equations using Matlab

(OP)
Hi all,
I am quite a newbie using Matlab.. I am trying to get Matlab to solve a set of 12 equations with 12 variables using the solve function. I have written something similar to this (I pasted the original at the end):

>>solve=('equa1','equa2',..,'equa12','var1',..,'var12')

Matlabs gives a Warning:Explicit solution could not be found

Would thanks any tips..
Avi


The line:
>> solve('D1^2=h2^2+m^2' , 'D2^2=C1^2+C2^2-2*C1*C2*cos(s1)' , 'L1+L2=C5' , 'sin(b1)=C3/L1*sin(s1+a1)' , 'cos(b3)=(C5^2+D1^2-D2^2)/(2*C5*D1)' , 'sin(b1)=C3/C2*sin(b2+a2)' , 'cos(s2)=(C1^2+h^2-H^2)/(2*C1*h)' , 'sin(b4)=C2/D2*sin(s1)' , 'sin(b5)=L1/D2*sin(b2)' ,'tan(b7)=m/h', 'cos(b6)=(D1^2+C4^2-L2^2)/(2*D1*C4)' , 's2+b4+b5+b6+b7=360', 's1', 's2', 'b1', 'b2', 'b3', 'b4', 'b5', 'b6', 'b7', 'L1', 'L2', 'D2')

 
 

RE: Solving multiple equations using Matlab

I'm not familiar with Matlab capabilities in this area.  It sounds like it cannot find an explicit algebraic solution with those variables all on the left hand side of the expression.

In Maple there is an fsolve command which gives numerical (f for floating) solution. In Matlab maybe it is something like option = numerical?

=====================================
Eng-tips forums: The best place on the web for engineering discussions.

RE: Solving multiple equations using Matlab

If you type help solve you will see that solve is a symbolic  solver, therefore if the system of equations doesn't admit a solution in closed form (and it seems to be the case since you have trigonometric and power functions) matlab cannot do anything about it.

If you are interested in finding a numerical solution of your system (i.e. an approximation of the solutions of which you can chose the grade of accuracy) check the command fsolve typing help fsolve. This is a numerical solver for systems of nonlinear equations. Remember that for each run of the command you will obtain only one root (whereas your system might admit much many than one solution).

The numerical procedure mught converge towards different solutions depending on the initial guess or it might diverge for a very bad guess.

If you want to find all the solutions I suggest you to implement a cycle in which you randomly chose the initial guess. Since you have a pretty large system of non linear equations I recommend you to do several iterations and memorize the solutions.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources