cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

System of Nonlinear Equations

Highlighted
Newbie

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

5 REPLIES 5

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

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

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

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

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.