How to Solve Systems of Equations Through Solve Blocks in Mathcad

Solve blocks are a Mathcad construct that lets you solve any number of equations and unknown variables.

The function Find returns a solution to a system of equations given by a solve block. You can use Find to solve a linear system or nonlinear systems.

How to Use Mathcad Prime Solve Blocks

  1. Insert a Solve Block from the Math tab and add two guess values. Note that the Guess Values label moves to bracket that section. The algorithm for Find starts at these values and moves toward a solution.The solve block box allows you to reposition the solve block on the page, without worrying about losing any of the pieces. Definitions inside the solve block are local to the solve block.

    Mathcad's Solve Block

  2. Next add your constraints. You must have the same number of constraints as variables you are solving. You do not need the word Given, unlike earlier versions of Mathcad.
  3. For the equals sign, use the Boolean Equals operator, Ctrl+=Note: The entries of the solution vector correspond to the variables in the same order that the variables appear after Find. Type in Find(y, x) to return the entries in reverse order. Evaluate the left-hand sides of the system with the found results to confirm that the solution is correct.
  4. All of the data has been entered

Multiple Solutions 
Take a look at the solve block below.

Now, one as an example

The first equation represents an ellipse, while the second represents a straight line. These are plotted below, along with the solution point.

The same block, presented graphically

As the graph shows, the solution corresponds to the point in the first quadrant where the curve and the line intersect. However, there is another solution to the system, corresponding to the point of intersection in the second quadrant. How can you get Find to return this second solution?

Change the Guess Value
Changing the guess values reveals other solutions. Keep in mind that the result returned by the function Find (as well as by the functions Minerr, Minimize, and Maximize) is directly related to the guess values for the unknown variables, and at most one solution is returned for a given set of guess values.

So changing the guess values might lead to a different solution.

Looking at the graph above, you can see that the second solution lies in the second quadrant. So it seems reasonable to try guess values corresponding to a point – the guess point – that also lies in the second quadrant. Try the guess point (-3, 3).

The solver finds the same answer as the graphical solution.

This time Find returns the second solution.

Usually, if you choose a guess point close to a solution, Find returns that solution. However, as with the root function, Find does not always return the solution that is closest to the given guess point.

You can see the relationship between guess points and their corresponding solutions graphically by defining a function that takes a guess point to the resulting solution.

For any guess point (x, y), the function Pt(x,y) returns one of the two solutions. For example:Now, see what happens when you apply the Pt function to 25 guess points, equally spaced on a circle of radius 4 with center at the origin. Draw a line from each guess point to the solution produced by the Pt function for that guess. The resulting plot is quite interesting. By changing the guess point, you can find both possible solutions.

Notice that most guess points in the right half-plane (x > 0) lead to the solution (4,3). However, some points in the right half-plane lead to the solution (-3.71, 0.657)Try changing R to 6 in the example above to see what happens when the guess points lie on a circle of radius 6.

Find uses the Levenberg-Marquardt method, a very stable routine that is tolerant of poor guesses.

What these examples show is that choosing guess values is actually a guessing game. A picture can help you identify the guess points that return the solutions you are looking for.

There’s lots more to learn about solve blocks, but this should get you going. Part two of this article will discuss what to do when the solve block does not find a solution.
>> Visit the Mathcad Community website for the Mathcad Prime 1.0 and  Mathcad 15 worksheets.

About Bettina Giemsa

I graduated from Ruhr University in Bochum, Germany, with a Master of Arts in American Studies, Japanese, Economics * Started my career in Marketing on the agency side, spending almost 3 years in media planning * Ran Marketing at ITEDO Software GmbH, Germany from 2001-2006 where I first got in touch with the CAD business * Became part of the PTC Marketing organization when ITEDO was acquired by PTC in October 2006 * Last, but not least, I am the mother of a 4-year-old, and sometimes wonder which is harder to cope with: a little girl with a temper or a busy workday…
This entry was posted in Tips & Tricks and tagged , , , , , , . Bookmark the permalink.

13 Responses to How to Solve Systems of Equations Through Solve Blocks in Mathcad

  1. Pingback: Forex Power Trading System

  2. Mathias Bachmann says:

    I have problems solving something a little diferent than what’s shown. Can I get any help here?

  3. Pingback: Happy 3rd Birthday to the Mathcad Blog! | PTC

  4. Pingback: Calculating the Probability of Failure for Anti-Friction Bearings in Mathcad Prime 2.0 | PTC

  5. Rodolfo says:

    use Gauss method, it is the simple method to solve the “system of equations.

  6. Al says:

    What is the shortcut to implement Find()? I type it in and it doesn’t do anything?

  7. Jakov Kucan says:

    “find” must be part of a solve block — it will not work outside. Simply type “find(” you will notice that it changes font as you type “(“. This is because the KEYWORD label is applied. You can also apply the KEYWORD label using Labels drop-down on the Math tab. Hope this helps.

    Another way to get started with solve blocks is to search help for Solve Block examples. You can copy equations from help into the worksheet.

  8. Pingback: Happy 4th Birthday to the PTC Mathcad Blog! | PTC

  9. Kyle says:

    How could you solve a system of equations that have a greater number of constraints than variables in Mathcad?

  10. Anna Giangregorio says:

    Hi Kyle- we’ve attached examples of how to do this here: http://communities.ptc.com/docs/DOC-4237

  11. Torgrim says:

    How did you plot the equation 2x^3 + 3y^2 = 59?
    Can Mathcad Prime plot implicit functions/equations? I tried in my Mathcad but only get error messages.

    • Your suspicions are correct. Mathcad Prime does not support the plotting of implicit equations. The red circle you’re referring to was most likely generated with two functions: +/- sqrt(59 – 2*x^2) / 3.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s