Novice question regarding variable naming and subscripts
- To: mathgroup at smc.vnet.net
- Subject: [mg28136] Novice question regarding variable naming and subscripts
- From: William McHargue <William at McHargue.Com>
- Date: Sun, 1 Apr 2001 00:08:00 -0500 (EST)
- Organization: SBC Internet Services
- Sender: owner-wri-mathgroup at wolfram.com
Hello to The Math Group, I am new to this group and have a burning question about Mathematica use. (I hope to give back to the group when I have something to contribute, but presently I'm still somewhat of a novice.) In some ways you could call me a "casual" user of Mathematica. I pick it up when a project demands, but often never get REALLY good at it. Typically I like to use it to both document and define a simulation or model. I would like to use the full 2D-input to define the various equations involved, but there seems to be a problem when I define, say, a function: F_i[F_]:=F+(a/2); (where "F_i" implies "F" subscript "i") Then I wish to, say, plot this function using a variable "F" (no subscript) using this: Plot[ F_i[F]/.a->1, {F, 0, 10}] When this is evaluated it says: Plot::"plnr" : F_i[F]/.a->1 is not a machine-size real number at... (over and over again, and at valid values) Yet, it works fine if I pick a different independent variable. I realize I could use just "x" instead of "F", but by keeping the actual Input Form reading like the common equations in particular applications the whole thing is much easier to follow and debug. I wouldn't be surprised if I do not fully understand the way Mathematica manages its name space, but I would like subscripted names to be completely independent from their non-subscripted brothers--the way we humans might write equations and variables on paper. Any ideas, or perhaps chapters in the documenation I should dive into more deeply? Thanks in advance for any info in this regard, Bill. -- William B. McHargue - Physicist <mailto:William at McHargue.Com> Yahoo/Jabber IM: William_McHargue