Fixing Error in Tag Times: Get Quick Solutions!

Click For Summary

Discussion Overview

The discussion revolves around an error encountered in Mathematica related to the definition and use of a variable named K, specifically in the context of function definitions and the error message involving "Tag Times." Participants explore the implications of the error message and seek clarification on its meaning.

Discussion Character

  • Technical explanation
  • Debate/contested

Main Points Raised

  • Some participants suggest that the error arises because K has already been defined, and redefining it requires removing the previous definition.
  • One participant notes that the error message is not very helpful and points out that it occurs after a substitution has been made, indicating that K was substituted with a mathematical expression that cannot be used on the left side of a definition.
  • Another participant expresses confusion over the term "Tag Times" in the error message and questions whether "Times" refers to a variable in the original script.
  • A later reply clarifies that "Times" refers to multiplication in Mathematica's core language, not a variable.

Areas of Agreement / Disagreement

Participants express differing views on the clarity of the error message and its implications, with some agreeing on the nature of the error while others seek further clarification. The discussion remains unresolved regarding the best approach to handle the error.

Contextual Notes

Participants highlight the complexity of the error message and the need for careful examination of the mathematical expressions involved. There is an acknowledgment of the limitations in understanding the error without additional context from the original script.

EdisT
Messages
17
Reaction score
0
Hey, I'm unsure why the following returns an error:

1e12560bae48b507c072815f32cb9bbf.png


Any ideas on how to fix this?
 
Physics news on Phys.org
It means that you already defined K. Entering K = . will remove the previous definition of K, so you can define it again as a function.
 
  • Like
Likes   Reactions: EdisT
DrClaude said:
It means that you already defined K. Entering K = . will remove the previous definition of K, so you can define it again as a function.
Ah thank you!
 
Not the most helpful error message...
 
Mark44 said:
Not the most helpful error message...
That's because the error occurs after the substitution has been done. If you look carefully,
EdisT said:
1e12560bae48b507c072815f32cb9bbf.png
you will see the presence of [q_, N_] after a bunch of math. That bunch of math is what K was equal to: K[q_, N_] was substituted by <<value of K>>[q_, N_], including some mathematical operations that cannot appear on the left side of := .

It doesn't take long to get acquainted with "Tag [...] is Protected" in Mathematica, and one never forgets what they are due to :smile:
 
I get "Tag" but "Tag Times in ... " is inscrutable. Is "Times" the name of a variable in the OP's script?
 
Mark44 said:
I get "Tag" but "Tag Times in ... " is inscrutable. Is "Times" the name of a variable in the OP's script?
No, it's multiplication (in the core Mathematica language).
 

Similar threads

  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 3 ·
Replies
3
Views
4K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 9 ·
Replies
9
Views
3K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 6 ·
Replies
6
Views
4K
  • · Replies 13 ·
Replies
13
Views
3K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 5 ·
Replies
5
Views
6K
  • · Replies 2 ·
Replies
2
Views
3K