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

Community Tip - If community subscription notifications are filling up your inbox you can set up a daily digest and get all your notifications in a single email. X

Multiple Definitions Error

RandyA.EI
4-Participant

Multiple Definitions Error

Hello, 

 

I am trying to run this code and plot only "U" for the augmented matrix "R". However I am getting an error R has multiple definitions. 

 

Please help!

 

Thanks

 

 

 

ACCEPTED SOLUTION

Accepted Solutions
Werner_E
25-Diamond I
(To:RandyA.EI)

You never defined a variable R (its just a local(!) variable inside of your program). So Prime does not know if you mean the predefined unit R or the predefined constant R - hence the error message.

Werner_E_0-1698171970572.png

You defined a function which would have to be called to be evaluated. But as I think you just intended to create a vector R, you should assign the program to that variable.

Furthermore you were missing some multiplications and a pair of parenthesis (otherwise you run into a unit mismatch in the calculation of C).

Its not necessary to redefine e  and also omega.n was already defined above.

Werner_E_1-1698172165946.png

The start and end value of your for-loop are wrong and off by 1.

But you now run into a unit mismatch in the definition of U. You can't add quantities with different dimensions!
You will have to check your formulas!

Werner_E_3-1698172648549.png

 

 

 

 

View solution in original post

2 REPLIES 2

Try not using "R" as the variable name but use any other name, since R is already taken by other things including a unit and a constant. Alternatively, label R as a variable. (It's currently unlabelled with "automatic", which means Mathcad doesn't know what to do with it.)

PExact should also be labelled as a function.

(Watch this for more on how labels work)

https://www.youtube.com/watch?v=I68tKLGGEPc

 

When  you try to evaluate PExact and error trace it (with the red error tracing arrows in the Calculation tab in the ribbon), it'll complain about this, which the error message says should be labelled as a function (given the parenthesis), but I don't think it can be given the line right before that defining Wn as a variable.

DJNewman_0-1698171798187.png

What do you mean to do with Wn to get to WD?

I manage the Creo and PTC Mathcad YouTube channels for PTC, as well as all PTC Mathcad marketing in general.
PTC Mathcad Prime allows you to "label" the math elements in your worksheet. PTC Mathcad Prime will try to automatically label what you type, but you can change this label from the Labels drop-down in the Math tab, and change the aesthetic Label Styles from the Math Formatting tab. From the Labels
Werner_E
25-Diamond I
(To:RandyA.EI)

You never defined a variable R (its just a local(!) variable inside of your program). So Prime does not know if you mean the predefined unit R or the predefined constant R - hence the error message.

Werner_E_0-1698171970572.png

You defined a function which would have to be called to be evaluated. But as I think you just intended to create a vector R, you should assign the program to that variable.

Furthermore you were missing some multiplications and a pair of parenthesis (otherwise you run into a unit mismatch in the calculation of C).

Its not necessary to redefine e  and also omega.n was already defined above.

Werner_E_1-1698172165946.png

The start and end value of your for-loop are wrong and off by 1.

But you now run into a unit mismatch in the definition of U. You can't add quantities with different dimensions!
You will have to check your formulas!

Werner_E_3-1698172648549.png

 

 

 

 

Announcements

Top Tags