Re: Novice question regarding variable naming and subscripts
- To: mathgroup at smc.vnet.net
- Subject: [mg28188] Re: [mg28136] Novice question regarding variable naming and subscripts
- From: Tomas Garza <tgarza01 at prodigy.net.mx>
- Date: Tue, 3 Apr 2001 02:38:06 -0400 (EDT)
- References: <200103310759.CAA13165@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
Don't use "blank", i.e., the underscore "_", to "imply a subscript". It has
a well-defined mission in Mathematica. I suggest you use the basic input
palette to write F-subscript and it is much easier. Then (in input form) it
reads
In[1]:=
Subscript[F, i][F_] := F + a/2
and your plot will appear with
Plot[Evaluate[Subscript[F, i][F] /. a -> 1], {F, 0, 10}];
Copy this into your notebook, and convert the cells to StandardForm: select
each cell and then Cell|ConvertTo|StandardForm so that the notation you
want to use shows properly.
Tomas Garza
Mexico City
----- Original Message -----
From: "William McHargue" <William at McHargue.Com>
To: mathgroup at smc.vnet.net
Subject: [mg28188] [mg28136] Novice question regarding variable naming and subscripts
> 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
>