Group Abstract Group Abstract

Message Boards Message Boards

[?] Entity throws a set:tag inactive in (....)[..] is protected, ...

Posted 9 years ago
POSTED BY: Janos Lobb
2 Replies
Posted 9 years ago

Hi Sean,

I saw the HoldComplete[ReleaseHold[Hold[... ] construct and the ReleaseHold[...] on the result when executed Michael's code in Mathematica, so I also tried ReleaseHold[...] on the Entity[...] line, but it did not worked. Of course now Activate[...] with the QuantityVariable[Subscript["M", 0],"Magnetization"]] is working and the two outputs are the same, so I can continue with me study of his blog. Thanks a lot, János

POSTED BY: Janos Lobb

Let's look at the output of

Entity["PhysicalSystem",  "RectangularBarMagnet"]["MagneticScalarPotential"]

The output will look fairly normal, but if you inspect it closely, you'll notice two things.

(1) "Subscript[M, 0]" is not actually a simple variable. Mouse over it. It's a "QuantityVariable". More specifically it's actually:

QuantityVariable[Subscript["M", 0], "Magnetization"]

You need to divide by that and not Subscript[M, 0].

(2) The expression contains Inactivate. Inactivate is a more modern way of stoping something from evaluating than using Hold. Use Activate to remove the Inactivations.

Activate[Entity["PhysicalSystem", "RectangularBarMagnet"]["MagneticScalarPotential"]/QuantityVariable[Subscript["M", 0],"Magnetization"]]
POSTED BY: Sean Clarke
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard