Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations KootK on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

system of equations - square root involved

Status
Not open for further replies.

IceMan30

Military
Jan 19, 2011
32
Hey Y'all,

I'm a bit rusty, and could use some help in solving a system of equations. Let's say I have 2 equations, 2 unknowns (simplified for discussion's sake), and one of my equations looks something like:

B1 = (const1)x1 + (const2)x2^2 + sqrt(x1-x2).

Assuming I can't come up with a third equation, how do I get this thing started? I think it shouldn't be too difficult, but I can't seem to get a grasp of how to properly turn this into a system of equations matlab can solve. Thoughts or comments?

Thanks in advance for any help!

 
Replies continue below

Recommended for you

Also mupad (built into newer versions of Matlab) had a solver that can return symbolic or numeric solutions (depending on the problem).


=====================================
(2B)+(2B)' ?
 
Excellent suggestions...except that I'm on Matlab R2007a, and I only have the Image Processing and Signal Processing toolboxes. That doesn't mean I can't get Optimization or others, but I'm trying to make due with what I have at my disposal.

Very frustrating, as I can...almost...remember...what to do...but not quite. :p


But thanks for the suggestions, I will make the most out of them.


Cheers!
 
In general, to solve a nonlinear system of equations, you'll want to use a root finding algorithm. Matlab function fzero can do this. I believe it is based on Brent's method. You'll just need to make sure all the equations in your system are of the form:

(const1)x1 + (const2)x2^2 + sqrt(x1-x2) - B1 = 0
 

Thanks Brad. I think fzero, or another built-in optimization function, may be what I'm looking for. The pieces are slowly starting to fall back into place.. :)


Thanks to all.
 
I agree with the above. fsolve and fzero are easy to use. I have used them on occasion. But for some intensive problems I resorted to algorithms that I wrote for speed (ie. GA's, PSO, much quicker and global). For your problem though it should be zippy :). Also, if you are not familiar with optimization methods the optimization toolbox can be helpful.
You could also try the "Solve("equation1,equation2")" function. It sometimes gives an analytical solution that is not always obvious.

[peace]
Fe
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor