×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Are you an
Engineering professional?
Join Eng-Tips Forums!
• Talk With Other Members
• Be Notified Of Responses
• Keyword Search
Favorite Forums
• Automated Signatures
• Best Of All, It's Free!

*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.

# system of equations - square root involved

## system of equations - square root involved

(OP)
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!

### RE: system of equations - square root involved

#### Quote:

... 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?
http://www.mathworks.com/help/toolbox/optim/ug/fsolve.html

=====================================
(2B)+(2B)'  ?

### RE: system of equations - square root involved

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

=====================================
(2B)+(2B)'  ?

### RE: system of equations - square root involved

(OP)
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!

### RE: system of equations - square root involved

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

### RE: system of equations - square root involved

(OP)

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.

### RE: system of equations - square root involved

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.

Fe

#### 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.

Close Box

# Join Eng-Tips® Today!

Join your peers on the Internet's largest technical engineering professional community.
It's easy to join and it's free.

Here's Why Members Love Eng-Tips Forums:

• Talk To Other Members
• Notification Of Responses To Questions
• Favorite Forums One Click Access
• Keyword Search Of All Posts, And More...

Register now while it's still free!