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

Community Tip - Stay updated on what is happening on the PTC Community by subscribing to PTC Community Announcements. X

Clarification on an issue related to the definition and evaluation of variables.

EH_11079495
2-Guest

Clarification on an issue related to the definition and evaluation of variables.

I am writing to you to request clarification on an issue related to the definition and evaluation of variables in Mathcad. I am using PTC Mathcad Express Prime version 10.0.0.0.

 

In the PTC documentation, it is mentioned that "Mathcad only recognizes variable definitions that are above or to the left of the variable evaluation. Otherwise, an error is returned." However, in my practice, I have observed the opposite: Mathcad recognizes the variable definition that is below and to the right of the variable evaluation, and if it does not, an error occurs. 

 

Additionally, I am experiencing a problem with unit labeling. When I try to label "a" as a drive, the label does not change when I select a new one from the list of labels.

 

I thank you in advance for your attention to these concerns and I look forward to your response.

 

Eduardo Huesca Hernandez 

 

Translated by the Community Moderation using Google Translate 

 

 

Me dirijo a ustedes para solicitar una aclaración sobre una cuestión relacionada con la definición y evaluación de variables en Mathcad. Estoy utilizando la versión PTC Mathcad Express Prime 10.0.0.0.

En la documentación de PTC, se menciona que "Mathcad solo reconoce definiciones de variable que están encima o a la izquierda de la evaluación de variables. De lo contrario, se devuelve un error." Sin embargo, en mi práctica, he observado lo contrario: Mathcad reconoce la definición de variable que está por debajo y a la derecha de la evaluación de variables, y si no es así, se produce un error.

Adicionalmente, estoy experimentando un problema con la rotulación de unidades. Cuando intento rotular "a" como unidad, el rótulo no cambia al seleccionar uno nuevo de la lista de rótulos.

Agradezco de antemano su atención a estas inquietudes y quedo a la espera de su respuesta

Eduardo Huesca Hernández

1 ACCEPTED SOLUTION

Accepted Solutions

Könnte es sein, das Sie die Begriffe "Zuweisung/Definition" (= assignment/definition, in Prime mit ":=" ) und "Auswertung" (=evaluation, in Prime mit "=") verwechseln?

Die Dokumentation, die sie zitieren ist jedenfalls schon korrekt - Mathcad liest das Arbeitsblatt so wie Sie ein Buch lesen - von oben nach unten und innerhalb einer Zeile von links nach rechts. Daher kann es Variablendefinitionen erst berücksichtigen, nachdem sie gelesen wurden. Eine Variable ist daher erst rechts bzw. unterhalb ihrer Definition auswertbar. Welchen umgekehrten Effekt Sie da beobachteten ist mir völlig unklar - ein konkretes Beipspiel (Screenshot und Worksheet) könnte helfen, ihr Problem besser zu verstehen.

Eine Ausnahme von oben genannter Regel  bildet die sogenannte globale Definition (die mit den drei Strichen). Prime liest das Arbeitsblatt zweimal - das erste Mal schaut es nur, ob globale Definitionen vorhanden sind. Diese sind dann eben, wie es der Name bereits ausdrückt, überall gültig, also sowohl unterhalb als auch oberhalb ihrer Position.
Allerdings sollten globale Definitionen sehr überlegt und sparsam verwendet werden. Sie können die Ursache für eigenartige und unerwartete Probleme sein.

Ihr Problem mit dem "Label" hab ich ihrem Text nicht wirklich entnehmen können. Vielleicht berücksichtigen Sie, dass die Umgangssprache hier im Forum idR Englisch ist. Es kann sehr helfen, wenn Sie konkrete Beispiele für Ihr Problem hier nennen und das Prime-Arbeitsblatt beifügen.

View solution in original post

3 REPLIES 3

This is what above/to the left mean:

 

DJNewman_0-1716405688715.png

miip is not recognised as a variable because it is defined below the miip-200 miles evaluation.

 

As for the units... it should work like this (note the blue colouring for the Unit label):

 

DJNewman_1-1716405853189.png

 

 

 

I manage the Creo and PTC Mathcad YouTube channels for PTC, as well as all PTC Mathcad marketing in general.

Könnte es sein, das Sie die Begriffe "Zuweisung/Definition" (= assignment/definition, in Prime mit ":=" ) und "Auswertung" (=evaluation, in Prime mit "=") verwechseln?

Die Dokumentation, die sie zitieren ist jedenfalls schon korrekt - Mathcad liest das Arbeitsblatt so wie Sie ein Buch lesen - von oben nach unten und innerhalb einer Zeile von links nach rechts. Daher kann es Variablendefinitionen erst berücksichtigen, nachdem sie gelesen wurden. Eine Variable ist daher erst rechts bzw. unterhalb ihrer Definition auswertbar. Welchen umgekehrten Effekt Sie da beobachteten ist mir völlig unklar - ein konkretes Beipspiel (Screenshot und Worksheet) könnte helfen, ihr Problem besser zu verstehen.

Eine Ausnahme von oben genannter Regel  bildet die sogenannte globale Definition (die mit den drei Strichen). Prime liest das Arbeitsblatt zweimal - das erste Mal schaut es nur, ob globale Definitionen vorhanden sind. Diese sind dann eben, wie es der Name bereits ausdrückt, überall gültig, also sowohl unterhalb als auch oberhalb ihrer Position.
Allerdings sollten globale Definitionen sehr überlegt und sparsam verwendet werden. Sie können die Ursache für eigenartige und unerwartete Probleme sein.

Ihr Problem mit dem "Label" hab ich ihrem Text nicht wirklich entnehmen können. Vielleicht berücksichtigen Sie, dass die Umgangssprache hier im Forum idR Englisch ist. Es kann sehr helfen, wenn Sie konkrete Beispiele für Ihr Problem hier nennen und das Prime-Arbeitsblatt beifügen.

LucMeekes
23-Emerald III
(To:EH_11079495)

Gracias por indicar la versión de Prime que está utilizando. Por favor, también adjuntar el archivo de hoja de trabajo Prime (archivo .mcdx) a su mensaje que muestra lo que está hablando.

Tengo la corazonada de que usaste el operador de asignación global para las variables de definición abajo y o a la derecha de su uso...


¡Éxito!
Luc

Top Tags