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

Community Tip - Your Friends List is a way to easily have access to the community members that you interact with the most! X

How do you use undefined variables?

krieder
1-Visitor

How do you use undefined variables?

Hey everyone 🙂

So, I'm working on a system of equations, in which we have some unknown variables and some variables which are known (known in the sense that they can be anything that is chosen later on, they do not have any set numerical value yet).

I'm new to MathCad. How exactly do I go about using variables which have no actual numeral value yet? They are simply symbols that should be used when performing the necessary calculations to show how they relate to the unknown variables in the system. I haven't exactly been able to find an answer in the help documents I tried to search in. All they did show was how to define variables that either had numerical values, or stood in relation to some other variables. I just need to be able to name some identities that can be moved around as if they were just any type of number.

Thank you all 🙂

5 REPLIES 5
RichardJ
19-Tanzanite
(To:krieder)

Define a function. In the function MyFunc(x):=A*sin(x), A would need to be defined before the function, but x would not because it's a parameter of the function. If you had MyFunc(x,A):=A*sin(x), then neither A or x need to be defined before the function.

Thanks for the quick response!

However, is this really the only way to do this? The reason I'm asking is that I have a system of 8 unknown variables, where there is 5 known values, which we could call AOL, VCC, B, VBE, and VLED1, as well as R1, R2, and R3 (Resistor values) are something that will simply be chosen later on, depending on the design that you want.

This is for analysis of an electrical circuit. So, using the gaussian elimination method I simply tried to write my matrices up with these terms (AOL, VCC, etc..), and of course, as soon as I've written the matrix up with these symbols/identifiers, MathCad complains that they aren't defined, as I described in my original post.

So, to simply work with such symbols I would have to go through the trouble of defining arbitrary functions in which the symbols I want to use is a part of? That seems.. odd.

StuartBruff
23-Emerald III
(To:krieder)

Kasper Rieder wrote:

Thanks for the quick response!

However, is this really the only way to do this? The reason I'm asking is that I have a system of 8 unknown variables, where there is 5 known values, which we could call AOL, VCC, B, VBE, and VLED1, as well as R1, R2, and R3 (Resistor values) are something that will simply be chosen later on, depending on the design that you want.

This is for analysis of an electrical circuit. So, using the gaussian elimination method I simply tried to write my matrices up with these terms (AOL, VCC, etc..), and of course, as soon as I've written the matrix up with these symbols/identifiers, MathCad complains that they aren't defined, as I described in my original post.

So, to simply work with such symbols I would have to go through the trouble of defining arbitrary functions in which the symbols I want to use is a part of? That seems.. odd.

I suppose it depends to some degree upon how you wish to use your variables.

If you could post a worksheet with a bit more detail, somebody might be able to suggest a different way of solving your problem. (For example, rather than using Gaussian elimination, you could possibly symbolically solve for your variables), or perhaps use the numerical solver to find what you want.

Stuart

RichardJ
19-Tanzanite
(To:krieder)

As Stuart notes, it depends on whether you are doing symbolic or numeric math. If you are doing numeric math, then Mathcad cannot handle an undefined variable, unless it's a parameter in a function definition. An undefined variable is a symbol, not a number, so what else would you expect?

from your description, I think that you want a framework with a few unknown values that will be determined at a later stage.

Without an example of what you would like to achieve it is difficult to be sure.

One possible option is the use of the global definition ~ which defines the variable from the top of the sheet.

see attached

if you try to modify the value as part of a calculation I'm not sure what will happen - you will get into circular arguments.

If this doesn't match what you are trying to achieve, it may be easier to attach a simplified example to document the issue that you have.

regards

Andy

Announcements

Top Tags