I am getting the magnetic scalar potential of a bar magnet:
rbm = Entity["PhysicalSystem", "RectangularBarMagnet"][
"MagneticScalarPotential"];
I make it Active:
rbmmsp[x_, y_, z_] = Activate[rbm];
Then, I differentiate it to get the magnetic field:
rbmmf[x_, y_,
z_] = -D[
rbmmsp[x, y,
z], {{QuantityVariable["x", "Length"],
QuantityVariable["y", "Length"],
QuantityVariable["z", "Length"]}}];
Then, I would like to see what is its value, - if I give some values to system variables M0,a,b,c
-, in a given {x,y,z}
point. So, I do:
(* Let's see how does it look like for a point at {0.03,0.03,0.03} \
from the (0.01,0.01,0.01) cube. Lengths are in Meters*)
mmf = rbmmf[x, y,
z] //. {Subscript["M", 0] -> Quantity[10^6, "Ampere/Meter"],
"a" -> Quantity[0.03, "Meter"] , "b" -> Quantity[0.03, "Meter"],
"c" -> Quantity[0.03, "Meter"], "x" -> Quantity[0.01, "Meter"],
"y" -> Quantity[0.01, "Meter"], "z" -> Quantity[0.01, "Meter"]};
My expectation is, that if at this point I ask for the QuantityMagnitude
and QuantityUnit
of mmf//N
, I should have a simple three component numeric vector for magnitudes and an "A/m"
for unit. Well, looks like my expectations are overwritten.
{QuantityMagnitude[mmf // N], QuantityUnit[mmf // N]}
What is wrong here? Thanks ahead, János