First level:
To address precisely your example, the expression
f[Subscript[\[Beta_], 1] ] := 0.1*Subscript[\[Beta], 1]
defines the function that only acts on any variable with the subscript 1. For this reason, this works:
f[Subscript[\[Alpha], 1]]
(* 0.1 Subscript[\[Alpha], 1] *)
but this does not
f[0.5]
(* f[0.5] *)
This also does not:
f[Subscript[\[Alpha], 2]]
(* f[Subscript[\[Alpha], 2]] *)
just because the function f we defined with the subscript 1, not with 2.
As a funny example of your definition which works, let us evaluate this:
f[Subscript[0.5, 1]]
(* 0.1 Subscript[0.5, 1] *)
It works, as you see, whatever Subscript[0.5, 1] should mean.
The correct definition of your function should be:
g[x_] := 0.1*x
Then
g[Subscript[\[Alpha], 1]]
yields
(* 0.1 Subscript[\[Alpha], 1] *)
as it should be. If we first fix Alpha1:
Subscript[\[Alpha], 1] = 0.5;
g[Subscript[\[Alpha], 1]]
(* 0.05 *)
That's probably what you expect.
Second level:
However, it seems to me that you fall down into the so-called, XY problem. To go out of it, let me say that I realize that you need to use both Greek letters and subscripts in your work. So, what to do? Is it, what you really asked? If yes, then please read below, if not, skip it.
Here there are two questions:
- How to use Greek letters?
- What to do with subscripts?
The answer to the first question is straightforward, and, in fact, you somehow have already solved it since you already used Greek letters. You know probably, that there are three ways to enter such a letter?
The story with subscripts is not that easy. In principle, at present, subscripts are designed for presenting mathematical expressions, but not for using them in calculations. It is because the structures of the variable like a1
and the one like Subscript[a,1]
are different. To check it just evaluate the two following expressions
TreeForm[a1]
TreeForm[Subscript[a, 1]]
The complex structure visible in the latter expression has the potential to disturb some Mma operations, such as Simplify
, for example. But only a potential. That is, in some cases, it disturbs, in others, it does not, and you never know what will happen.
For this reason, one is generally discouraged to use subscripts in calculations.
What to do if you inevitably need it?
The simple idea is to use letters with numbers, during the calculations and only transform these numbers into the subscripts after the calculation has been finished.
Here is a most trivial example:
(a1^2 + b1^2)/c2^3 /. {a1 -> Subscript[a, 1], b1 -> Subscript[b, 1],
c2 -> Subscript[c, 2]}
yielding this:
Otherwise, you can do it like this:
(a1^2 + b1^2)/c2^3 /. {a1 -> Subscript[\[Alpha], 1],
b1 -> Subscript[\[Beta], 1], c2 -> Subscript[\[Gamma], 2]}
with the following effect:
Depending upon the expressions you meet in your work, one may write a bit more sophisticated rules. Moreover, you may make one universal rule once forever. You can apply the rule in question either to visualize an intermediate expression to better understand it, or to make the final expression look traditional. Otherwise, you may do it to prepare the expression to use in a report, article, or presentation.
Have fun!
g[\[Beta][1] _] := 0.1*\[Beta][1]
$\endgroup$a[1] , a[2], a[3],...
orb[1,1], b[1,2] ,b[1,3]...
. If I do want answers to look smart I do this at the end with replacements rules likeposhForm={a[1]->a_1, a[2]-> a_2}
. Sorry to suggest that you are making more effort than you need to. Perhaps someone has a good method; Let's see. $\endgroup$Notation
Package andSymbolize
. $\endgroup$Clear[g]; g[β[1]_] := 0.1*β[1]; g[1]
givesg[1]
... $\endgroup$