Get Help

Turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- Community
- :
- PTC Mathcad
- :
- PTC Mathcad
- :
- System of Nonlinear Equations

Options

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

Highlighted
##

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

12-21-2010
11:10 AM

12-21-2010
11:10 AM

System of Nonlinear Equations

Hello and seasons greetings to all.

I am a MathCad neophyte and am running into a problem trying to solve a system of seven nonlinear equations. This is a real world civil engineering phorensics problem where I am trying to understand a water distribution system as it existed in 1907. I have generalized my equations and I believe they are independent. I am using the "find" function in MathCad and I have set up my problem and MathCad sheet similarly to an example I found in another forum. The example works quite well, but for my specific problem I can not get MathCad to start crunching. I keep getting an infernal "variable not defined" error.

Any help or pointers would be greatly appreciated.

Thank you,

Mat

Labels:

5 REPLIES 5

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

12-22-2010
09:21 AM

12-22-2010
09:21 AM

Re: System of Nonlinear Equations

Mat,

Are you defining guess values for your variables. In Mathcad, to use a solve block you must first define your variables with guess values before entering the constraints to use the find function, and I believe the error you get stems from not defining your variables in this initial stage. If you have further problems you should find the quicksheet (help --> quicksheets) corresponding to solving systems of nonlinear equations, which will offer you a brief tutorial.

I hope this helps,

DJ

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

12-23-2010
01:31 PM

12-23-2010
01:31 PM

Re: System of Nonlinear Equations

DJ,

Thanks for the reply.

I believe the worksheet defines the variables. I have a heading title "Guess" under that heading I have the following:

X := (150 5 5.1 6 350 100 355)^T

As I understand it this is providing guesses for all of my variables, X1, X2, ..., X7, in vector notation. This guess format is similar to the working example I am emulating.

Since your post I have also tried a more simple form of guessing where I define each guess separately, i.e. X1 := 150, X2 := 5, ..., X7 := 355. This results in the same error: "This variable is undefined".

Mat

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

12-27-2010
01:33 PM

12-27-2010
01:33 PM

Re: System of Nonlinear Equations

There are a couple of problems with your worksheet.

- You have defined a vector X, but you haven't called the elements correctly. You need to use keystroke X[0 X[1....etc instead of X.1.
- You have also called up X.7, but vector X only has seven elements, so you need to either change ORIGIN to 1 or change the numbers associated with the elements.

Hope this helps.

Mike

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

01-03-2011
01:09 PM

01-03-2011
01:09 PM

Re: System of Nonlinear Equations

Mike,

Thanks for the reply. Now I'm getting somewhere. I feared it had something to do with syntax and/or notation due to my inexperience with MathCAD. I incorporated the changes you suggested, as I understood them. I also did away with the vector component to the worksheet. And...progress...maybe. Intead of "variable not defined", I now get an error message that says "something is wrong with the solve block...".

I've been over the new variation of my worksheet several times and do not see an obvious error in the solve block. Maybe you could take one more quick look and offer feedback.

Many thanks,

Mat

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

01-03-2011
04:23 PM

01-03-2011
04:23 PM

Re: System of Nonlinear Equations

I also did away with the vector component to the worksheet. And...progress...maybe. Intead of "variable not defined", I now get an error message that says "something is wrong with the solve block...".

You did the opposite. "[" is a vector subscript, "." is a literal subscript (i.e. just part of the name - it has no effect).

Note that your solution (or, more accurately, lack of a solution ) depends a lot on the guess values.

Top Tags