Skip to main content
4-Participant
October 24, 2023
Solved

Multiple Definitions Error

  • October 24, 2023
  • 2 replies
  • 1451 views

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

 

 

 

Best answer by Werner_E

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

 

 

 

 

2 replies

DJNewman
18-Opal
October 24, 2023

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?

PTC Marketer for Creo and Mathcad. I run their YouTube channels, some Creo campaigns, and all Mathcad campaigns and communications.
Werner_E25-Diamond IAnswer
25-Diamond I
October 24, 2023

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