physics - physical constants with subscripts in mathematica -
i have little problem. have searched quite while haven't found answer (help, i'm beginner). want make own notebook physical calculations in mathematica 9. notebook should easy use , 1 should able overview (reason don't want use quantity every single time). want display equations in textbook. problem subscripts need electronmass example. need symbol, because want protect values. doesn't work. can change m , different value electronmass. here's notebook:
needs["notation`"]; symbolize[parsedboxwrapper[subscriptbox["_", "_"]]] subscript[m, e] = quantity["electronmass"]; subscript[m, p] = quantity["protonmass"]; subscript[m, n] = quantity["neutronmass"]; protect[subscript[m, el], subscript[m, p], subscript[m, n]]; so far good... happens...
in[19]:= m = 5 out[19]= 5 in[20]:= subscript[m, e ] out[20]= subscript[5, e] instead want
in[20]:= subscript[m, e ] out[20]= subscript[m, e] just treating subscript[m, e] independently has "m" or "e" help
an easy work around protect symbols want use, instead of
protect[subscript[m, el], subscript[m, p], subscript[m, n]]; you need write
protect[m,el,n]; that way once set values
subscript[m, n] = 2; subscript[m, el] = 4; later when evaluating them guaranteed returned correct values. quick note, might redefine subscript motive, such as
subscript[a_, b_] := a[b]
Comments
Post a Comment